Sha256: 1cab744cf2a1305a38ef5888dc06a4eded36b5597217cf6fff8bd298377406d1

Contents?: true

Size: 477 Bytes

Versions: 11

Compression:

Stored size: 477 Bytes

Contents

require File.join(File.dirname(__FILE__),'../../spec_helper')

describe IMW::Formats::Json do

  before do
    @sample = IMW.open(File.join(IMWTest::DATA_DIR, 'formats/json/sample.json'))
  end

  it "should be able to parse the JSON" do
    @sample.load["Aotus"].first['id'].should == 1
  end

  it "should be able to write JSON" do
    IMW.open!('test.json') { |f| f.emit({ 'foobar' => 3, 'bazbooz' => 4 }) }
    IMW.open('test.json').load['foobar'].should == 3
  end
  
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
imw-0.2.18 spec/imw/formats/json_spec.rb
imw-0.2.17 spec/imw/formats/json_spec.rb
imw-0.2.16 spec/imw/formats/json_spec.rb
imw-0.2.15 spec/imw/formats/json_spec.rb
imw-0.2.14 spec/imw/formats/json_spec.rb
imw-0.2.13 spec/imw/formats/json_spec.rb
imw-0.2.12 spec/imw/formats/json_spec.rb
imw-0.2.11 spec/imw/formats/json_spec.rb
imw-0.2.10 spec/imw/formats/json_spec.rb
imw-0.2.9 spec/imw/formats/json_spec.rb
imw-0.2.8 spec/imw/formats/json_spec.rb