Skip to content

Commit

Permalink
Fix Rubucop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcpell committed Nov 16, 2016
1 parent 2fb67cc commit 1a56107
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions spec/kitchen/driver/ec2/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@

# nothing else is set, so we default to this
it "loads IAM credentials last" do
env_creds(nil, nil) do
env_creds(nil, nil) do
expect(::Aws::SharedCredentials).to receive(:new).and_return(false)
expect(Aws::InstanceProfileCredentials).to receive(:new).and_return(iam)
expect(Kitchen::Driver::Aws::Client.get_credentials("profile", nil, nil, nil)).to eq(iam)
end
end

it "loads shared credentials second to last" do
env_creds(nil, nil) do
env_creds(nil, nil) do
expect(Aws::SharedCredentials).to \
receive(:new).with(:profile_name => "profile").and_return(shared)
expect(Kitchen::Driver::Aws::Client.get_credentials("profile", nil, nil, nil)).to eq(shared)
Expand Down Expand Up @@ -117,11 +117,11 @@
expect(client.resource).to be_a(Aws::EC2::Resource)
end

def env_creds(key_id, secret, &block)
def env_creds(key_id, secret, &block)
ClimateControl.modify(
"AWS_ACCESS_KEY_ID" => key_id,
"AWS_SECRET_ACCESS_KEY" => secret,
) do
"AWS_SECRET_ACCESS_KEY" => secret
) do
block.call
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/kitchen/driver/ec2_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@

describe "configuration" do
it "requires :aws_ssh_key_id to be provided" do
driver = Kitchen::Driver::Ec2.new(aws_ssh_key_id: nil)
driver = Kitchen::Driver::Ec2.new(:aws_ssh_key_id => nil)

expect { driver.finalize_config!(instance) }.to \
raise_error(Kitchen::UserError, /:aws_ssh_key_id/)
Expand Down

0 comments on commit 1a56107

Please sign in to comment.