summaryrefslogtreecommitdiff
path: root/spec/unit/json_compat_spec.rb
diff options
context:
space:
mode:
authortyler-ball <tyleraball@gmail.com>2014-10-08 10:48:18 -0700
committertyler-ball <tyleraball@gmail.com>2014-10-08 10:48:18 -0700
commit9f44841df63fac60e773917bb3240d8d64e6ed2e (patch)
treede5ff40308d6dc590a500eb3e7ec8d83e1a896df /spec/unit/json_compat_spec.rb
parentb92978dd22f734f33044ec62c605b6eedb43bb6e (diff)
downloadchef-9f44841df63fac60e773917bb3240d8d64e6ed2e.tar.gz
Adding back `require 'json'` to prevent breaking consumers who currently use Hash.to_json in their cookbookstball/yajl-replace-json
Diffstat (limited to 'spec/unit/json_compat_spec.rb')
-rw-r--r--spec/unit/json_compat_spec.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/unit/json_compat_spec.rb b/spec/unit/json_compat_spec.rb
index 17beba5492..65d931df70 100644
--- a/spec/unit/json_compat_spec.rb
+++ b/spec/unit/json_compat_spec.rb
@@ -102,8 +102,9 @@ describe Chef::JSONCompat do
end
end
- it "should not allow the json gem to be required because of the spec_helper" do
- # We want to prevent ourselves from writing code that requires 'json'
- expect { require 'json' }.to raise_error(LoadError)
+ it "should define .to_json on all classes" do
+ class SomeClass; end
+
+ expect(SomeClass.new.respond_to?(:to_json)).to eq(true)
end
end