diff options
Diffstat (limited to 'spec/unit/json_compat_spec.rb')
-rw-r--r-- | spec/unit/json_compat_spec.rb | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/spec/unit/json_compat_spec.rb b/spec/unit/json_compat_spec.rb index 4da29fe4ec..38c2c60b2e 100644 --- a/spec/unit/json_compat_spec.rb +++ b/spec/unit/json_compat_spec.rb @@ -22,28 +22,6 @@ require "chef/json_compat" describe Chef::JSONCompat do before { Chef::Config[:treat_deprecation_warnings_as_errors] = false } - describe "#from_json with JSON containing an existing class" do - let(:json) { '{"json_class": "Chef::Role"}' } - - it "emits a deprecation warning" do - Chef::Config[:treat_deprecation_warnings_as_errors] = true - expect { Chef::JSONCompat.from_json(json) }.to raise_error Chef::Exceptions::DeprecatedFeatureError, - /Auto inflation of JSON data is deprecated. Please use Chef::Role#from_hash/ - end - - it "returns an instance of the class instead of a Hash" do - expect(Chef::JSONCompat.from_json(json).class).to eq Chef::Role - end - end - - describe "#from_json with JSON containing comments" do - let(:json) { %Q{{\n/* comment */\n// comment 2\n"json_class": "Chef::Role"}} } - - it "returns an instance of the class instead of a Hash" do - expect(Chef::JSONCompat.from_json(json).class).to eq Chef::Role - end - end - describe "#parse with JSON containing comments" do let(:json) { %Q{{\n/* comment */\n// comment 2\n"json_class": "Chef::Role"}} } @@ -52,16 +30,6 @@ describe Chef::JSONCompat do end end - describe 'with JSON containing "Chef::Sandbox" as a json_class value' do - require "chef/sandbox" # Only needed for this test - - let(:json) { '{"json_class": "Chef::Sandbox", "arbitrary": "data"}' } - - it "returns a Hash, because Chef::Sandbox is a dummy class" do - expect(Chef::JSONCompat.from_json(json)).to eq({ "json_class" => "Chef::Sandbox", "arbitrary" => "data" }) - end - end - describe "when pretty printing an object that defines #to_json" do class Foo def to_json(*a) |