I have module Database with method generate_from_database that spins for loops and calls method get_length. How can I te开发者_高级运维st if get_length was called n times, by using rspec or mocha?
Has anyone seen this? Here\'s the error: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -rrubygems -e \"require \'redgreen\'\"-I.:lib:test -rubygems -e \"[\'test/unit\', \'test/t
I\'ve followed all of the steps that I\'ve been able to find online for configuring Rails 3 with Rspec 2 and Mocha. In my Gemfile:
I have been following the 15 TDD steps to create a Rails application guide - but have run into an issue I cannot seem to resolve.For the functional test of the WordsController, I have the following co
Much like this question, I too am using Ryan Bates\'s nifty_scaffold. It has the desirable aspect of using Mocha\'s any_instance method 开发者_C百科to force an \"invalid\" state in model objects burie
I have the following controller test case: def test_showplain Cleaner.expect(:parse).with(@somecontent)
The gist of my problem is as follows:- I\'m writing a Mocha mock in Ruby for the method represented as \"post_to_embassy\" below. It is not really our concern, for the purpose of describing the probl
Within my controller specs I am stubbing开发者_运维知识库 out valid? for some routing tests, (based on Ryan Bates nifty_scaffold) as follows :-
How can I mock an array\'s sort expect a lambda expression? This is a trivial example of my problem: # initializing the data
I have the following rspec code: require \'spec_helper\' require \'mocha\' require \'rr\' describe ProjectsController, \"creating a new project\" do