P
Pradeep Gatram
Let me put my dilemma as an example. Take a look at a snippet from
FooTest.
#using mocha
def test_method1
Bar.expectsmethod2).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
FooTest.
#using mocha
def test_method1
Bar.expectsmethod2).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