spec/imw/formats/json_spec.rb in imw-0.2.7 vs spec/imw/formats/json_spec.rb in imw-0.2.8
- old
+ new
@@ -1,18 +1,18 @@
require File.join(File.dirname(__FILE__),'../../spec_helper')
describe IMW::Formats::Json do
before do
- @sample = IMW.open(File.join(IMWTest::DATA_DIR, 'sample.json'))
+ @sample = IMW.open(File.join(IMWTest::DATA_DIR, 'formats/json/sample.json'))
end
it "should be able to parse the JSON" do
- @sample.load.first['id'].should == 1
+ @sample.load["Aotus"].first['id'].should == 1
end
it "should be able to write JSON" do
- IMW.open!('test.json').dump({ 'foobar' => 3, 'bazbooz' => 4 })
+ IMW.open!('test.json') { |f| f.emit({ 'foobar' => 3, 'bazbooz' => 4 }) }
IMW.open('test.json').load['foobar'].should == 3
end
end