diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-15 19:22:36 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2007-05-15 19:22:36 +0000 |
| commit | dbedcd7b9892bc41728a4f334464f152d09d54fc (patch) | |
| tree | 66e06fa8fec48ea00491a728ed24906e6b810812 /test | |
| parent | 28f7d6c7ebd56da3014464c82c73a4f98f3406ea (diff) | |
| download | puppet-dbedcd7b9892bc41728a4f334464f152d09d54fc.tar.gz puppet-dbedcd7b9892bc41728a4f334464f152d09d54fc.tar.xz puppet-dbedcd7b9892bc41728a4f334464f152d09d54fc.zip | |
A round of fixes so unit tests pass; most of the failures were from the merging of the transaction-refactor branch
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2517 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test')
| -rwxr-xr-x | test/network/handler/resource.rb | 3 | ||||
| -rwxr-xr-x | test/other/propertychange.rb | 7 | ||||
| -rwxr-xr-x | test/other/transactions.rb | 13 | ||||
| -rwxr-xr-x | test/util/posixtest.rb | 9 |
4 files changed, 16 insertions, 16 deletions
diff --git a/test/network/handler/resource.rb b/test/network/handler/resource.rb index b89eacac5..8d1fa1087 100755 --- a/test/network/handler/resource.rb +++ b/test/network/handler/resource.rb @@ -89,9 +89,8 @@ class TestResourceServer < Test::Unit::TestCase assert_events([:file_created], object) else assert_nothing_raised { - object.retrieve + assert(object.insync?(object.retrieve), "Object was not in sync") } - assert(object.insync?, "Object was not in sync") end assert(FileTest.exists?(file), "File did not get recreated") diff --git a/test/other/propertychange.rb b/test/other/propertychange.rb index 97ee3268c..31321753b 100755 --- a/test/other/propertychange.rb +++ b/test/other/propertychange.rb @@ -10,7 +10,7 @@ require 'puppettest' class TestPropertyChange < Test::Unit::TestCase include PuppetTest class FakeProperty < Puppet::Type::Property - attr_accessor :is, :should, :parent + attr_accessor :is, :should, :resource attr_reader :noop def change_to_s(currentvalue, newvalue) "fake change" @@ -52,10 +52,10 @@ class TestPropertyChange < Test::Unit::TestCase end def mkchange - property = FakeProperty.new :parent => "fakeparent" + property = FakeProperty.new :resource => "fakeparent" property.is = :start property.should = :finish - property.parent = :parent + property.resource = :parent change = nil assert_nothing_raised do change = Puppet::PropertyChange.new(property, :start) @@ -125,7 +125,6 @@ class TestPropertyChange < Test::Unit::TestCase Puppet[:noop] = true change.property.noop = true - p change.property.noop assert(change.noop, "did not set noop") assert(change.skip?, "setting noop did not mark change for skipping") diff --git a/test/other/transactions.rb b/test/other/transactions.rb index 3a9ba3d79..1e0b6377d 100755 --- a/test/other/transactions.rb +++ b/test/other/transactions.rb @@ -248,8 +248,9 @@ class TestTransactions < Test::Unit::TestCase assert_nothing_raised() { check.each { |property| - assert(file[property]) - properties[property] = file[property] + value = file.value(property) + assert(value) + properties[property] = value } } @@ -277,7 +278,7 @@ class TestTransactions < Test::Unit::TestCase } properties.each { |property,value| assert_equal( - value,file.is(property), "File %s remained %s" % [property, file.is(property)] + value, file.value(property), "File %s remained %s" % [property, file.value(property)] ) } end @@ -310,7 +311,7 @@ class TestTransactions < Test::Unit::TestCase } check.each { |property| - properties[property] = file[property] + properties[property] = file.value(property) } assert_nothing_raised() { file[:mode] = "755" @@ -766,7 +767,7 @@ class TestTransactions < Test::Unit::TestCase type = mkreducer do def evaluate return Puppet::PropertyChange.new(Fakeprop.new( - :path => :path, :is => :is, :should => :should, :name => self.name, :parent => "a parent"), :is) + :path => :path, :is => :is, :should => :should, :name => self.name, :resource => "a parent"), :is) end end @@ -778,7 +779,7 @@ class TestTransactions < Test::Unit::TestCase assert_nothing_raised do trans.eval_resource(resource) end - + changes = trans.instance_variable_get("@changes") assert(changes.length > 0, "did not get any changes") diff --git a/test/util/posixtest.rb b/test/util/posixtest.rb index 7939afd46..8c4174144 100755 --- a/test/util/posixtest.rb +++ b/test/util/posixtest.rb @@ -90,8 +90,9 @@ class TestPosixUtil < Test::Unit::TestCase :check => [:gid] ) obj.setdefaults - obj.retrieve - id = obj.is(:gid) + current = obj.retrieve + id = nil + current.find { |prop, value| id = value if prop.name == :gid } gid = nil assert_nothing_raised { gid = Puppet::Util.gid(id) @@ -146,7 +147,7 @@ class TestPosixUtil < Test::Unit::TestCase ) obj.setdefaults obj.retrieve - id = obj.is(:uid) + id = obj.provider.uid uid = nil assert_nothing_raised { uid = Puppet::Util.uid(id) @@ -170,4 +171,4 @@ class TestPosixUtil < Test::Unit::TestCase end end -# $Id$
\ No newline at end of file +# $Id$ |
