summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--spec/unit/indirector/resource/ral_spec.rb2
-rw-r--r--spec/unit/network/http/compression_spec.rb12
-rw-r--r--spec/unit/parser/ast/in_operator_spec.rb4
-rwxr-xr-xspec/unit/provider/ssh_authorized_key/parsed_spec.rb2
-rwxr-xr-xspec/unit/type_spec.rb4
5 files changed, 13 insertions, 11 deletions
diff --git a/spec/unit/indirector/resource/ral_spec.rb b/spec/unit/indirector/resource/ral_spec.rb
index f74bf3d60..c3dc8d8cf 100644
--- a/spec/unit/indirector/resource/ral_spec.rb
+++ b/spec/unit/indirector/resource/ral_spec.rb
@@ -25,7 +25,7 @@ describe "Puppet::Resource::Ral" do
require 'puppet/type/user'
Puppet::Type::User.expects(:instances).returns([ wrong_instance, wrong_instance ])
result = Puppet::Resource::Ral.new.find(@request)
- result.should be_is_a Puppet::Resource
+ result.should be_is_a(Puppet::Resource)
result.title.should == "root"
end
end
diff --git a/spec/unit/network/http/compression_spec.rb b/spec/unit/network/http/compression_spec.rb
index 9b9a2a516..63fd9e715 100644
--- a/spec/unit/network/http/compression_spec.rb
+++ b/spec/unit/network/http/compression_spec.rb
@@ -32,7 +32,7 @@ describe "http compression" do
it "should yield an identity uncompressor" do
response = stub 'response'
@uncompressor.uncompress(response) { |u|
- u.should be_instance_of Puppet::Network::HTTP::Compression::IdentityAdapter
+ u.should be_instance_of(Puppet::Network::HTTP::Compression::IdentityAdapter)
}
end
end
@@ -120,14 +120,14 @@ describe "http compression" do
it "should yield an identity uncompressor with no content-encoding" do
@uncompressor.uncompress(@response) { |u|
- u.should be_instance_of Puppet::Network::HTTP::Compression::IdentityAdapter
+ u.should be_instance_of(Puppet::Network::HTTP::Compression::IdentityAdapter)
}
end
it "should yield an identity uncompressor with 'identity' content-encoding" do
@response.stubs(:[]).with('content-encoding').returns 'identity'
@uncompressor.uncompress(@response) { |u|
- u.should be_instance_of Puppet::Network::HTTP::Compression::IdentityAdapter
+ u.should be_instance_of(Puppet::Network::HTTP::Compression::IdentityAdapter)
}
end
@@ -135,7 +135,7 @@ describe "http compression" do
it "should yield a Zlib uncompressor with '#{c}' content-encoding" do
@response.stubs(:[]).with('content-encoding').returns c
@uncompressor.uncompress(@response) { |u|
- u.should be_instance_of Puppet::Network::HTTP::Compression::Active::ZlibAdapter
+ u.should be_instance_of(Puppet::Network::HTTP::Compression::Active::ZlibAdapter)
}
end
end
@@ -172,7 +172,7 @@ describe "http compression" do
end
it "should try a 'regular' inflater on Zlib::DataError" do
- @inflater.expects(:inflate).raises(Zlib::DataError.new "not a zlib stream")
+ @inflater.expects(:inflate).raises(Zlib::DataError.new("not a zlib stream"))
inflater = stub_everything 'inflater2'
inflater.expects(:inflate).with("chunk").returns("uncompressed")
Zlib::Inflate.expects(:new).with().returns(inflater)
@@ -180,7 +180,7 @@ describe "http compression" do
end
it "should raise the error the second time" do
- @inflater.expects(:inflate).raises(Zlib::DataError.new "not a zlib stream")
+ @inflater.expects(:inflate).raises(Zlib::DataError.new("not a zlib stream"))
Zlib::Inflate.expects(:new).with().returns(@inflater)
lambda { @adapter.uncompress("chunk") }.should raise_error
end
diff --git a/spec/unit/parser/ast/in_operator_spec.rb b/spec/unit/parser/ast/in_operator_spec.rb
index df73645a2..9d3cab712 100644
--- a/spec/unit/parser/ast/in_operator_spec.rb
+++ b/spec/unit/parser/ast/in_operator_spec.rb
@@ -36,13 +36,13 @@ describe Puppet::Parser::AST::InOperator do
end
it "should raise an argument error if rval doesn't support the include? method" do
- @rval.expects(:safeevaluate).with(@scope).returns(stub 'value')
+ @rval.expects(:safeevaluate).with(@scope).returns(stub('value'))
lambda { @operator.evaluate(@scope) }.should raise_error
end
it "should not raise an argument error if rval supports the include? method" do
- @rval.expects(:safeevaluate).with(@scope).returns(stub 'value', :include? => true)
+ @rval.expects(:safeevaluate).with(@scope).returns(stub('value', :include? => true))
lambda { @operator.evaluate(@scope) }.should_not raise_error
end
diff --git a/spec/unit/provider/ssh_authorized_key/parsed_spec.rb b/spec/unit/provider/ssh_authorized_key/parsed_spec.rb
index f8613e35e..e60ba2797 100755
--- a/spec/unit/provider/ssh_authorized_key/parsed_spec.rb
+++ b/spec/unit/provider/ssh_authorized_key/parsed_spec.rb
@@ -44,6 +44,7 @@ describe provider_class do
@provider.stubs(:filetype).returns(Puppet::Util::FileType::FileTypeRam)
File.stubs(:chown)
File.stubs(:chmod)
+ Puppet::Util::SUIDManager.stubs(:asuser).yields
key.flush
@provider.target_object(@keyfile).read
end
@@ -99,6 +100,7 @@ describe provider_class do
@provider = provider_class.new(@resource)
provider_class.stubs(:filetype).returns(Puppet::Util::FileType::FileTypeRam)
+ Puppet::Util::SUIDManager.stubs(:asuser).yields
end
describe "when flushing" do
diff --git a/spec/unit/type_spec.rb b/spec/unit/type_spec.rb
index fe59b9c57..54fb2978c 100755
--- a/spec/unit/type_spec.rb
+++ b/spec/unit/type_spec.rb
@@ -267,7 +267,7 @@ describe Puppet::Type do
Puppet::Type.type(:mount).any_instance.stubs(:newattr).with do |param, hash|
set << param
true
- end.returns(stub_everything "a property")
+ end.returns(stub_everything("a property"))
Puppet::Type.type(:mount).new(resource)
@@ -284,7 +284,7 @@ describe Puppet::Type do
Puppet::Type.type(:mount).any_instance.stubs(:newattr).with do |param, hash|
set << param
true
- end.returns(stub_everything "a property")
+ end.returns(stub_everything("a property"))
Puppet::Type.type(:mount).new(resource)
set[0].should == :name