From: Pradeep Gatram Date: 2007-11-13T19:21:38+09:00 Subject: how to ensure signature compliance while mocking in ruby Let me put my dilemma as an example. Take a look at a snippet from FooTest. #using mocha def test_method1 Bar.expects(:method2).with('param1', 'param2').once Foo.method1 end And now the implementation class Foo def self.method1 Bar.method2('param1', 'param2') end end class Bar end So far so good... Now my dilemma is that while implementing method2 in Bar, I can come up with any weird signature (e.g. def method2 someInteger, someOtherNumber) and I will not be breaking FooTest. This obviously makes life hard while refactoring. Coming from a Java/C# background, I used to rely on compilation to catch these issues. How have people solved such problems? Pradeep -- Posted via http://www.ruby-forum.com/.