summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2017-03-07 13:29:20 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2017-03-07 13:29:20 -0800
commit227822c9134d3411a65f2e63c4368d9f9c091762 (patch)
tree350f64b52996d1eaab49fefdd9f5eb175c2f6a47
parentaa16a9832c4c3d138cd43bbaadeccf1147834601 (diff)
downloadchef-227822c9134d3411a65f2e63c4368d9f9c091762.tar.gz
fix spec for solaris 10
this only affects tests running as root on old solaris because ENV['HOME'] for root is "/" there and that causes a "/.ssh" vs "//.ssh" error if we don't File.expand_path in both the code and the spec. Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--spec/functional/knife/ssh_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/functional/knife/ssh_spec.rb b/spec/functional/knife/ssh_spec.rb
index cfe28b862f..0de344f24e 100644
--- a/spec/functional/knife/ssh_spec.rb
+++ b/spec/functional/knife/ssh_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Daniel DeLeo (<dan@chef.io>)
-# Copyright:: Copyright 2010-2016, Chef Software Inc.
+# Copyright:: Copyright 2010-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -254,7 +254,7 @@ describe Chef::Knife::Ssh do
end
it "uses the ssh_gateway_identity file" do
- expect(@knife.session).to receive(:via).with("ec2.public_hostname", "user", { :keys => "#{ENV['HOME']}/.ssh/aws-gateway.rsa", :keys_only => true })
+ expect(@knife.session).to receive(:via).with("ec2.public_hostname", "user", { :keys => File.expand_path("#{ENV['HOME']}/.ssh/aws-gateway.rsa"), :keys_only => true })
@knife.run
expect(@knife.config[:ssh_gateway_identity]).to eq("~/.ssh/aws-gateway.rsa")
end
@@ -268,7 +268,7 @@ describe Chef::Knife::Ssh do
end
it "uses the ssh_gateway_identity file" do
- expect(@knife.session).to receive(:via).with("ec2.public_hostname", "user", { :keys => "#{ENV['HOME']}/.ssh/aws-gateway.rsa", :keys_only => true })
+ expect(@knife.session).to receive(:via).with("ec2.public_hostname", "user", { :keys => File.expand_path("#{ENV['HOME']}/.ssh/aws-gateway.rsa"), :keys_only => true })
@knife.run
expect(@knife.config[:ssh_gateway_identity]).to eq("~/.ssh/aws-gateway.rsa")
end