diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-07-04 22:52:06 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-07-04 22:52:06 +0000 |
| commit | 50b8f96f7682d8da83996957aa884044705daf33 (patch) | |
| tree | 4712ca0fad42aa990a1b928a29089dc4a1f9c320 /test | |
| parent | c762c1960cc278f974c098ede994bb82f63fd893 (diff) | |
Fixing #704 -- Puppet was not failing correctly when schedules were missing, I think
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2648 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rwxr-xr-x | test/ral/manager/type.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/test/ral/manager/type.rb b/test/ral/manager/type.rb index 58af51fea..09341f10e 100755 --- a/test/ral/manager/type.rb +++ b/test/ral/manager/type.rb @@ -835,6 +835,34 @@ end obj.evaluate end + + # Partially test #704, but also cover the rest of the schedule management bases. + def test_schedule + Puppet::Type.type(:schedule).create(:name => "maint") + + {"maint" => true, nil => false, :fail => :fail}.each do |name, should| + args = {:name => tempfile, :ensure => :file} + if name + args[:schedule] = name + end + resource = Puppet::Type.type(:file).create(args) + + if should == :fail + assert_raise(Puppet::Error, "Did not fail on missing schedule") do + resource.schedule + end + else + sched = nil + assert_nothing_raised("Failed when schedule was %s" % sched) do + sched = resource.schedule + end + + if should + assert_equal(name, sched.name, "did not get correct schedule back") + end + end + end + end end # $Id$ |
