./devel/ruby-mocha, Ruby library for mocking and stubbing

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]

Branch: CURRENT, Version: 1.3.0, Package name: ruby23-mocha-1.3.0, Maintainer: pkgsrc-users

Mocha is a Ruby library for mocking and stubbing using a syntax
like that of JMock, and SchMock. Most commonly Mocha is used in
conjunction with Test::Unit, but it can be used in other contexts.

One of its main advantages is that it allows you to mock and stub
methods on real (non-mock) classes and instances. You can for
example stub ActiveRecord instance methods like create, save,
destroy and even class methods like find to avoid hitting the
database in unit tests.

Mocha provides a unified, simple and readable syntax for both
traditional mocking and for mocking with real objects.

Master sites:

SHA1: 9a87ac94de925c4d873a7a5bf24b93737462a420
RMD160: 9656cbb8aa0eda7c3fade83b5ba5781bec3d28f5
Filesize: 90 KB

Version history: (Expand)

CVS history: (Expand)

   2017-08-31 17:18:09 by Takahiro Kambe | Files touched by this commit (3) | Package updated
Log message:
Update ruby-mocha to 1.3.0.

## 1.3.0

* Ensure all tests run individually - thanks to @chrisroos (#267)
* Update Travis CI build status badge to show master branch status (#264)
* Correct RSpec section of the README - thanks to @myronmarston (0cc039c8)
* Fix pretty printing of quotes in `String#mocha_inspect` (#215 & #223)
* Add release instructions to README - thanks to @chrisroos (70a5febd &
* Require at least Ruby v1.8.7 in gemspec - thanks to @knappe (3e20be8e)
* Remove redundant InstanceMethod#method_exists? - thanks to @chrisroos
* Reduce risk of hitting bug 12832 in Ruby v2.3 - thanks to @chrisroos (#277 &
* Fix JRuby build - thanks to @headius (jruby/jruby#4250) & @chrisroos (#274)
* Add latest stable version of JRuby to Travis CI build matrix (#288)
* Fix Ruby v1.8.7 builds on Travis CI (928b5a40 & 460dce5b)
* Deprecate passing block to mock object constructor (#290)
* Add a known issue to README for Ruby bug 12876 (#276)
* Add Ruby 2.4 and ruby-head to Travis CI build matrix - thanks to @junaruga
* Fix `Mocha::ParameterMatchers#includes` for `Array` values - thanks to
  @timcraft (#302)
* Use faster container-based virtual environments for Travis CI builds (#305)
* Rename `Mocha::ParameterMatchers::QueryStringMatches` to `QueryString` (#306)
* Handle blank parameter value for query string matcher - thanks to @weynsee
  (#303 & #304)
* Rename `Mocha::ParameterMatchers::QueryString` -> `EquivalentUri` (#307)
* Use `do ... end` instead of `{ ... }` in acceptance tests - thanks to
  @chrisroos (#294)
   2016-10-20 16:40:39 by Takahiro Kambe | Files touched by this commit (3) | Package updated
Log message:
Update ruby-mocha to 1.2.1.

## 1.2.1

* Fixed #272. Workaround Ruby bug 12832 which caused interpreter to hang. See \ 
https://bugs.ruby-lang.org/issues/12832. Thanks to @chrisroos & @petems \ 
(6f1c8b9b, #273).

## 1.2.0

* Always use prepended module to stub class & instance methods for Ruby v2+ \ 
- thanks to @grosser & @chrisroos (43d56671, #244)
* Always use prepended module to stub AnyInstance methods in Ruby v2+ - thanks \ 
to @chrisroos (#262)
* Always set visibility of stub method to match stubbed method on included \ 
module - thanks to @grosser & @chrisroos (e87c03b0, #248)
* Always set visibility to stub method to match stubbed method on superclass - \ 
thanks to @chrisroos (38d902ad)
* Allow stubbing of method to which any instance responds (#200)
* Allow `includes` matcher to take matcher arguments - thanks to @lazyatom (#217)
* Avoid exception in older version of Rubygems - thanks to @chrisroos (78d930a7)
* Add licenses to gemspec as requested by @coreyhaines (#201)
* Fix typo in README - thanks to @jaredbeck (6119460d)
* Added section about using Mocha with RSpec & Rails to README (#221)
* Fix documentation for Mocha::API#stub method - thanks to @raeno (599b1dcd)
* Added backers and sponsors from OpenCollective - thanks to @piamancini (#253)
* Fix typo in docs for equals - thanks to @alexcoco (#254)
* Add known issue for Ruby v1.8 to README - thanks to @chrisroos (2c642096)
   2015-11-03 04:29:40 by Alistair G. Crooks | Files touched by this commit (1995)
Log message:
Add SHA512 digests for distfiles for devel category

Issues found with existing distfiles:
No changes made to these distinfo files.

Otherwise, existing SHA1 digests verified and found to be the same on
the machine holding the existing distfiles (morden).  All existing
SHA1 digests retained for now as an audit trail.
   2015-02-01 15:50:43 by Takahiro Kambe | Files touched by this commit (3) | Package updated
Log message:
Update ruby-mocha to 1.1.0.

# Release Notes

## 1.1.0

* Set visibility of any instance stub method.
* Stub methods with a prepended method if there are other prepended methods. \ 
Thanks to @mrsimo.
* Improve docs for `Mock#responds_like` & `#responds_like_instance_of`.
* Use GitHub convention for instructions on contributing to Mocha.
* Fix typos in docs. Thanks to @10io
   2014-03-14 17:11:22 by Takahiro Kambe | Files touched by this commit (3) | Package updated
Log message:
Update ruby-mocha t 1.0.0.

# Release Notes

## 1.0.0

### External changes
* Assume 'mocha' has been required when requiring 'mocha/setup'.
* Provide shortcuts for integrating with specific test library i.e. `require \ 
'mocha/test_unit'` or `require 'mocha/mini_test'`
as alternatives to `require 'mocha/setup'`.
* Do not automatically try to integrate with test libraries. Since the automatic \ 
test library integration functionality
requires the test library to be loaded and this doesn't usually happen until \ 
*after* the bundle is loaded, it makes things
simpler if we use `require 'mocha/setup'` to explicitly setup Mocha when we know \ 
the test library has been loaded. Fixes #146 & #155.
* Consider stubs on superclasses if none exist on primary receiver. Largely \ 
based on changes suggested by @ccutrer in #145.
Note: this may break existing tests which rely on the old behaviour. Stubbing a \ 
superclass method and then invoking that
method on a child class would previously cause an unexpected invocation error. \ 
By searching up through the inheritance
hierarchy for each of the delegate mock objects, we can provide more intuitive \ 
behaviour. Instead of an unexpected invocation
error, invoking the method on the child class will cause the stubbed method on \ 
the superclass to be used.
* Avoid recursion when constructing unexpected invocation message. Fixes #168.
* Add explanation of method dispatch. Heavily based on the relevant jMock v1 \ 
documentation. Fixes #172.
* Make class_eval line number more accurate. This sets the line number as the \ 
line number of the `def` statement. Closes #169.
* Allow nesting of `responds_with` parameter matcher. Closes #166.
* Define `Mocha` module before it's referenced. The test helper defines a class \ 
`TestCase` within the `Mocha` module. When
running the tests inside the bundle, the `Mocha` module happens to be defined at \ 
this point. However when running the tests outside the bundle, it is not defined \ 
and so an exception is raised: `uninitialized constant Mocha (NameError)`. Fixes \ 
* Document lack of thread-safety. Fixes #154.
* Document how to use the build-matrix script. Fixes #160.
* Stubbing non-public method should use same visibility. This will probably \ 
break some existing tests that were somehow relying
on the stubbed method being public while the original method was protected or \ 
private. Fixes #150.

### Internal changes
* Use lastest Rubygems in Travis CI builds.
* Run the standard test suite against Ruby 2.1.0 in the build matrix.
* Run integration tests against Ruby 2.0.0 with latest Test::Unit gem in the \ 
build matrix.
* Test::Unit is not available in Ruby v1.9.3 standard library, so remove it from \ 
the build matrix.
* Force use of Test::Unit runner, etc in relevant integration tests. Prior to \ 
this, I don't think we were really testing the
Mocha integration with Test::Unit much, because, although `TestUnitTest` was a \ 
subclass of `Test::Unit::TestCase`, the
important test case instances are the temporary ones built by \ 
`TestRunner#run_as_test` et al. Prior to this change, these
would only have used Test::Unit where MiniTest was not available *at all* i.e. \ 
only in early versions of Ruby and when the
MiniTest gem was not loaded.
* Reset environment variables between build matrix builds.
* Only activate integration with relevant test library for each of the \ 
integration tests.
* Include standard build combinations from Travis CI config i.e. builds using \ 
standard library versions of test libraries.
* Fix `build-matrix.rb` script. Also use `.travis.yml` to decide what \ 
combinations to run. This means we
can now simulate the Travis CI build locally and avoid duplication. Fixes #157.
* Remove Ruby version map from build matrix script. I'm using the \ 
`rbenv-aliases` plugin to alias minor versions to the
relevant patch version.
   2013-06-16 18:17:41 by Takahiro Kambe | Files touched by this commit (3) | Package updated
Log message:
Update ruby-mocha to 0.14.0.

## 0.14.0

* Official support for MiniTest v5. All tests now pass on the continuous
  integration build.

## 0.14.0.alpha

* Add speculative support for Minitest v5. Due to incompatibilities it has not
  yet been possible to run the Mocha test suite against Minitest v5. However,
  @zenspider (author of Minitest) provided the patch and he has tested it
  against Rails v4. Fixes #156. Thanks to @zenspider.
* Documentation updates.
   2013-03-11 08:37:10 by Takahiro Kambe | Files touched by this commit (3) | Package updated
Log message:
Update ruby-mocha to to 0.13.3.

# Release Notes

## 0.13.3

* Allow `Mocha::ParameterMatchers#includes` to accept multiple items. Thanks
  to @simao.
* Allow stubbing of *private* `Kernel` methods. Fixes #134. Thanks to @camski
  for reporting.
* Avoid a warning when `test/unit/version` is required by other libraries in
  the same project. Fixes #140. Thanks to @tmiller.
* Make auto-activation of Test::Unit integration more resilient. This change
  is specifically to cope with the nasty re-defining of classes that is done
  by the `minitest-spec-rails` gem. Fixes #143. Thanks to @tubaxenor for
* Safer restoration of stubbed method visibility. Fixes #141. Thanks to @tmm1.
* Ensure `Mockery` instance gets reset even if exception raised. Fixes #144.
* Adapt Mocha acceptance tests to cope with changes in output from latest
  (v4.6.2) of MiniTest.
* Updates to README about Rails compatibility.
   2013-02-11 03:54:19 by Takahiro Kambe | Files touched by this commit (3) | Package updated
Log message:
Update ruby-mocha to 0.13.2.

# Release Notes

## 0.13.2
* Stubbing of methods re-declared with different visibilty. Fixes #109.
* Add `Mock#responds_like_instance_of`. Fixes #119.
* Make `Expectation#inspect` less verbose and more useful. Fixes #122.
* Make unit tests more robust to changes in environment. Fixes #121.
* Update README in an attempt to head Rails-related issues off at the pass.
* Add a Gem Badge to provide a link to Mocha on Rubygems.
* Make documentation example consistent with other examples.