diff options
author | tyler-ball <tyleraball@gmail.com> | 2014-09-24 09:18:47 -0700 |
---|---|---|
committer | tyler-ball <tyleraball@gmail.com> | 2014-10-07 16:39:56 -0700 |
commit | 1c7b4629240c49e02c482da6de1a6a2cc574304e (patch) | |
tree | 4ac2fdc415837aca9b15e6c93debda44858cbf9b /spec/unit/environment_spec.rb | |
parent | 1343bdfff0d54e20b923211f6697d42c484c1627 (diff) | |
download | chef-1c7b4629240c49e02c482da6de1a6a2cc574304e.tar.gz |
Trying to eradicate all traces of the JSON gem from Chef
Diffstat (limited to 'spec/unit/environment_spec.rb')
-rw-r--r-- | spec/unit/environment_spec.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/unit/environment_spec.rb b/spec/unit/environment_spec.rb index 5a2c400d3c..bb4ece0a47 100644 --- a/spec/unit/environment_spec.rb +++ b/spec/unit/environment_spec.rb @@ -196,7 +196,7 @@ describe Chef::Environment do %w{name description cookbook_versions}.each do |t| it "should include '#{t}'" do - @json.should =~ /"#{t}":#{Regexp.escape(@environment.send(t.to_sym).to_json)}/ + @json.should =~ /"#{t}":#{Regexp.escape(Chef::JSONCompat.to_json(@environment.send(t.to_sym)))}/ end end @@ -207,6 +207,10 @@ describe Chef::Environment do it "should include 'chef_type'" do @json.should =~ /"chef_type":"environment"/ end + + include_examples "to_json equalivent to Chef::JSONCompat.to_json" do + let(:subject) { @environment } + end end describe "from_json" do @@ -222,7 +226,7 @@ describe Chef::Environment do "json_class" => "Chef::Environment", "chef_type" => "environment" } - @environment = Chef::JSONCompat.from_json(@data.to_json) + @environment = Chef::JSONCompat.from_json(Chef::JSONCompat.to_json(@data)) end it "should return a Chef::Environment" do |