diff --git a/spec/std/gzip/gzip_spec.cr b/spec/std/gzip/gzip_spec.cr index 750fd91a6c0f..2cdd9ecc2bb1 100644 --- a/spec/std/gzip/gzip_spec.cr +++ b/spec/std/gzip/gzip_spec.cr @@ -5,7 +5,7 @@ describe Gzip do it "writes and reads to memory" do io = IO::Memory.new - time = Time.new(2016, 1, 2) + time = Time.utc(2016, 1, 2) os = 4_u8 extra = Bytes[1, 2, 3] name = "foo.txt" diff --git a/spec/std/http/cookie_spec.cr b/spec/std/http/cookie_spec.cr index c5a928fd00fc..a3e717de404e 100644 --- a/spec/std/http/cookie_spec.cr +++ b/spec/std/http/cookie_spec.cr @@ -97,7 +97,7 @@ module HTTP it "parses expires rfc1123" do cookie = parse_set_cookie("key=value; expires=Sun, 06 Nov 1994 08:49:37 GMT") - time = Time.new(1994, 11, 6, 8, 49, 37) + time = Time.utc(1994, 11, 6, 8, 49, 37) cookie.name.should eq("key") cookie.value.should eq("value") @@ -106,7 +106,7 @@ module HTTP it "parses expires rfc1036" do cookie = parse_set_cookie("key=value; expires=Sunday, 06-Nov-94 08:49:37 GMT") - time = Time.new(1994, 11, 6, 8, 49, 37) + time = Time.utc(1994, 11, 6, 8, 49, 37) cookie.name.should eq("key") cookie.value.should eq("value") @@ -115,7 +115,7 @@ module HTTP it "parses expires ansi c" do cookie = parse_set_cookie("key=value; expires=Sun Nov 6 08:49:37 1994") - time = Time.new(1994, 11, 6, 8, 49, 37) + time = Time.utc(1994, 11, 6, 8, 49, 37) cookie.name.should eq("key") cookie.value.should eq("value") @@ -124,12 +124,12 @@ module HTTP it "parses expires ansi c, variant with zone" do cookie = parse_set_cookie("bla=; expires=Thu, 01 Jan 1970 00:00:00 -0000") - cookie.expires.should eq(Time.new(1970, 1, 1, 0, 0, 0)) + cookie.expires.should eq(Time.utc(1970, 1, 1, 0, 0, 0)) end it "parses full" do cookie = parse_set_cookie("key=value; path=/test; domain=www.example.com; HttpOnly; Secure; expires=Sun, 06 Nov 1994 08:49:37 GMT") - time = Time.new(1994, 11, 6, 8, 49, 37) + time = Time.utc(1994, 11, 6, 8, 49, 37) cookie.name.should eq("key") cookie.value.should eq("value") diff --git a/spec/std/http/http_spec.cr b/spec/std/http/http_spec.cr index a0ab875255e5..e29d4b7ae55f 100644 --- a/spec/std/http/http_spec.cr +++ b/spec/std/http/http_spec.cr @@ -3,24 +3,24 @@ require "http" describe HTTP do it "parses RFC 1123" do - time = Time.new(1994, 11, 6, 8, 49, 37) + time = Time.utc(1994, 11, 6, 8, 49, 37) HTTP.parse_time("Sun, 06 Nov 1994 08:49:37 GMT").should eq(time) end it "parses RFC 1123 without day name" do - time = Time.new(1994, 11, 6, 8, 49, 37) + time = Time.utc(1994, 11, 6, 8, 49, 37) HTTP.parse_time("06 Nov 1994 08:49:37 GMT").should eq(time) end it "parses RFC 1036" do - time = Time.new(1994, 11, 6, 8, 49, 37) + time = Time.utc(1994, 11, 6, 8, 49, 37) HTTP.parse_time("Sunday, 06-Nov-94 08:49:37 GMT").should eq(time) end it "parses ANSI C" do - time = Time.new(1994, 11, 6, 8, 49, 37) + time = Time.utc(1994, 11, 6, 8, 49, 37) HTTP.parse_time("Sun Nov 6 08:49:37 1994").should eq(time) - time2 = Time.new(1994, 11, 16, 8, 49, 37) + time2 = Time.utc(1994, 11, 16, 8, 49, 37) HTTP.parse_time("Sun Nov 16 08:49:37 1994").should eq(time2) end