summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Schulte <stefan.schulte@taunusstein.net>2011-01-08 22:15:32 +0100
committerStefan Schulte <stefan.schulte@taunusstein.net>2011-01-09 14:16:30 +0100
commitf2dfee6e2f8731bb0b04a0dfc1e1b3b4146a4289 (patch)
treed39fb3f27375fabf876b7ed075b0dc8e4fe08d25
parent76d1c2aefb32cc3688e3f7c0a5c8bbf713a123ed (diff)
downloadpuppet-f2dfee6e2f8731bb0b04a0dfc1e1b3b4146a4289.tar.gz
puppet-f2dfee6e2f8731bb0b04a0dfc1e1b3b4146a4289.tar.xz
puppet-f2dfee6e2f8731bb0b04a0dfc1e1b3b4146a4289.zip
(#5814) cron_spec shouldn't depend on cron provider
if cron is not installed the specs will throw errors abould not finding a default provider. Because the spec doesn't test provider features it shouldn't depend on any providers. Add stubs to let cron_spec work with no suitable provider
-rwxr-xr-xspec/unit/type/cron_spec.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/spec/unit/type/cron_spec.rb b/spec/unit/type/cron_spec.rb
index 03817d20e..1fe654d5a 100755
--- a/spec/unit/type/cron_spec.rb
+++ b/spec/unit/type/cron_spec.rb
@@ -4,7 +4,18 @@ Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f
describe Puppet::Type.type(:cron) do
before do
- @cron = Puppet::Type.type(:cron).new( :name => "foo" )
+ @class = Puppet::Type.type(:cron)
+
+ # Init a fake provider
+ @provider_class = stub 'provider_class', :ancestors => [], :name => 'fake', :suitable? => true, :supports_parameter? => true
+ @class.stubs(:defaultprovider).returns @provider_class
+ @class.stubs(:provider).returns @provider_class
+
+ @provider = stub 'provider', :class => @provider_class, :clean => nil
+ @provider.stubs(:is_a?).returns false
+ @provider_class.stubs(:new).returns @provider
+
+ @cron = @class.new( :name => "foo" )
end
it "it should accept an :environment that looks like a path" do