diff options
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r-- | spec/spec_helper.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ed0a8f89f6..9d629da226 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -185,3 +185,13 @@ module WEBrick end end end + +# We are no longer using the 'json' gem - deny all access to it! +orig_require = Kernel.send(:instance_method, :require) +Kernel.send(:remove_method, :require) +Kernel.send(:define_method, :require) { |path| + raise LoadError, 'JSON gem is no longer allowed - use Chef::JSONCompat.to_json' if path == 'json' + orig_require.bind(Kernel).call(path) +} +# Enough stuff needs json serialization that I'm just adding it here for equality asserts +require 'chef/json_compat' |