diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 10:29:13 -0700 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2018-07-02 10:29:13 -0700 |
commit | 878560a22f37aec0c2dfe681b3743e027155be88 (patch) | |
tree | 676062be70a45e73a8722c0e6dadd220162fb101 /spec/unit/config_fetcher_spec.rb | |
parent | 202887162a22e0c7062064fff0d9462f8c02bf0e (diff) | |
download | chef-878560a22f37aec0c2dfe681b3743e027155be88.tar.gz |
fix Layout/DotPosition
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'spec/unit/config_fetcher_spec.rb')
-rw-r--r-- | spec/unit/config_fetcher_spec.rb | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/spec/unit/config_fetcher_spec.rb b/spec/unit/config_fetcher_spec.rb index c91b043160..abaea6b2dc 100644 --- a/spec/unit/config_fetcher_spec.rb +++ b/spec/unit/config_fetcher_spec.rb @@ -16,9 +16,9 @@ describe Chef::ConfigFetcher do let(:config_content) { "# The client.rb content" } it "reads the file from disk" do - expect(::File).to receive(:read). - with(config_location). - and_return(config_content) + expect(::File).to receive(:read) + .with(config_location) + .and_return(config_content) expect(fetcher.read_config).to eq(config_content) end @@ -42,9 +42,9 @@ 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(::File).to receive(:read) + .with(config_location) + .and_return(valid_json) expect(fetcher.fetch_json).to eq({ "a" => "b" }) end @@ -53,12 +53,12 @@ describe Chef::ConfigFetcher do it "reports the JSON error" do - expect(::File).to receive(:read). - with(config_location). - and_return(invalid_json) + expect(::File).to receive(:read) + .with(config_location) + .and_return(invalid_json) - expect(Chef::Application).to receive(:fatal!). - with(invalid_json_error_regex) + expect(Chef::Application).to receive(:fatal!) + .with(invalid_json_error_regex) fetcher.fetch_json end end @@ -78,14 +78,14 @@ describe Chef::ConfigFetcher do describe "reading the file" do before do - expect(Chef::HTTP::Simple).to receive(:new). - with(config_location). - and_return(http) + expect(Chef::HTTP::Simple).to receive(:new) + .with(config_location) + .and_return(http) 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 @@ -93,18 +93,18 @@ describe Chef::ConfigFetcher do let(:config_location) { "https://example.com/foo.json" } it "fetches the file and parses it" do - expect(http).to receive(:get). - with("").and_return(valid_json) + expect(http).to receive(:get) + .with("").and_return(valid_json) expect(fetcher.fetch_json).to eq({ "a" => "b" }) end context "and the JSON is invalid" do it "reports the JSON error" do - expect(http).to receive(:get). - with("").and_return(invalid_json) + expect(http).to receive(:get) + .with("").and_return(invalid_json) - expect(Chef::Application).to receive(:fatal!). - with(invalid_json_error_regex) + expect(Chef::Application).to receive(:fatal!) + .with(invalid_json_error_regex) fetcher.fetch_json end end |