public
Description: Ports functionality of mock_model and stub_model from rspec-rails for developers using Mocha.
Homepage: http://rspec.lighthouseapp.com/projects/5645/tickets/275-mock_model-is-unusable-when-using-mocha
Clone URL: git://github.com/mislav/rspec-rails-mocha.git
mislav (author)
Thu Aug 28 18:34:15 -0700 2008
commit  0a832b1965fedfcfc15873e0c20ba937302a43ee
tree    adbc7a9e87295323c50ef24ce7361f6d9ab001ac
name age message
file README.markdown Loading commit data...
file init.rb
directory lib/
directory spec/
README.markdown

RSpec-Rails Mocha plugin

This brings functionality of mock_model and stub_model from rspec-rails to those using Mocha.

require 'rubygems'
gem 'rspec', '1.1.4'
require 'spec'
require 'spec/rails'
require 'rspec_rails_mocha'

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