about summary refs log tree commit homepage
path: root/test/unit/test_response.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/test_response.rb')
-rw-r--r--test/unit/test_response.rb11
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"]])