Permalink
Browse files

Make cucumber specs run on machines that know their hostname.

  • Loading branch information...
1 parent a68e268 commit 9e9443a999506502557096c5d756b5291fc2aacf Graham Hughes committed Sep 13, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 features/step_definitions/logs.rb
@@ -22,17 +22,17 @@
#++
Then /^the logs should show a \"([^\"]*)\" user agent$/ do |ua|
- File.open("#{@tmpdir}/weblog.out").read.should =~ /\Alocalhost - - \[[^\]]*\] \"GET [^ ]+ HTTP\/1\.1\" \d+ \d+ \"-\" \"#{Regexp.escape(ua)}\"\n\Z/
+ File.open("#{@tmpdir}/weblog.out").read.should =~ /\A\w+ - - \[[^\]]*\] \"GET [^ ]+ HTTP\/1\.1\" \d+ \d+ \"-\" \"#{Regexp.escape(ua)}\"\n\Z/
end
Then /^the proxy should have been used$/ do
- File.open("#{@tmpdir}/proxy.out").read.should =~ /\Alocalhost - [^ ]+ \[[^\]]*\] \"GET #{Regexp.escape(@uri.to_s)} HTTP\/1\.1\" \d+ \d+ \"-\" \".*\"\n\Z/
+ File.open("#{@tmpdir}/proxy.out").read.should =~ /\A\w+ - [^ ]+ \[[^\]]*\] \"GET #{Regexp.escape(@uri.to_s)} HTTP\/1\.1\" \d+ \d+ \"-\" \".*\"\n\Z/
end
Then /^the proxy should have been tunneled through$/ do
Given "the proxy should have been tunneled through with a 200 status code"
end
Then /^the proxy should have been tunneled through with a (\d+) status code$/ do |code|
- File.open("#{@tmpdir}/proxy.out").read.should =~ /^localhost - [^ ]+ \[[^\]]*\] \"CONNECT #{Regexp.escape(@uri.host)}:#{Regexp.escape(@uri.port.to_s)} HTTP\/1\.1\" #{Regexp.escape(code)} \d+ \"-\" \".*\"\n$/
+ File.open("#{@tmpdir}/proxy.out").read.should =~ /^\w+ - [^ ]+ \[[^\]]*\] \"CONNECT #{Regexp.escape(@uri.host)}:#{Regexp.escape(@uri.port.to_s)} HTTP\/1\.1\" #{Regexp.escape(code)} \d+ \"-\" \".*\"\n$/
end

0 comments on commit 9e9443a

Please sign in to comment.