Displaying 1 result from an estimated 1 matches for "blaobserv".
Did you mean:
blaobserver
2007 Mar 15
1
Howto find out, a function was called
...lve a
problem, perhaps you can give me a hint.
I have a Observer (yes, in Rails), and want to test, that this
observer does (or does not) call a special method on the observed
object.
In this example, the object has a sync-method, that shall be called
before_update.
The Observer looks like
class BlaObserver < Observer
@@sync = true
def before_save(object)
object.sync if @@sync
end
def self.ignore
before = @@sync
@@sync = false
yield
@@sync = before
end
end
Now i want to test, if the method sync is called, if i call
BlaObserver.ignore do
ob...