This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SOME_SETTING = 'some value' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mock new instances of a class (verify that it's initialized with specific arguments) | |
# First argument to __new__ is the class, so pass `object` because we don't care about that part | |
flexmock(MyClass).should_receive('__new__').once.with_args(object, 'arg1', 'arg2').and_return(fake_object) | |
MyClass('wrong', 'arguments') # => MethodSignatureError | |
MyClass('arg1', 'arg2') # => <fake_object> |