Skip to content
forked from freerange/mocha

Mocha is a mocking and stubbing library for Ruby

License

Unknown, MIT licenses found

Licenses found

Unknown
COPYING
MIT
MIT-LICENSE
Notifications You must be signed in to change notification settings

MitinPavel/mocha

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

= Mocha

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

It can be used with many testing frameworks e.g. Test::Unit[http:https://www.ruby-doc.org/core/classes/Test/Unit.html], RSpec[http:https://rspec.info/], test/spec[http:https://chneukirchen.org/repos/testspec/README], expectations[http:https://expectations.rubyforge.org/], Dust[http:https://dust.rubyforge.org/], MiniTest[http:https://rubyforge.org/projects/bfts] and even JtestR[http:https://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:https://www.reevoo.com] by me (James[http:https://blog.floehopper.org]) and my (then) colleagues Ben[http:https://www.techbelly.com/], Chris[http:https://chrisroos.co.uk] and Paul[http:https://po-ru.com].

== Download and Installation

Install the gem with the following command...

  $ gem install mocha

Or install the Rails[http:https://www.rubyonrails.org] plugin...

  $ script/plugin install git:https://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:https://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:https://blog.floehopper.org]
* {Mailing List Archives}[http:https://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:https://www.ruby-lang.org/en/LICENSE.txt] or under the {MIT license}[http:https://mocha.rubyforge.org/files/MIT-LICENSE.html].

About

Mocha is a mocking and stubbing library for Ruby

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
COPYING
MIT
MIT-LICENSE

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%