diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-10-18 18:15:43 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-10-18 18:15:43 +0000 |
| commit | 7b34e25d1cb4c70568ed05e01556a12994b19dbf (patch) | |
| tree | a7bdbcc9c2883f805a9c84a518a1b1513a0fc09a /test/lib | |
| parent | ead49c673e352166d87f47cbbea2086d4c1fc2f7 (diff) | |
Another round of bug-fixes in preparation for 0.20.0
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1813 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/lib')
| -rwxr-xr-x | test/lib/puppettest.rb | 5 | ||||
| -rw-r--r-- | test/lib/puppettest/fakes.rb | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/test/lib/puppettest.rb b/test/lib/puppettest.rb index de2747336..07e3e084e 100755 --- a/test/lib/puppettest.rb +++ b/test/lib/puppettest.rb @@ -1,6 +1,11 @@ require 'puppet' require 'test/unit' +# Yay; hackish but it works +if ARGV.include?("-d") + Puppet.debug = true +end + module PuppetTest # Find the root of the Puppet tree; this is not the test directory, but # the parent of that dir. diff --git a/test/lib/puppettest/fakes.rb b/test/lib/puppettest/fakes.rb index 40fe96a10..338afe575 100644 --- a/test/lib/puppettest/fakes.rb +++ b/test/lib/puppettest/fakes.rb @@ -5,10 +5,14 @@ module PuppetTest class FakeModel include Puppet::Util class << self - attr_accessor :name + attr_accessor :name, :realmodel @name = :fakemodel end + def self.namevar + @realmodel.namevar + end + def self.validstates Puppet::Type.type(@name).validstates end @@ -154,6 +158,10 @@ module PuppetTest unless @@fakemodels.include? type @@fakemodels[type] = Class.new(FakeModel) @@fakemodels[type].name = type + + model = Puppet::Type.type(type) + raise("Could not find type %s" % type) unless model + @@fakemodels[type].realmodel = model end obj = @@fakemodels[type].new(name) |
