spec/backend/ssh/configuration_spec.rb in serverspec-0.6.16 vs spec/backend/ssh/configuration_spec.rb in serverspec-0.6.17

- old
+ new

@@ -12,12 +12,13 @@ ssh.stub(:options) { { :user => 'root' } } c.ssh = ssh end end - context package('httpd') do - its(:command) { should eq 'command' } + context file('/etc/passwd') do + it { should be_file } + its(:command) { should eq 'test -f /etc/passwd' } end end describe 'path is set' do before :all do @@ -26,12 +27,13 @@ c.ssh = ssh end end let(:path) { '/sbin:/usr/sbin' } - context package('httpd') do - its(:command) { should eq 'env PATH=/sbin:/usr/sbin:$PATH command' } + context file('/etc/passwd') do + it { should be_file } + its(:command) { should eq 'env PATH=/sbin:/usr/sbin:$PATH test -f /etc/passwd' } end end describe 'pre_command is set and user is root' do before :all do @@ -40,12 +42,13 @@ c.ssh = ssh end end let(:pre_command) { 'source ~/.zshrc' } - context package('httpd') do - its(:command) { should eq 'source ~/.zshrc && command' } + context file('/etc/passwd') do + it { should be_file } + its(:command) { should eq 'source ~/.zshrc && test -f /etc/passwd' } end end describe 'pre_command is set and user is non-root' do before :all do @@ -54,12 +57,13 @@ c.ssh = ssh end end let(:pre_command) { 'source ~/.zshrc' } - context package('httpd') do - its(:command) { should eq 'sudo source ~/.zshrc && sudo command' } + context file('/etc/passwd') do + it { should be_file } + its(:command) { should eq 'sudo source ~/.zshrc && sudo test -f /etc/passwd' } end end describe 'pre_command is not set and user is non-root' do before :all do @@ -67,12 +71,13 @@ ssh.stub(:options) { { :user => 'foo' } } c.ssh = ssh end end - context package('httpd') do - its(:command) { should eq 'sudo command' } + context file('/etc/passwd') do + it { should be_file } + its(:command) { should eq 'sudo test -f /etc/passwd' } end end describe 'path pre_command and set and user is non-root' do @@ -83,12 +88,13 @@ end end let(:path) { '/sbin:/usr/sbin' } let(:pre_command) { 'source ~/.zshrc' } - context package('httpd') do - its(:command) { should eq 'sudo env PATH=/sbin:/usr/sbin:$PATH source ~/.zshrc && sudo env PATH=/sbin:/usr/sbin:$PATH command' } + context file('/etc/passwd') do + it { should be_file } + its(:command) { should eq 'sudo env PATH=/sbin:/usr/sbin:$PATH source ~/.zshrc && sudo env PATH=/sbin:/usr/sbin:$PATH test -f /etc/passwd' } end end describe 'path pre_command and set and user is non-root' do before :all do @@ -98,9 +104,10 @@ end end let(:path) { '/sbin:/usr/sbin' } let(:pre_command) { 'source ~/.zshrc' } - context package('httpd') do - its(:command) { should eq 'env PATH=/sbin:/usr/sbin:$PATH source ~/.zshrc && env PATH=/sbin:/usr/sbin:$PATH command' } + context file('/etc/passwd') do + it { should be_file } + its(:command) { should eq 'env PATH=/sbin:/usr/sbin:$PATH source ~/.zshrc && env PATH=/sbin:/usr/sbin:$PATH test -f /etc/passwd' } end end