diff options
author | sorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-06 05:54:01 +0000 |
---|---|---|
committer | sorah <sorah@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-06 05:54:01 +0000 |
commit | 453726f26a0a909357cbb757b648fc5fcb2b181b (patch) | |
tree | c0cbae5bff06facd0a311741c760fe0d33f46597 | |
parent | 43dc0d4080f1dc0daa45f3b54dccdc06cc5aa7c5 (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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/cgi/test_cgi_header.rb | 7 |
2 files changed, 11 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Wed Jul 6 12:18:09 2011 Shota Fukumori <sorah@tubusu.net> + + * 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 + Tue Jul 5 15:28:04 2011 Nobuyoshi Nakada <nobu@ruby-lang.org> * parse.y (parser_here_document): should dispatch heredoc_end 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" |