Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Rails プラグインを作成していますが、ヘルパーにメソッドを動的に追加しています。メソッドが追加されていることを確認したいだけです。ヘルパーがメソッド名に応答するかどうかを確認するにはどうすればよいですか?
これを試して:
def test_that_foo_helper_defines_bar o = Object.new assert !o.respond_to? :bar o.extend FooHelper assert o.respond_to? :bar end