Skip to content

Commit

Permalink
Rename method name when checking capability
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisroberts committed Jun 12, 2018
1 parent 87b8321 commit 2628d93
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion plugins/communicators/ssh/communicator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def ready?
end

# Adjust private key file permissions if host provides capability
if @machine.env.host.has_capability?(:set_ssh_key_permissions)
if @machine.env.host.capability?(:set_ssh_key_permissions)
@machine.env.host.capability(:set_ssh_key_permissions, @machine.data_dir.join("private_key"))
end

Expand Down
4 changes: 2 additions & 2 deletions test/unit/plugins/communicators/ssh/communicator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
end

before do
allow(host).to receive(:has_capability?).and_return(false)
allow(host).to receive(:capability?).and_return(false)
end

describe ".wait_for_ready" do
Expand Down Expand Up @@ -216,7 +216,7 @@
end

it "should call the set_ssh_key_permissions host capability" do
expect(host).to receive(:has_capability?).with(:set_ssh_key_permissions).and_return(true)
expect(host).to receive(:capability?).with(:set_ssh_key_permissions).and_return(true)
expect(host).to receive(:capability).with(:set_ssh_key_permissions, private_key_file)
end

Expand Down

0 comments on commit 2628d93

Please sign in to comment.