summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/functional/version_spec.rb18
-rw-r--r--spec/integration/solo/solo_spec.rb10
2 files changed, 11 insertions, 17 deletions
diff --git a/spec/functional/version_spec.rb b/spec/functional/version_spec.rb
index 7c2b15c060..a7e99d48e3 100644
--- a/spec/functional/version_spec.rb
+++ b/spec/functional/version_spec.rb
@@ -22,20 +22,14 @@ require 'ohai/version'
describe "Chef Versions" do
include Chef::Mixin::ShellOut
+ let(:chef_dir) { File.join(File.dirname(__FILE__), "..", "..") }
- it "chef-client version should be sane" do
- shell_out("bundle exec chef-client -v").stdout.chomp.should == "Chef: #{Chef::VERSION}"
- end
-
- it "chef-shell version should be sane" do
- shell_out("bundle exec chef-shell -v").stdout.chomp.should == "Chef: #{Chef::VERSION}"
- end
+ binaries = [ "chef-client", "chef-shell", "chef-apply", "knife", "chef-solo" ]
- it "knife version should be sane" do
- shell_out("bundle exec knife -v").stdout.chomp.should == "Chef: #{Chef::VERSION}"
+ binaries.each do |binary|
+ it "#{binary} version should be sane" do
+ shell_out!("bundle exec #{binary} -v", :cwd => chef_dir).stdout.chomp.should == "Chef: #{Chef::VERSION}"
+ end
end
- it "ohai version should be sane" do
- shell_out("bundle exec ohai -v").stdout.chomp.should == "Ohai: #{Ohai::VERSION}"
- end
end
diff --git a/spec/integration/solo/solo_spec.rb b/spec/integration/solo/solo_spec.rb
index 215c110d3e..0d08bf57cc 100644
--- a/spec/integration/solo/solo_spec.rb
+++ b/spec/integration/solo/solo_spec.rb
@@ -18,8 +18,8 @@ describe "chef-solo" do
cookbook_path "#{path_to('cookbooks')}"
file_cache_path "#{path_to('config/cache')}"
EOM
- chef_dir = File.join(File.dirname(__FILE__), "..", "..", "..", "bin")
- result = shell_out("chef-solo -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", :cwd => chef_dir)
+ chef_dir = File.join(File.dirname(__FILE__), "..", "..", "..")
+ result = shell_out("bundle exec chef-solo -c \"#{path_to('config/solo.rb')}\" -o 'x::default' -l debug", :cwd => chef_dir)
result.error!
end
end
@@ -45,17 +45,17 @@ EOM
# run_lock gets stuck we can discover it.
lambda {
Timeout.timeout(120) do
- chef_dir = File.join(File.dirname(__FILE__), "..", "..", "..", "bin")
+ chef_dir = File.join(File.dirname(__FILE__), "..", "..", "..")
# Instantiate the first chef-solo run
- s1 = Process.spawn("chef-solo -c \"#{path_to('config/solo.rb')}\" -o 'x::default' \
+ s1 = Process.spawn("bundle exec chef-solo -c \"#{path_to('config/solo.rb')}\" -o 'x::default' \
-l debug -L #{path_to('logs/runs.log')}", :chdir => chef_dir)
# Give it some time to progress
sleep 1
# Instantiate the second chef-solo run
- s2 = Process.spawn("chef-solo -c \"#{path_to('config/solo.rb')}\" -o 'x::default' \
+ s2 = Process.spawn("bundle exec chef-solo -c \"#{path_to('config/solo.rb')}\" -o 'x::default' \
-l debug -L #{path_to('logs/runs.log')}", :chdir => chef_dir)
Process.waitpid(s1)