I am creating a Rails plugin and it is dynamically adding a method to a Helper. I just want to ensure that the method is added. How can I see if the Helper responds to the method name?
+5
A:
Try this:
def test_that_foo_helper_defines_bar
o = Object.new
assert !o.respond_to? :bar
o.extend FooHelper
assert o.respond_to? :bar
end
James A. Rosen
2008-09-20 22:18:10
Fantastic! Thanks for the help.
Sixty4Bit
2008-09-20 22:25:47