fix tests for rspec-2.11.0

This commit is contained in:
Ilya Margolin 2012-07-31 17:07:47 +02:00 committed by Tim Sharpe
parent e3495af21b
commit e474433342
4 changed files with 7 additions and 4 deletions

View File

@ -11,6 +11,8 @@ notifications:
env: env:
- PUPPET_VERSION=2.6.14 - PUPPET_VERSION=2.6.14
- PUPPET_VERSION=2.7.12 - PUPPET_VERSION=2.7.12
- RSPEC_VERSION=2.9.0
- RSPEC_VERSION=2.11.0
matrix: matrix:
exclude: exclude:
- rvm: 1.9.2 - rvm: 1.9.2

View File

@ -1,7 +1,8 @@
source :rubygems source :rubygems
puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7'] puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7']
rspecversion = ENV.key?('RSPEC_VERSION') ? "= #{ENV['RSPEC_VERSION']}" : ['>= 2.9']
gem 'rake' gem 'rake'
gem 'rspec' gem 'rspec', rspecversion
gem 'puppet', puppetversion gem 'puppet', puppetversion

View File

@ -8,7 +8,7 @@ describe 'sysctl::common' do
it 'should fail if the parameter is not contained in the resource' do it 'should fail if the parameter is not contained in the resource' do
expect do expect do
subject.should contain_exec('sysctl/reload').with('foo' => 'bar') subject.should contain_exec('sysctl/reload').with('foo' => 'bar')
end.should raise_error(RSpec::Expectations::ExpectationNotMetError) end.to raise_error(RSpec::Expectations::ExpectationNotMetError)
end end
it 'should pass if the parameters are contained in the resource' do it 'should pass if the parameters are contained in the resource' do
subject.should contain_exec('sysctl/reload').with( subject.should contain_exec('sysctl/reload').with(
@ -27,7 +27,7 @@ describe 'sysctl::common' do
it 'should fail if any of the parameter names are contained in the resource' do it 'should fail if any of the parameter names are contained in the resource' do
expect do expect do
subject.should contain_exec('sysctl/reload').without(['foo', 'returns']) subject.should contain_exec('sysctl/reload').without(['foo', 'returns'])
end.should raise_error(RSpec::Expectations::ExpectationNotMetError) end.to raise_error(RSpec::Expectations::ExpectationNotMetError)
end end
end end
end end

View File

@ -6,6 +6,6 @@ describe 'split' do
it { should_not run.with_params('foo').and_raise_error(Puppet::DevError) } it { should_not run.with_params('foo').and_raise_error(Puppet::DevError) }
it 'something' do it 'something' do
expect { subject.call('foo') }.should raise_error(Puppet::ParseError) expect { subject.call('foo') }.to raise_error(Puppet::ParseError)
end end
end end