Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Mocha is a mocking & stubbing library for Ruby

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…


Cannot retrieve the latest commit at this time

Octocat-spinner-32 examples
Octocat-spinner-32 lib
Octocat-spinner-32 templates
Octocat-spinner-32 test
Octocat-spinner-32 vendor
Octocat-spinner-32 .gitignore
Octocat-spinner-32 COPYING
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README
Octocat-spinner-32 RELEASE
Octocat-spinner-32 Rakefile
Octocat-spinner-32 TODO
Octocat-spinner-32 init.rb
Octocat-spinner-32 mocha.gemspec
= 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://

Or download Mocha...

== Examples

* Quick Start - {Usage Examples}[link:examples/misc.html]
* Traditional mocking - {Star Trek Example}[link:examples/mocha.html]
* Setting expectations on real classes - {Order Example}[link:examples/stubba.html]
* More examples on {Floehopper's Blog}[]
* {Mailing List Archives}[]

== 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.