diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/test_response.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/test_response.rb b/test/unit/test_response.rb index 7dcf977..ac549bc 100644 --- a/test/unit/test_response.rb +++ b/test/unit/test_response.rb @@ -7,12 +7,23 @@ # for more information. require 'test/test_helper' +require 'time' include Unicorn class ResponseTest < Test::Unit::TestCase include Unicorn::HttpResponse + def test_httpdate + before = Time.now.to_i + str = httpdate + assert_kind_of(String, str) + middle = Time.parse(str).to_i + after = Time.now.to_i + assert before <= middle + assert middle <= after + end + def test_response_headers out = StringIO.new http_response_write(out,[200, {"X-Whatever" => "stuff"}, ["cool"]]) |