diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/ffi_yajl/encoder_spec.rb | 3 | ||||
-rw-r--r-- | spec/ffi_yajl/json_gem_spec.rb | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/spec/ffi_yajl/encoder_spec.rb b/spec/ffi_yajl/encoder_spec.rb index b358f17..f658d95 100644 --- a/spec/ffi_yajl/encoder_spec.rb +++ b/spec/ffi_yajl/encoder_spec.rb @@ -1,6 +1,7 @@ # encoding: UTF-8 require 'spec_helper' +require 'date' describe "FFI_Yajl::Encoder" do @@ -76,7 +77,7 @@ describe "FFI_Yajl::Encoder" do end it "encodes them correctly" do - ruby = DateTime.parse('2001-02-03T04:05:06.1+07:00').to_time + ruby = Time.local(2001, 02, 02, 21, 05, 06) expect(encoder.encode(ruby)).to eq( %q{"2001-02-02 21:05:06 +0000"} ) end end diff --git a/spec/ffi_yajl/json_gem_spec.rb b/spec/ffi_yajl/json_gem_spec.rb index 1aa1edd..2bf4d35 100644 --- a/spec/ffi_yajl/json_gem_spec.rb +++ b/spec/ffi_yajl/json_gem_spec.rb @@ -4,6 +4,7 @@ # Kinda looks like they stole it from the JSON gem. I updated the syntax a lot. require 'spec_helper' +require 'date' class Dummy; end @@ -159,7 +160,7 @@ describe "JSON Gem Compat API" do end it "encodes Time values correctly" do - t = DateTime.parse('2001-02-03T04:05:06.1+07:00').to_time + t = Time.local(2001, 02, 02, 21, 05, 06) expect(t.to_json).to eq( %Q{"2001-02-02 21:05:06 +0000"} ) end end |