Displaying 3 results from an estimated 3 matches for "hidden_method".
2007 Dec 21
5
Mocha and rails 2.0.2?
...With Rails 2.0.2, I''m seeing mocha failures where they did not fail
with Rails 2.0.1
test_set_to_process_fail_in_transaction(FileRecordTest):
NoMethodError: undefined method `ord'' for 63:Fixnum
/home/wolpert/svn/rubylms/vendor/plugins/mocha/lib/mocha/class_method.rb:45:in
`hidden_method''
/home/wolpert/svn/rubylms/vendor/plugins/mocha/lib/mocha/class_method.rb:45:in
`gsub''
/home/wolpert/svn/rubylms/vendor/plugins/mocha/lib/mocha/class_method.rb:45:in
`hidden_method''
/home/wolpert/svn/rubylms/vendor/plugins/mocha/lib/mocha/class_method.rb:29:in...
2007 Mar 30
7
problem with using any_instance
Hey all,
I have a question with using mocha in my tests.
In the same test file, I have two tests,
<code>
def test_a
klass.any_instance.stubs(:method_name).returns("something")
klass.new.method_name
...
end
def test_b
...
klass.new.method_name
...
end
</code>
where klass is some class
when the tests run, test _a passes, but test_b had an error like this:
2007 Aug 08
1
Mocking Time, delegating to original object
...w(Delegator.new(self))
end
alias :stops_mocking :delegates
alias :stops_stubbing :delegates
end
class Delegator
def initialize expectation
@expectation = expectation
end
def evaluate
@expectation.mock.stub_method.stubbee.send(@expectation.mock.stub_method.hidden_method)
end
end
end
class Object
def expects(symbol)
method = stubba_method.new(stubba_object, symbol)
$stubba.stub(method)
mocha.expects(symbol, caller, method)
end
def stubs(symbol)
method = stubba_method.new(stubba_object, symbol)
$stubba.stub(method)
mocha.stubs...