From 1c7b4629240c49e02c482da6de1a6a2cc574304e Mon Sep 17 00:00:00 2001 From: tyler-ball Date: Wed, 24 Sep 2014 09:18:47 -0700 Subject: Trying to eradicate all traces of the JSON gem from Chef --- spec/spec_helper.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'spec/spec_helper.rb') 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' -- cgit v1.2.1