github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

floehopper / mocha

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 155
    • 21
  • Source
  • Commits
  • Network (21)
  • Issues (0)
  • Downloads (9)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (9)
    • rel-0_9_1
    • rel-0_9_0
    • rel-0_5_5
    • rel-0_5_4
    • rel-0_5_3
    • rel-0_5_2
    • rel-0_5_1
    • rel-0_5_0
    • rel-0_4_0
Sending Request…
Click here to lend your support to: mocha and make a donation at www.pledgie.com ! Edit Pledgie Setup

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Mocha is a mocking and stubbing library for Ruby — Read more

  cancel

http://mocha.rubyforge.org/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Add commit SHA1 for 0.9.8 to release notes. 
floehopper (author)
Fri Sep 18 04:03:47 -0700 2009
commit  fc3b9ba798d7fb1a1f0d16e018487fb3eed8cb74
tree    2e836c488e5fa1a03128f26a97271bf0c3b7751b
parent  645024765b2d92018efc511652e1174163844e39
mocha /
name age
history
message
file .gitignore Tue Sep 15 07:26:39 -0700 2009 Remove rdoc template incorporating google analy... [floehopper]
file COPYING Fri Jun 29 10:56:36 -0700 2007 Replace tabs with spaces. [floehopper]
file MIT-LICENSE Sun Sep 03 16:10:14 -0700 2006 Added missing files - MIT license and examples. [floehopper]
file README Fri Sep 18 03:57:57 -0700 2009 Fixed Rails plugin which stopped working after ... [floehopper]
file RELEASE Fri Sep 18 04:03:47 -0700 2009 Add commit SHA1 for 0.9.8 to release notes. [floehopper]
file Rakefile Fri Sep 18 03:57:57 -0700 2009 Fixed Rails plugin which stopped working after ... [floehopper]
file TODO Tue Dec 30 10:17:11 -0800 2008 Removed completed todo items. [floehopper]
directory examples/ Wed Feb 04 06:07:29 -0800 2009 As per commit f0f0a42c, we should be consistent... [floehopper]
file init.rb Fri Sep 18 03:57:57 -0700 2009 Fixed Rails plugin which stopped working after ... [floehopper]
directory lib/ Tue Sep 15 07:51:41 -0700 2009 The regexp_matches matcher won't match or raise... [Sander Hartlage]
file mocha.gemspec Fri Sep 18 03:57:57 -0700 2009 Fixed Rails plugin which stopped working after ... [floehopper]
directory test/ Tue Sep 15 08:02:05 -0700 2009 Fix Ruby 1.9 build broken by accepting commit d... [floehopper]
README
= Mocha

Mocha is a library for mocking and stubbing using a syntax like that of JMock[http://www.jmock.org].

It can be used with many testing frameworks e.g. Test::Unit[http://www.ruby-doc.org/core/classes/Test/Unit.html], 
RSpec[http://rspec.info/], test/spec[http://chneukirchen.org/repos/testspec/README], 
expectations[http://expectations.rubyforge.org/], Dust[http://dust.rubyforge.org/], 
MiniTest[http://rubyforge.org/projects/bfts] and even JtestR[http://jtestr.codehaus.org/].

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

Mocha was harvested from projects at Reevoo[http://www.reevoo.com] by me (James[http://blog.floehopper.org]) and my 
(then) colleagues Ben[http://www.techbelly.com/], Chris[http://chrisroos.co.uk] and Paul[http://po-ru.com].

== Download and Installation

Install the gem with the following command...

  $ gem install mocha

Or install the Rails[http://www.rubyonrails.org] 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

* 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}[http://blog.floehopper.org]
* {Mailing List Archives}[http://groups.google.com/group/mocha-developer]

== License

Copyright Revieworld Ltd. 2006

You may use, copy and redistribute this library under the same terms as {Ruby 
itself}[http://www.ruby-lang.org/en/LICENSE.txt] or under the {MIT 
license}[http://mocha.rubyforge.org/files/MIT-LICENSE.html].
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server