summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-06 05:54:01 +0000
committersorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-06 05:54:01 +0000
commit453726f26a0a909357cbb757b648fc5fcb2b181b (patch)
treec0cbae5bff06facd0a311741c760fe0d33f46597 /test
parent43dc0d4080f1dc0daa45f3b54dccdc06cc5aa7c5 (diff)
* test/cgi/test_cgi_header.rb(test_cgi_header_nph): Fix bug depends to
time. The test fails if time past 1 second in line 136-145 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/cgi/test_cgi_header.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/cgi/test_cgi_header.rb b/test/cgi/test_cgi_header.rb
index 6b110a07f6..beaf17eb1b 100644
--- a/test/cgi/test_cgi_header.rb
+++ b/test/cgi/test_cgi_header.rb
@@ -143,9 +143,14 @@ class CGIHeaderTest < Test::Unit::TestCase
ENV['SERVER_SOFTWARE'] = 'IIS/5.0'
actual4 = cgi.header
actual5 = cgi.header('status'=>'REDIRECT', 'location'=>'http://www.example.com/')
+ date = /^Date: [A-Z][a-z]{2}, \d{2} [A-Z][a-z]{2} \d{4} \d\d:\d\d:\d\d GMT\r\n/
+ [actual1,actual2,actual3].each do |actual|
+ assert_match(date,actual)
+ actual.sub!(date,"Date: DATE_IS_REMOVED\r\n")
+ end
## assertion
expected = "HTTP/1.1 200 OK\r\n"
- expected << "Date: #{CGI.rfc1123_date(now)}\r\n"
+ expected << "Date: DATE_IS_REMOVED\r\n"
expected << "Server: Apache 2.2.0\r\n"
expected << "Connection: close\r\n"
expected << "Content-Type: text/html\r\n"