Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Mocha is a mocking and stubbing library for Ruby
Ruby

This branch is 1 commit ahead, 423 commits behind freerange:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
lib
test
.gemtest
.gitignore
.travis.yml
COPYING.rdoc
MIT-LICENSE.rdoc
README.rdoc
RELEASE.rdoc
Rakefile
TODO
init.rb
mocha.gemspec

README.rdoc

Mocha

Mocha is a library for mocking and stubbing using a syntax like that of JMock.

It can be used with many testing frameworks e.g. Test::Unit, RSpec, test/spec, expectations, Dust, MiniTest and even JtestR.

Mocha provides a unified, simple and readable syntax for both traditional mocking and partial mocking.

Mocha was harvested from projects at Reevoo by me (James) and my (then) colleagues Ben, Chris and Paul.

Download and Installation

Install the gem with the following command…

$ gem install mocha

Or install the Rails plugin…

$ script/plugin install git://github.com/floehopper/mocha.git

Note that versions 0.9.6 & 0.9.7 of the Rails plugin were broken. As of version 0.9.8, you need to explicitly load Mocha after the test framework e.g. by adding “require 'mocha'” at the bottom of test/test_helper.rb.

Or download Mocha…

http://rubyforge.org/frs/?group_id=1917

Examples

License

Copyright Revieworld Ltd. 2006

You may use, copy and redistribute this library under the same terms as Ruby itself or under the MIT license.

Something went wrong with that request. Please try again.