diff --git a/spec/unit/type/nova_config_spec.rb b/spec/unit/type/nova_config_spec.rb index aa269d46c..0cafbeb96 100644 --- a/spec/unit/type/nova_config_spec.rb +++ b/spec/unit/type/nova_config_spec.rb @@ -5,16 +5,22 @@ describe 'Puppet::Type.type(:nova_config)' do @nova_config = Puppet::Type.type(:nova_config).new(:name => 'foo', :value => 'bar') end it 'should require a name' do - expect { Puppet::Type.type(:nova_config).new({}) }.should raise_error(Puppet::Error, 'Title or name must be provided') + expect { + Puppet::Type.type(:nova_config).new({}) + }.to raise_error(Puppet::Error, 'Title or name must be provided') end it 'should not expect a name with whitespace' do - expect { Puppet::Type.type(:nova_config).new(:name => 'f oo') }.should raise_error(Puppet::Error, /Invalid value/) + expect { + Puppet::Type.type(:nova_config).new(:name => 'f oo') + }.to raise_error(Puppet::Error, /Invalid value/) end it 'should not require a value when ensure is absent' do Puppet::Type.type(:nova_config).new(:name => 'foo', :ensure => :absent) end it 'should require a value when ensure is present' do - expect { Puppet::Type.type(:nova_config).new(:name => 'foo', :ensure => :present) }.should raise_error(Puppet::Error, /Property value must be set/) + expect { + Puppet::Type.type(:nova_config).new(:name => 'foo', :ensure => :present) + }.to raise_error(Puppet::Error, /Property value must be set/) end it 'should accept a valid value' do @nova_config[:value] = 'bar' @@ -31,6 +37,8 @@ describe 'Puppet::Type.type(:nova_config)' do @nova_config[:ensure].should == :absent end it 'should not accept invalid ensure values' do - expect { @nova_config[:ensure] = :latest}.should raise_error(Puppet::Error, /Invalid value/) + expect { + @nova_config[:ensure] = :latest + }.to raise_error(Puppet::Error, /Invalid value/) end end