We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99cfa9b commit 10af9b9Copy full SHA for 10af9b9
lib/rspec-puppet-facts.rb
@@ -397,7 +397,7 @@ def self.facter_version_for_puppet_version(puppet_version)
397
return Facter.version
398
end
399
400
- version_map = JSON.load_file(json_path).map do |puppet, facter|
+ version_map = JSON.parse(File.read(json_path)).map do |puppet, facter|
401
[Gem::Version.new(puppet), facter]
402
403
spec/rspec_puppet_facts_spec.rb
@@ -60,7 +60,7 @@
60
61
context 'when the component JSON file is unparseable' do
62
before do
63
- allow(JSON).to receive(:load_file).with(component_json_path).and_raise(JSON::ParserError)
+ allow(File).to receive(:read).with(component_json_path).and_return('not json')
64
allow(described_class).to receive(:warning)
65
66
0 commit comments