summaryrefslogtreecommitdiff
path: root/spec/integration/client
diff options
context:
space:
mode:
authorsersut <serdar@opscode.com>2013-10-21 21:45:02 -0700
committersersut <serdar@opscode.com>2013-10-31 15:13:38 -0700
commit6767d88d9dbba41da91afef8d102dfec7ac36fdf (patch)
tree6da5cf3cde1633b71551767ed41486f312ebf890 /spec/integration/client
parentce4cb2562af999347e26fa290d2d1ddf8deafd92 (diff)
downloadchef-6767d88d9dbba41da91afef8d102dfec7ac36fdf.tar.gz
Enable integration tests.
Use bundle exec to run rspec. Launch chef-client with ruby so that it launches correctly on windows.
Diffstat (limited to 'spec/integration/client')
-rw-r--r--spec/integration/client/client_spec.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/spec/integration/client/client_spec.rb b/spec/integration/client/client_spec.rb
index 839899d059..ffdded10e8 100644
--- a/spec/integration/client/client_spec.rb
+++ b/spec/integration/client/client_spec.rb
@@ -22,19 +22,19 @@ EOM
context 'and no config file' do
it 'should complete with success when cwd is just above cookbooks and paths are not specified' do
chef_dir = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "bin"))
- result = shell_out("#{chef_dir}/chef-client -z -o 'x::default' --config-file-jail \"#{path_to('')}\"", :cwd => path_to(''))
+ result = shell_out("ruby #{chef_dir}/chef-client -z -o 'x::default' --config-file-jail \"#{path_to('')}\"", :cwd => path_to(''))
result.error!
end
it 'should complete with success when cwd is below cookbooks and paths are not specified' do
chef_dir = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "bin"))
- result = shell_out("#{chef_dir}/chef-client -z -o 'x::default' --config-file-jail \"#{path_to('')}\"", :cwd => path_to('cookbooks/x'))
+ result = shell_out("ruby #{chef_dir}/chef-client -z -o 'x::default' --config-file-jail \"#{path_to('')}\"", :cwd => path_to('cookbooks/x'))
result.error!
end
it 'should fail when cwd is below high above and paths are not specified' do
chef_dir = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "bin"))
- result = shell_out("#{chef_dir}/chef-client -z -o 'x::default' --config-file-jail \"#{path_to('')}\"", :cwd => File.expand_path('..', path_to('')))
+ result = shell_out("ruby #{chef_dir}/chef-client -z -o 'x::default' --config-file-jail \"#{path_to('')}\"", :cwd => File.expand_path('..', path_to('')))
result.exitstatus.should == 1
end
end
@@ -44,13 +44,14 @@ EOM
it 'should load .chef/knife.rb when -z is specified' do
chef_dir = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "bin"))
- result = shell_out("#{chef_dir}/chef-client -z -o 'x::default' --config-file-jail \"#{path_to('')}\"", :cwd => path_to(''))
- result.exitstatus.should == 2
+ result = shell_out("ruby #{chef_dir}/chef-client -z -o 'x::default' --config-file-jail \"#{path_to('')}\"", :cwd => path_to(''))
+ # FATAL: Configuration error NoMethodError: undefined method `xxx' for nil:NilClass
+ result.stdout.should include("xxx")
end
it 'fails to load .chef/knife.rb when -z is specified and --config-file-jail does not include the .chef/knife.rb' do
chef_dir = File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "..", "bin"))
- result = shell_out("#{chef_dir}/chef-client -z -o 'x::default' --config-file-jail \"#{path_to('roles')}\"", :cwd => path_to(''))
+ result = shell_out("ruby #{chef_dir}/chef-client -z -o 'x::default' --config-file-jail \"#{path_to('roles')}\"", :cwd => path_to(''))
result.error!
end
end