diff options
Diffstat (limited to 'spec/unit/config_fetcher_spec.rb')
-rw-r--r-- | spec/unit/config_fetcher_spec.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/spec/unit/config_fetcher_spec.rb b/spec/unit/config_fetcher_spec.rb index 84aad38876..35cf27f2af 100644 --- a/spec/unit/config_fetcher_spec.rb +++ b/spec/unit/config_fetcher_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" require "chef/config_fetcher" describe Chef::ConfigFetcher do - let(:valid_json) { Chef::JSONCompat.to_json({:a=>"b"}) } + let(:valid_json) { Chef::JSONCompat.to_json({ :a => "b" }) } let(:invalid_json) { %q[{"syntax-error": "missing quote}] } let(:http) { double("Chef::HTTP::Simple") } @@ -41,20 +41,18 @@ describe Chef::ConfigFetcher do let(:config_location) { "/etc/chef/first-boot.json" } - it "returns the parsed JSON" do expect(::File).to receive(:read). with(config_location). and_return(valid_json) - expect(fetcher.fetch_json).to eq({"a" => "b"}) + expect(fetcher.fetch_json).to eq({ "a" => "b" }) end context "and the JSON is invalid" do it "reports the JSON error" do - expect(::File).to receive(:read). with(config_location). and_return(invalid_json) @@ -86,8 +84,8 @@ describe Chef::ConfigFetcher do end it "reads the file over HTTP" do - expect(http).to receive(:get). - with("").and_return(config_content) + expect(http).to receive(:get). + with("").and_return(config_content) expect(fetcher.read_config).to eq(config_content) end @@ -97,7 +95,7 @@ describe Chef::ConfigFetcher do it "fetches the file and parses it" do expect(http).to receive(:get). with("").and_return(valid_json) - expect(fetcher.fetch_json).to eq({"a" => "b"}) + expect(fetcher.fetch_json).to eq({ "a" => "b" }) end context "and the JSON is invalid" do @@ -124,5 +122,4 @@ describe Chef::ConfigFetcher do end end - end |