From a2590a55c8330d4c2dd5800559ead2fda905c424 Mon Sep 17 00:00:00 2001 From: Kerrick Long Date: Fri, 14 Nov 2025 08:24:20 -0600 Subject: [PATCH] Add rspec I learned of the need for this redirect by clicking the link in "Introducing BDD" by Dan North, which was a bibliographical reference in _Developer Testing_ by Alexander Tarlinder. --- config/match-redirects.vcl | 4 ++++ test/fastly-config-test.rb | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/config/match-redirects.vcl b/config/match-redirects.vcl index 06f9bfd..e800c95 100644 --- a/config/match-redirects.vcl +++ b/config/match-redirects.vcl @@ -2,6 +2,10 @@ if (req.http.host ~ "^gems.") { error 600 "https://rubygems.org"; } +if (req.http.host ~ "^rspec.") { + error 600 "https://rspec.info"; +} + if (req.http.host ~ "^mocha.") { error 600 "https://github.com/freerange/mocha"; } diff --git a/test/fastly-config-test.rb b/test/fastly-config-test.rb index 52e70d8..5845f3b 100644 --- a/test/fastly-config-test.rb +++ b/test/fastly-config-test.rb @@ -24,6 +24,12 @@ def test_gems assert_equal "https://rubygems.org", response['Location'] end + def test_rspec + response = request "http://rspec.#{DOMAIN}" + assert_equal '301', response.code + assert_equal "https://rspec.info", response['Location'] + end + def test_mocha_subdomain response = request "http://mocha.#{DOMAIN}" assert_equal '301', response.code @@ -41,4 +47,4 @@ def test_mocha_project def request(uri) Net::HTTP.get_response URI(uri) end -end \ No newline at end of file +end