Convert acceptance specs to RSpec 3.2.2 syntax
This conversion is done by Transpec 3.1.0 with the following command: transpec spec/acceptance/ * 16 conversions from: it { should ... } to: it { is_expected.to ... } * 6 conversions from: obj.should to: expect(obj).to * 5 conversions from: == expected to: eq(expected) * 1 conversion from: it { should_not ... } to: it { is_expected.not_to ... } For more details: https://github.com/yujinakayama/transpec#supported-conversions
This commit is contained in:
parent
e5085f39e6
commit
9dd92e7081
3 changed files with 23 additions and 23 deletions
|
@ -21,8 +21,8 @@ describe "nginx::resource::mailhost define:" do
|
|||
end
|
||||
|
||||
describe file('/etc/nginx/conf.mail.d/domain1.example.conf') do
|
||||
it { should be_file }
|
||||
it { should contain "auth_http localhost/cgi-bin/auth;" }
|
||||
it { is_expected.to be_file }
|
||||
it { is_expected.to contain "auth_http localhost/cgi-bin/auth;" }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -23,16 +23,16 @@ describe "nginx::resource::upstream define:" do
|
|||
end
|
||||
|
||||
describe file('/etc/nginx/conf.d/puppet_rack_app-upstream.conf') do
|
||||
it { should be_file }
|
||||
it { should contain "server localhost:3000" }
|
||||
it { should contain "server localhost:3001" }
|
||||
it { should contain "server localhost:3002" }
|
||||
it { should_not contain "server localhost:3003" }
|
||||
it { is_expected.to be_file }
|
||||
it { is_expected.to contain "server localhost:3000" }
|
||||
it { is_expected.to contain "server localhost:3001" }
|
||||
it { is_expected.to contain "server localhost:3002" }
|
||||
it { is_expected.not_to contain "server localhost:3003" }
|
||||
end
|
||||
|
||||
describe file('/etc/nginx/sites-available/rack.puppetlabs.com.conf') do
|
||||
it { should be_file }
|
||||
it { should contain "proxy_pass http://puppet_rack_app;" }
|
||||
it { is_expected.to be_file }
|
||||
it { is_expected.to contain "proxy_pass http://puppet_rack_app;" }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -19,22 +19,22 @@ describe "nginx::resource::vhost define:" do
|
|||
end
|
||||
|
||||
describe file('/etc/nginx/sites-available/www.puppetlabs.com.conf') do
|
||||
it { should be_file }
|
||||
it { should contain "www.puppetlabs.com" }
|
||||
it { is_expected.to be_file }
|
||||
it { is_expected.to contain "www.puppetlabs.com" }
|
||||
end
|
||||
|
||||
describe file('/etc/nginx/sites-enabled/www.puppetlabs.com.conf') do
|
||||
it { should be_linked_to '/etc/nginx/sites-available/www.puppetlabs.com.conf' }
|
||||
it { is_expected.to be_linked_to '/etc/nginx/sites-available/www.puppetlabs.com.conf' }
|
||||
end
|
||||
|
||||
describe service('nginx') do
|
||||
it { should be_running }
|
||||
it { is_expected.to be_running }
|
||||
end
|
||||
|
||||
it 'should answer to www.puppetlabs.com' do
|
||||
shell("/usr/bin/curl http://www.puppetlabs.com:80") do |r|
|
||||
r.stdout.should == "Hello from www\n"
|
||||
r.exit_code.should be_zero
|
||||
expect(r.stdout).to eq("Hello from www\n")
|
||||
expect(r.exit_code).to be_zero
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -60,30 +60,30 @@ describe "nginx::resource::vhost define:" do
|
|||
end
|
||||
|
||||
describe file('/etc/nginx/sites-available/www.puppetlabs.com.conf') do
|
||||
it { should be_file }
|
||||
it { should contain "ssl on;" }
|
||||
it { is_expected.to be_file }
|
||||
it { is_expected.to contain "ssl on;" }
|
||||
end
|
||||
|
||||
describe file('/etc/nginx/sites-enabled/www.puppetlabs.com.conf') do
|
||||
it { should be_linked_to '/etc/nginx/sites-available/www.puppetlabs.com.conf' }
|
||||
it { is_expected.to be_linked_to '/etc/nginx/sites-available/www.puppetlabs.com.conf' }
|
||||
end
|
||||
|
||||
describe service('nginx') do
|
||||
it { should be_running }
|
||||
it { is_expected.to be_running }
|
||||
end
|
||||
|
||||
it 'should answer to http://www.puppetlabs.com' do
|
||||
shell("/usr/bin/curl http://www.puppetlabs.com:80") do |r|
|
||||
r.stdout.should == "Hello from www\n"
|
||||
r.exit_code.should == 0
|
||||
expect(r.stdout).to eq("Hello from www\n")
|
||||
expect(r.exit_code).to eq(0)
|
||||
end
|
||||
end
|
||||
|
||||
it 'should answer to https://www.puppetlabs.com' do
|
||||
# use --insecure because it's a self-signed cert
|
||||
shell("/usr/bin/curl --insecure https://www.puppetlabs.com:443") do |r|
|
||||
r.stdout.should == "Hello from www\n"
|
||||
r.exit_code.should == 0
|
||||
expect(r.stdout).to eq("Hello from www\n")
|
||||
expect(r.exit_code).to eq(0)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue