diff options
Diffstat (limited to 'spec/unit/cookbook/metadata_spec.rb')
-rw-r--r-- | spec/unit/cookbook/metadata_spec.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/unit/cookbook/metadata_spec.rb b/spec/unit/cookbook/metadata_spec.rb index e61c85b42b..86be0d2390 100644 --- a/spec/unit/cookbook/metadata_spec.rb +++ b/spec/unit/cookbook/metadata_spec.rb @@ -623,9 +623,13 @@ describe Chef::Cookbook::Metadata do metadata.version "1.2.3" end + it "should produce the same output from to_json and Chef::JSONCompat" do + expect(metadata.to_json).to eq(Chef::JSONCompat.to_json(metadata)) + end + describe "serialize" do - let(:deserialized_metadata) { Chef::JSONCompat.from_json(metadata.to_json) } + let(:deserialized_metadata) { Chef::JSONCompat.from_json(Chef::JSONCompat.to_json(metadata)) } it "should serialize to a json hash" do deserialized_metadata.should be_a_kind_of(Hash) @@ -657,7 +661,7 @@ describe Chef::Cookbook::Metadata do describe "deserialize" do - let(:deserialized_metadata) { Chef::Cookbook::Metadata.from_json(metadata.to_json) } + let(:deserialized_metadata) { Chef::Cookbook::Metadata.from_json(Chef::JSONCompat.to_json(metadata)) } it "should deserialize to a Chef::Cookbook::Metadata object" do |