spec/generate_spec.rb in jsonify-0.0.1 vs spec/generate_spec.rb in jsonify-0.0.2
- old
+ new
@@ -10,11 +10,12 @@
}
end
it 'should build json' do
json = Jsonify::Generate
result = json.value links
- result.evaluate.should == '{"links":[{"rel":"foo","href":"goo"},{"rel":"bar","href":"baz"}]}'
+ expected = '{"links":[{"rel":"foo","href":"goo"},{"rel":"bar","href":"baz"}]}'
+ JSON.parse(result.evaluate).should == JSON.parse(expected)
end
describe 'complex example' do
let(:jsonifier) { Jsonify::Generate }
@@ -25,9 +26,10 @@
jsonifier.object_value( {"rel" => "foo", "href" => "goo"} ),
jsonifier.object_value( {"rel" => "bar", "href" => "baz"} )
])
}
)
- json.evaluate.should == "{\"links\":[{\"rel\":\"foo\",\"href\":\"goo\"},{\"rel\":\"bar\",\"href\":\"baz\"}]}"
+ expected = "{\"links\":[{\"rel\":\"foo\",\"href\":\"goo\"},{\"rel\":\"bar\",\"href\":\"baz\"}]}"
+ JSON.parse(json.evaluate).should == JSON.parse(expected)
end
end
end
\ No newline at end of file