From e474433342386b27fe0b86a8d2b2a1f77797f860 Mon Sep 17 00:00:00 2001 From: Ilya Margolin Date: Tue, 31 Jul 2012 17:07:47 +0200 Subject: [PATCH] fix tests for rspec-2.11.0 --- .travis.yml | 2 ++ Gemfile | 3 ++- spec/classes/sysctl_common_spec.rb | 4 ++-- spec/functions/split_spec.rb | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5c33cde..aa494e6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,8 @@ notifications: env: - PUPPET_VERSION=2.6.14 - PUPPET_VERSION=2.7.12 + - RSPEC_VERSION=2.9.0 + - RSPEC_VERSION=2.11.0 matrix: exclude: - rvm: 1.9.2 diff --git a/Gemfile b/Gemfile index 5ce4099..ca1606d 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,8 @@ source :rubygems puppetversion = ENV.key?('PUPPET_VERSION') ? "= #{ENV['PUPPET_VERSION']}" : ['>= 2.7'] +rspecversion = ENV.key?('RSPEC_VERSION') ? "= #{ENV['RSPEC_VERSION']}" : ['>= 2.9'] gem 'rake' -gem 'rspec' +gem 'rspec', rspecversion gem 'puppet', puppetversion diff --git a/spec/classes/sysctl_common_spec.rb b/spec/classes/sysctl_common_spec.rb index 42e7a07..88bfaf8 100644 --- a/spec/classes/sysctl_common_spec.rb +++ b/spec/classes/sysctl_common_spec.rb @@ -8,7 +8,7 @@ describe 'sysctl::common' do it 'should fail if the parameter is not contained in the resource' do expect do subject.should contain_exec('sysctl/reload').with('foo' => 'bar') - end.should raise_error(RSpec::Expectations::ExpectationNotMetError) + end.to raise_error(RSpec::Expectations::ExpectationNotMetError) end it 'should pass if the parameters are contained in the resource' do 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 expect do 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 diff --git a/spec/functions/split_spec.rb b/spec/functions/split_spec.rb index 326cbd6..ed000b0 100644 --- a/spec/functions/split_spec.rb +++ b/spec/functions/split_spec.rb @@ -6,6 +6,6 @@ describe 'split' do it { should_not run.with_params('foo').and_raise_error(Puppet::DevError) } it 'something' do - expect { subject.call('foo') }.should raise_error(Puppet::ParseError) + expect { subject.call('foo') }.to raise_error(Puppet::ParseError) end end