summaryrefslogtreecommitdiffstats
path: root/test/other
diff options
context:
space:
mode:
authorballman <ballman@980ebf18-57e1-0310-9a29-db15c13687c0>2007-05-09 01:51:20 +0000
committerballman <ballman@980ebf18-57e1-0310-9a29-db15c13687c0>2007-05-09 01:51:20 +0000
commitc1643600e1130e2ddd112abcf16bb040fbffe0bf (patch)
tree73db9055495e529b0cac11ba8e81eb910db1e6a5 /test/other
parent8f187461a357898395ded25fb0c29a0d90a76896 (diff)
Merging of refactor-transacton to the trunk. This work removes the :is attribute from properties and relies on the provider to cache or return the current value of the property.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2487 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'test/other')
-rwxr-xr-xtest/other/propertychange.rb14
-rwxr-xr-xtest/other/transactions.rb8
2 files changed, 11 insertions, 11 deletions
diff --git a/test/other/propertychange.rb b/test/other/propertychange.rb
index d60a2ba2c..97ee3268c 100755
--- a/test/other/propertychange.rb
+++ b/test/other/propertychange.rb
@@ -12,11 +12,11 @@ class TestPropertyChange < Test::Unit::TestCase
class FakeProperty < Puppet::Type::Property
attr_accessor :is, :should, :parent
attr_reader :noop
- def change_to_s
+ def change_to_s(currentvalue, newvalue)
"fake change"
end
- def insync?
- @is == @should
+ def insync?(is)
+ is == @should
end
def log(msg)
Puppet::Util::Log.create(
@@ -35,11 +35,11 @@ class TestPropertyChange < Test::Unit::TestCase
def path
"fakechange"
end
- def should_to_s
- @should.to_s
+ def should_to_s(newvalue)
+ newvalue.to_s
end
def sync
- if insync?
+ if insync?(@is)
return nil
else
@is = @should
@@ -58,7 +58,7 @@ class TestPropertyChange < Test::Unit::TestCase
property.parent = :parent
change = nil
assert_nothing_raised do
- change = Puppet::PropertyChange.new(property)
+ change = Puppet::PropertyChange.new(property, :start)
end
change.transaction = :trans
diff --git a/test/other/transactions.rb b/test/other/transactions.rb
index 00241c93e..3a9ba3d79 100755
--- a/test/other/transactions.rb
+++ b/test/other/transactions.rb
@@ -17,7 +17,7 @@ class TestTransactions < Test::Unit::TestCase
def should_to_s
@should.to_s
end
- def insync?
+ def insync?(foo)
true
end
def info(*args)
@@ -466,7 +466,7 @@ class TestTransactions < Test::Unit::TestCase
file[:content] = "totally different content"
- assert(! file.insync?, "Uh, file is in sync?")
+ assert(! file.insync?(file.retrieve), "Uh, file is in sync?")
assert_events([:file_changed, :triggered], comp)
assert(FileTest.exists?(fname), "File did not get recreated")
@@ -766,7 +766,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"))
+ :path => :path, :is => :is, :should => :should, :name => self.name, :parent => "a parent"), :is)
end
end
@@ -1015,7 +1015,7 @@ class TestTransactions < Test::Unit::TestCase
obj = type.create(:name => "yay", :testing => "cool")
- assert(! obj.insync?, "fake object is already in sync")
+ assert(! obj.insync?(obj.retrieve), "fake object is already in sync")
# Now make sure it gets refreshed when the change happens
assert_apply(obj)