Skip to content
Ports functionality of mock_model and stub_model from rspec-rails for developers using Mocha.
Pull request Compare This branch is 11 commits behind mislav:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
spec
Gemfile
Gemfile.lock
README.markdown
Rakefile
rspec-rails-mocha.gemspec

README.markdown

rspec-rails Mocha extension

Functionality of mock_model and stub_model from rspec-rails for those using Mocha.

Installation:

# Gemfile
group :test do
  gem 'rspec-rails-mocha'
end

Usage:

describe "Mocha plugin" do
  it "#mock_model should use given ID" do
    person = mock_model(Person, :id => 66)

    person.should_not be_new_record
    person.id.should == 66
  end
end
Something went wrong with that request. Please try again.