From 878560a22f37aec0c2dfe681b3743e027155be88 Mon Sep 17 00:00:00 2001 From: Lamont Granquist Date: Mon, 2 Jul 2018 10:29:13 -0700 Subject: fix Layout/DotPosition Signed-off-by: Lamont Granquist --- spec/unit/resource_reporter_spec.rb | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'spec/unit/resource_reporter_spec.rb') diff --git a/spec/unit/resource_reporter_spec.rb b/spec/unit/resource_reporter_spec.rb index 042b09659c..0c4942f319 100644 --- a/spec/unit/resource_reporter_spec.rb +++ b/spec/unit/resource_reporter_spec.rb @@ -616,11 +616,11 @@ describe Chef::ResourceReporter do # 404 getting the run_id @response = Net::HTTPNotFound.new("a response body", "404", "Not Found") @error = Net::HTTPServerException.new("404 message", @response) - expect(@rest_client).to receive(:post). - with("reports/nodes/spitfire/runs", { action: :start, run_id: @run_id, + expect(@rest_client).to receive(:post) + .with("reports/nodes/spitfire/runs", { action: :start, run_id: @run_id, start_time: @start_time.to_s }, - { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION }). - and_raise(@error) + { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION }) + .and_raise(@error) end it "assumes the feature is not enabled" do @@ -646,10 +646,10 @@ describe Chef::ResourceReporter do # 500 getting the run_id @response = Net::HTTPInternalServerError.new("a response body", "500", "Internal Server Error") @error = Net::HTTPServerException.new("500 message", @response) - expect(@rest_client).to receive(:post). - with("reports/nodes/spitfire/runs", { action: :start, run_id: @run_id, start_time: @start_time.to_s }, - { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION }). - and_raise(@error) + expect(@rest_client).to receive(:post) + .with("reports/nodes/spitfire/runs", { action: :start, run_id: @run_id, start_time: @start_time.to_s }, + { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION }) + .and_raise(@error) end it "assumes the feature is not enabled" do @@ -676,10 +676,10 @@ describe Chef::ResourceReporter do # 500 getting the run_id @response = Net::HTTPInternalServerError.new("a response body", "500", "Internal Server Error") @error = Net::HTTPServerException.new("500 message", @response) - expect(@rest_client).to receive(:post). - with("reports/nodes/spitfire/runs", { action: :start, run_id: @run_id, start_time: @start_time.to_s }, - { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION }). - and_raise(@error) + expect(@rest_client).to receive(:post) + .with("reports/nodes/spitfire/runs", { action: :start, run_id: @run_id, start_time: @start_time.to_s }, + { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION }) + .and_raise(@error) end after do @@ -697,10 +697,10 @@ describe Chef::ResourceReporter do context "after creating the run history document" do before do response = { "uri" => "https://example.com/reports/nodes/spitfire/runs/@run_id" } - expect(@rest_client).to receive(:post). - with("reports/nodes/spitfire/runs", { action: :start, run_id: @run_id, start_time: @start_time.to_s }, - { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION }). - and_return(response) + expect(@rest_client).to receive(:post) + .with("reports/nodes/spitfire/runs", { action: :start, run_id: @run_id, start_time: @start_time.to_s }, + { "X-Ops-Reporting-Protocol-Version" => Chef::ResourceReporter::PROTOCOL_VERSION }) + .and_return(response) @resource_reporter.run_started(@run_status) end -- cgit v1.2.1