diff --git a/.rubocop.yml b/.rubocop.yml index bbd3cd6fa..0d607d730 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -8,6 +8,9 @@ AllCops: Style/Alias: EnforcedStyle: prefer_alias_method +Style/Documentation: + Enabled: false + # Enumerable#each_with_object only available since Ruby v1.9 Style/EachWithObject: Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index c6d79c8ad..acfcca4d2 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,49 +1,26 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2018-07-26 12:42:35 +0100 using RuboCop version 0.58.2. +# on 2019-11-16 18:15:36 +0000 using RuboCop version 0.58.2. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 53 +# Offense count: 57 Metrics/AbcSize: - Max: 39 + Max: 26 -# Offense count: 2 -# Configuration parameters: CountComments, ExcludedMethods. -# ExcludedMethods: refine -Metrics/BlockLength: - Max: 48 - -# Offense count: 22 +# Offense count: 23 # Configuration parameters: CountComments. Metrics/ClassLength: - Max: 368 - -# Offense count: 4 -Metrics/CyclomaticComplexity: - Max: 9 + Max: 366 -# Offense count: 173 +# Offense count: 172 # Configuration parameters: CountComments. Metrics/MethodLength: Max: 31 -# Offense count: 1 -# Configuration parameters: CountComments. -Metrics/ModuleLength: - Max: 158 - -# Offense count: 5 -Metrics/PerceivedComplexity: - Max: 11 - -# Offense count: 105 -Style/Documentation: - Enabled: false - -# Offense count: 501 +# Offense count: 545 # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https Metrics/LineLength: diff --git a/.travis.yml b/.travis.yml index 0e96c82b2..541e67e70 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,11 +8,12 @@ rvm: - 2.0.0 - 2.1.10 - 2.2.10 - - 2.3.7 - - 2.4.4 - - 2.5.1 + - 2.3.8 + - 2.4.9 + - 2.5.7 + - 2.6.5 - ruby-head - - jruby-9.2.8.0 + - jruby-9.2.9.0 - jruby-head - truffleruby gemfile: @@ -27,19 +28,22 @@ matrix: - rvm: jruby-head gemfile: gemfiles/Gemfile.minitest.latest env: MOCHA_OPTIONS=debug MOCHA_RUN_INTEGRATION_TESTS=minitest - - rvm: jruby-9.2.8.0 + - rvm: jruby-9.2.9.0 gemfile: gemfiles/Gemfile.minitest.latest env: MOCHA_OPTIONS=debug MOCHA_RUN_INTEGRATION_TESTS=minitest - rvm: ruby-head gemfile: gemfiles/Gemfile.minitest.latest env: MOCHA_OPTIONS=debug MOCHA_RUN_INTEGRATION_TESTS=minitest - - rvm: 2.5.1 + - rvm: 2.6.5 gemfile: gemfiles/Gemfile.minitest.latest env: MOCHA_OPTIONS=debug MOCHA_RUN_INTEGRATION_TESTS=minitest - - rvm: 2.4.4 + - rvm: 2.5.7 gemfile: gemfiles/Gemfile.minitest.latest env: MOCHA_OPTIONS=debug MOCHA_RUN_INTEGRATION_TESTS=minitest - - rvm: 2.3.7 + - rvm: 2.4.9 + gemfile: gemfiles/Gemfile.minitest.latest + env: MOCHA_OPTIONS=debug MOCHA_RUN_INTEGRATION_TESTS=minitest + - rvm: 2.3.8 gemfile: gemfiles/Gemfile.minitest.latest env: MOCHA_OPTIONS=debug MOCHA_RUN_INTEGRATION_TESTS=minitest - rvm: 2.2.10 @@ -102,7 +106,7 @@ matrix: - rvm: truffleruby gemfile: gemfiles/Gemfile.test-unit.latest env: MOCHA_OPTIONS=debug MOCHA_RUN_INTEGRATION_TESTS=test-unit - - rvm: jruby-9.2.8.0 + - rvm: jruby-9.2.9.0 gemfile: gemfiles/Gemfile.test-unit.latest env: MOCHA_OPTIONS=debug MOCHA_RUN_INTEGRATION_TESTS=test-unit - rvm: jruby-head @@ -111,13 +115,16 @@ matrix: - rvm: ruby-head gemfile: gemfiles/Gemfile.test-unit.latest env: MOCHA_OPTIONS=debug MOCHA_RUN_INTEGRATION_TESTS=test-unit - - rvm: 2.5.1 + - rvm: 2.6.5 + gemfile: gemfiles/Gemfile.test-unit.latest + env: MOCHA_OPTIONS=debug MOCHA_RUN_INTEGRATION_TESTS=test-unit + - rvm: 2.5.7 gemfile: gemfiles/Gemfile.test-unit.latest env: MOCHA_OPTIONS=debug MOCHA_RUN_INTEGRATION_TESTS=test-unit - - rvm: 2.4.4 + - rvm: 2.4.9 gemfile: gemfiles/Gemfile.test-unit.latest env: MOCHA_OPTIONS=debug MOCHA_RUN_INTEGRATION_TESTS=test-unit - - rvm: 2.3.7 + - rvm: 2.3.8 gemfile: gemfiles/Gemfile.test-unit.latest env: MOCHA_OPTIONS=debug MOCHA_RUN_INTEGRATION_TESTS=test-unit - rvm: 2.2.10 diff --git a/README.md b/README.md index 40f644ac1..d43eefe82 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,14 @@ ### Description -* A Ruby library for mocking and stubbing. +* A Ruby library for [mocking](http://xunitpatterns.com/Mock%20Object.html) and [stubbing](http://xunitpatterns.com/Test%20Stub.html) - but deliberately not (yet) [faking](http://xunitpatterns.com/Fake%20Object.html) or [spying](http://xunitpatterns.com/Test%20Spy.html). * A unified, simple and readable syntax for both full & partial mocking. * Built-in support for MiniTest and Test::Unit. * Supported by many other test frameworks. +### Intended Usage +Mocha is intended to be used in unit tests for the [Mock Object](http://xunitpatterns.com/Mock%20Object.html) or [Test Stub](http://xunitpatterns.com/Test%20Stub.html) types of [Test Double](http://xunitpatterns.com/Test%20Double.html), not the [Fake Object](http://xunitpatterns.com/Fake%20Object.html) or [Test Spy](http://xunitpatterns.com/Test%20Spy.html) types. Although it would be possible to extend Mocha to allow the implementation of fakes and spies, we have chosen to keep it focused on mocks and stubs. + ### Installation #### Gem @@ -92,14 +95,6 @@ end Note: There is no need to use a require statement to setup Mocha; RSpec does this itself. -#### Rails Plugin - -Install the Rails plugin... - - $ rails plugin install git://github.com/freerange/mocha.git - -Note: As of version 0.9.8, the Mocha plugin is not automatically setup at plugin load time. Instead it must be manually setup e.g. at the bottom of your `test_helper.rb`. - ##### MiniTest ```ruby @@ -115,7 +110,6 @@ require 'mocha/minitest' * 0.13.x versions cause a harmless, but annoying, deprecation warning when used with Rails 3.2.0-3.2.12, 3.1.0-3.1.10 & 3.0.0-3.0.19. * 0.11.x versions don't work with Rails 3.2.13 (`TypeError: superclass mismatch for class ExpectationError`). See #115. * Versions 0.10.2, 0.10.3 & 0.11.0 of the Mocha gem were broken. Please do not use these versions. -* Versions 0.9.6 & 0.9.7 of the Mocha Rails plugin were broken. Please do not use these versions. ### Usage diff --git a/RELEASE.md b/RELEASE.md index de29a000c..e052668af 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,5 +1,53 @@ # Release Notes +## 1.10.0.alpha + +### External changes + +* Remove dependency on metaclass gem (#49, #365) +* Accept symbol (as well as a string) as mock/stub name - thanks to @nitishr (#347, #353, #377) +* More realistic examples in documentation for `Expectation#yields` and `#multiple_yields` - thanks to @nitishr (#352, #383) +* Improve documentation for `Mock#responds_like` & `#responds_like_instance_of` - thanks to @nitishr (#337, #384) +* Make `Expectation#yields` & `Expectation#multiple_yields` fail when the caller of the stubbed method does not provide a block. This is a change to an undocumented aspect of the public API's behaviour. If this causes your tests to fail, then fix it by removing the unnecessary call to `Expectation#yields` or `Expectation#multiple_yields` - thanks to @nitishr (#382) +* Document `MOCHA_OPTIONS` in README - thanks to @nitishr (#311, #386) +* Add documentation to explain how Mocha is intended to be used - thanks to @nitishr (#330, #385) +* Deprecation warning if integration using 'mocha/test_unit' or 'mocha/minitest' fails - thanks to @nitishr (#229, #389, c6032d0b) +* Require at least one specified sequence for `Expectation#in_sequence` - thanks to @nitishr (#79, #396, 9020248a) +* Make signatures of `Mock#unstub` & `ObjectMethods#unstub` consistent - thanks to @nitishr (#397, f04d437) +* Deprecate requiring 'mocha/setup' (36adf880) +* Optionally display matching invocations alongside expectations - thanks to @nitishr (#178, #394, 00f0540, #410) +* Put deprecations into effect (#400, #418): + * Remove deprecated 'mocha_standalone.rb' & 'mocha/standalone.rb' + * Fail fast if no test library loaded + * Removed optional block for `Mocha::API#mock`, `#stub` & `#stub_everything` + * Remove deprecated `ParameterMatchers#has_equivalent_query_string` method + * Remove deprecated 'mocha/mini_test.rb' +* Fix typo in docs for `Mocha::Configuration.prevent` (266ce71c) +* New-style configuration (see documentation for `Mocha::Configuration`) (#407, #421) +* Deprecate support for Ruby versions earlier than v1.9 (#325, c5f8496d) +* Deprecate support for versions of test-unit & minitest which need monkey-patching (a34e1a88) +* Deprecate old-style Rails plugin (#403, 2df77134) +* Documentation fixes & improvements which also fix YARD warnings (472d5416, a2c0d64a) + +### Internal changes + +* Pin minitest to v5.11.3 for Ruby v1.8.7 to fix build; minitest no longer supports Ruby v1.8.7 (4a0a580) +* Upgrade JRuby to v9.2.8.0 in Travis CI builds (aa29b3f) +* Only run rubocop for MRI Ruby versions & non-integration test builds (8f1c6af) +* Reduce duplication in any instance method class - thanks to @nitishr (#378) +* Simplify `AnyInstanceMethod`, `ClassMethod`, `InstanceMethod`, `ModuleMethod` class hierarchy - thanks to @nitishr (#381) +* Simplify `ClassMethods#method_exists?` & `ObjectMethods#method_exists?` making them consistent - thanks to @nitishr (#270, #362, #370) +* Don't override definition of `singleton_class` in `ClassMethods` - thanks to @nitishr (#391, #392) +* Do not include 'method_definer' methods into all objects (#268, #402) +* Distinguish different `ObjectMethods` modules (#268, #404) +* Pass invocation to expectation list methods - thanks to @nitishr (#408, #409, #411) +* Consistently use `assert_raises` - thanks to @nitishr (#405, #412, a66b7bed) +* Update Ruby & JRuby versions in Travis CI config (18cb1a93, eb061c53) +* Rubocop improvements (aa16ea67...6f4db70b, 2a1240e6...e95716ae) +* Fix inconsistency in CardinalityTest (aa10e0a8) +* Fix test failures on Mac OSX Catalina - thanks to @nitishr (#413, #417, #419, 8a0f2535) +* Remove default argument in `Expectation#invoke` - thanks to @nitishr (#414, #420) + ## 1.9.0 * Add TruffleRuby to Travis CI build matrix - thanks to @deepj (#354) diff --git a/Rakefile b/Rakefile index 63b76cf70..2691965b0 100644 --- a/Rakefile +++ b/Rakefile @@ -17,7 +17,7 @@ task 'test' do end end -namespace 'test' do +namespace 'test' do # rubocop:disable Metrics/BlockLength unit_tests = FileList['test/unit/**/*_test.rb'] all_acceptance_tests = FileList['test/acceptance/*_test.rb'] ruby186_incompatible_acceptance_tests = FileList['test/acceptance/stub_class_method_defined_on_*_test.rb'] + FileList['test/acceptance/stub_instance_method_defined_on_*_test.rb'] @@ -92,6 +92,7 @@ begin rescue LoadError # rubocop:disable Lint/HandleExceptions end +# rubocop:disable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity def benchmark_test_case(klass, iterations) require 'benchmark' require 'mocha/detection/mini_test' @@ -119,6 +120,7 @@ def benchmark_test_case(klass, iterations) Benchmark.realtime { iterations.times { Test::Unit::UI::Console::TestRunner.run(klass, @silent_option) } } end end +# rubocop:enable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity if ENV['MOCHA_GENERATE_DOCS'] require 'yard' diff --git a/docs/Mocha.html b/docs/Mocha.html index 042d57e8d..0fbc45f29 100644 --- a/docs/Mocha.html +++ b/docs/Mocha.html @@ -6,7 +6,7 @@ Module: Mocha - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -79,7 +79,7 @@
Defined in:
lib/mocha/api.rb,
- lib/mocha/hooks.rb,
lib/mocha/mock.rb,
lib/mocha/expectation.rb,
lib/mocha/object_methods.rb,
lib/mocha/class_methods.rb,
lib/mocha/parameter_matchers.rb,
lib/mocha/parameter_matchers/not.rb,
lib/mocha/parameter_matchers/base.rb,
lib/mocha/parameter_matchers/is_a.rb,
lib/mocha/parameter_matchers/all_of.rb,
lib/mocha/parameter_matchers/any_of.rb,
lib/mocha/parameter_matchers/equals.rb,
lib/mocha/parameter_matchers/object.rb,
lib/mocha/parameter_matchers/has_key.rb,
lib/mocha/parameter_matchers/kind_of.rb,
lib/mocha/parameter_matchers/anything.rb,
lib/mocha/parameter_matchers/includes.rb,
lib/mocha/parameter_matchers/has_entry.rb,
lib/mocha/parameter_matchers/has_value.rb,
lib/mocha/parameter_matchers/optionally.rb,
lib/mocha/parameter_matchers/has_entries.rb,
lib/mocha/parameter_matchers/instance_of.rb,
lib/mocha/parameter_matchers/responds_with.rb,
lib/mocha/parameter_matchers/any_parameters.rb,
lib/mocha/parameter_matchers/equivalent_uri.rb,
lib/mocha/parameter_matchers/regexp_matches.rb,
lib/mocha/parameter_matchers/yaml_equivalent.rb,
lib/mocha/state_machine.rb,
lib/mocha/sequence.rb,
lib/mocha/configuration.rb,
lib/mocha/expectation_error_factory.rb,
lib/mocha/expectation_error.rb,
lib/mocha/stubbing_error.rb,
lib/mocha/unexpected_invocation.rb,
lib/mocha/integration/test_unit/adapter.rb,
lib/mocha/integration/mini_test/adapter.rb
+ lib/mocha/hooks.rb,
lib/mocha/mock.rb,
lib/mocha/expectation.rb,
lib/mocha/object_methods.rb,
lib/mocha/class_methods.rb,
lib/mocha/parameter_matchers.rb,
lib/mocha/parameter_matchers/not.rb,
lib/mocha/parameter_matchers/base.rb,
lib/mocha/parameter_matchers/is_a.rb,
lib/mocha/parameter_matchers/all_of.rb,
lib/mocha/parameter_matchers/any_of.rb,
lib/mocha/parameter_matchers/equals.rb,
lib/mocha/parameter_matchers/has_key.rb,
lib/mocha/parameter_matchers/kind_of.rb,
lib/mocha/parameter_matchers/anything.rb,
lib/mocha/parameter_matchers/includes.rb,
lib/mocha/parameter_matchers/has_entry.rb,
lib/mocha/parameter_matchers/has_value.rb,
lib/mocha/parameter_matchers/optionally.rb,
lib/mocha/parameter_matchers/has_entries.rb,
lib/mocha/parameter_matchers/instance_of.rb,
lib/mocha/parameter_matchers/responds_with.rb,
lib/mocha/parameter_matchers/any_parameters.rb,
lib/mocha/parameter_matchers/equivalent_uri.rb,
lib/mocha/parameter_matchers/regexp_matches.rb,
lib/mocha/parameter_matchers/yaml_equivalent.rb,
lib/mocha/parameter_matchers/instance_methods.rb,
lib/mocha/state_machine.rb,
lib/mocha/sequence.rb,
lib/mocha/configuration.rb,
lib/mocha/expectation_error_factory.rb,
lib/mocha/expectation_error.rb,
lib/mocha/stubbing_error.rb,
lib/mocha/integration/test_unit/adapter.rb,
lib/mocha/integration/mini_test/adapter.rb
@@ -93,7 +93,7 @@

Defined Under Namespace

- Classes: Configuration, Expectation, ExpectationError, ExpectationErrorFactory, Mock, Sequence, StateMachine, StubbingError, UnexpectedInvocation + Classes: Configuration, Expectation, ExpectationError, ExpectationErrorFactory, Mock, Sequence, StateMachine, StubbingError

@@ -104,7 +104,134 @@

Defined Under Namespace

+ +

+ Class Method Summary + collapse +

+ + + + + + +
+

Class Method Details

+ + +
+

+ + .configure {|configuration| ... } ⇒ Object + + + + + +

+
+ +

Allows setting of configuration options. See Configuration for the available options.

+ +

Typically the configuration is set globally in a test_helper.rb or spec_helper.rb file.

+ + +
+
+
+ +
+

Examples:

+ + +

+

Setting multiple configuration options

+

+ +
Mocha.configure do |c|
+  c.stubbing_method_unnecessarily = :prevent
+  c.stubbing_method_on_non_mock_object = :warn
+  c.stubbing_method_on_nil = :allow
+end
+ +
+ +

Yield Parameters:

+
    + +
  • + + configuration + + + (Configuration) + + + + — +
    +

    the configuration for modification

    +
    + +
  • + +
+ +

See Also:

+ + +
+ + + + +
+
+
+
+17
+18
+19
+
+
# File 'lib/mocha/configuration.rb', line 17
+
+def self.configure
+  yield configuration
+end
+
+
+ +
@@ -155,9 +154,9 @@

Methods included from - Generated on Mon Jun 17 18:38:43 2019 by + Generated on Sun Nov 24 15:26:49 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5). diff --git a/docs/Mocha/Integration/TestUnit.html b/docs/Mocha/Integration/TestUnit.html index 3b69b23b9..8b8ef7c29 100644 --- a/docs/Mocha/Integration/TestUnit.html +++ b/docs/Mocha/Integration/TestUnit.html @@ -6,7 +6,7 @@ Module: Mocha::Integration::TestUnit - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -113,9 +113,9 @@

Defined Under Namespace

diff --git a/docs/Mocha/Integration/TestUnit/Adapter.html b/docs/Mocha/Integration/TestUnit/Adapter.html index 5fc16576e..4e22e66b9 100644 --- a/docs/Mocha/Integration/TestUnit/Adapter.html +++ b/docs/Mocha/Integration/TestUnit/Adapter.html @@ -6,7 +6,7 @@ Module: Mocha::Integration::TestUnit::Adapter - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -93,8 +93,7 @@

Overview

Integrates Mocha into recent versions of Test::Unit.

-

See the source code for an example of how to integrate Mocha into a test -library.

+

See the source code for an example of how to integrate Mocha into a test library.

@@ -141,7 +140,7 @@

Methods included from Methods included from ParameterMatchers

-

#Not, #all_of, #any_of, #any_parameters, #anything, #equals, #equivalent_uri, #has_entries, #has_entry, #has_equivalent_query_string, #has_key, #has_value, #includes, #instance_of, #is_a, #kind_of, #optionally, #regexp_matches, #responds_with, #yaml_equivalent

+

#Not, #all_of, #any_of, #any_parameters, #anything, #equals, #equivalent_uri, #has_entries, #has_entry, #has_key, #has_value, #includes, #instance_of, #is_a, #kind_of, #optionally, #regexp_matches, #responds_with, #yaml_equivalent

@@ -155,9 +154,9 @@

Methods included from - Generated on Mon Jun 17 18:38:43 2019 by + Generated on Sun Nov 24 15:26:49 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5). diff --git a/docs/Mocha/Mock.html b/docs/Mocha/Mock.html index d4a9101cb..86749b9d1 100644 --- a/docs/Mocha/Mock.html +++ b/docs/Mocha/Mock.html @@ -6,7 +6,7 @@ Class: Mocha::Mock - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -104,56 +104,33 @@

Overview

Traditional mock object.

-

All methods return an Expectation which can be further modified by -methods on Expectation.

+

#expects and #stubs return an Expectation which can be further modified by methods on Expectation.

-

Stubs and expectations are basically the same thing. A stub is just an -expectation of zero or more invocations. The #stubs method is syntactic -sugar to make the intent of the test more explicit.

+

#responds_like and #responds_like_instance_of both return a Mock, and can therefore, be chained to the original creation methods in API. They force the mock to indicate what it is supposed to be mocking, thus making it a safer verifying mock. They check that the underlying responder will actually respond to the methods being stubbed, throwing a NoMethodError upon invocation otherwise.

-

When a method is invoked on a mock object, the mock object searches through -its expectations from newest to oldest to find one that matches the -invocation. After the invocation, the matching expectation might stop -matching further invocations. For example, an expects(:foo).once -expectation only matches once and will be ignored on future invocations -while an expects(:foo).at_least_once expectation will always be matched -against invocations.

+

Stubs and expectations are basically the same thing. A stub is just an expectation of zero or more invocations. The #stubs method is syntactic sugar to make the intent of the test more explicit.

+ +

When a method is invoked on a mock object, the mock object searches through its expectations from newest to oldest to find one that matches the invocation. After the invocation, the matching expectation might stop matching further invocations. For example, an expects(:foo).once expectation only matches once and will be ignored on future invocations while an expects(:foo).at_least_once expectation will always be matched against invocations.

This scheme allows you to:

  • -

    Set up default stubs in your the setup method of your test -class and override some of those stubs in individual tests.

    +

    Set up default stubs in your the setup method of your test class and override some of those stubs in individual tests.

  • -

    Set up different once expectations for the same method with -different action per invocation. However, it's better to use the -Expectation#returns method with multiple arguments to do this, as -described below.

    +

    Set up different once expectations for the same method with different action per invocation. However, it's better to use the Expectation#returns method with multiple arguments to do this, as described below.

However, there are some possible “gotchas” caused by this scheme:

  • -

    if you create an expectation and then a stub for the same method, the stub -will always override the expectation and the expectation will never be met.

    +

    if you create an expectation and then a stub for the same method, the stub will always override the expectation and the expectation will never be met.

  • -

    if you create a stub and then an expectation for the same method, the -expectation will match, and when it stops matching the stub will be used -instead, possibly masking test failures.

    +

    if you create a stub and then an expectation for the same method, the expectation will match, and when it stops matching the stub will be used instead, possibly masking test failures.

  • -

    if you create different expectations for the same method, they will be -invoked in the opposite order than that in which they were specified, -rather than the same order.

    +

    if you create different expectations for the same method, they will be invoked in the opposite order than that in which they were specified, rather than the same order.

-

The best thing to do is not set up multiple expectations and stubs for the -same method with exactly the same matchers. Instead, use the -Expectation#returns method with multiple arguments to create multiple -actions for a method. You can also chain multiple calls to -Expectation#returns and Expectation#raises (along with syntactic sugar -Expectation#then if desired).

+

The best thing to do is not set up multiple expectations and stubs for the same method with exactly the same matchers. Instead, use the Expectation#returns method with multiple arguments to create multiple actions for a method. You can also chain multiple calls to Expectation#returns and Expectation#raises (along with syntactic sugar Expectation#then if desired).

-

If you want to specify more complex ordering or order invocations across -different mock objects, use the Expectation#in_sequence method to -explicitly define a total or partial ordering of invocations.

+

If you want to specify more complex ordering or order invocations across different mock objects, use the Expectation#in_sequence method to explicitly define a total or partial ordering of invocations.

@@ -208,8 +185,7 @@

-

Adds an expectation that the specified method must be called exactly once -with any parameters.

+

Adds an expectation that the specified method must be called exactly once with any parameters.

@@ -257,8 +233,7 @@

-

Constrains the Mock instance so that it can only expect or stub methods -to which responder responds.

+

Constrains the Mock instance so that it can only expect or stub methods to which responder responds.

@@ -284,8 +259,7 @@

-

Constrains the Mock instance so that it can only expect or stub methods -to which an instance of the responder_class responds.

+

Constrains the Mock instance so that it can only expect or stub methods to which an instance of the responder_class responds.

@@ -311,8 +285,7 @@

-

Adds an expectation that the specified method may be called any number of -times with any parameters.

+

Adds an expectation that the specified method may be called any number of times with any parameters.

@@ -321,7 +294,7 @@

  • - #unstub(method_name) ⇒ Object + #unstub(*method_names) ⇒ Object @@ -336,8 +309,7 @@

    -

    Removes the specified stubbed method (added by calls to #expects or -#stubs) and all expectations associated with it.

    +

    Removes the specified stubbed methods (added by calls to #expects or #stubs) and all expectations associated with them.

  • @@ -365,7 +337,7 @@

    -

    rubocop:disable Style/MethodMissingSuper

    +

    rubocop:disable Style/MethodMissingSuper,Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity

    @@ -379,44 +351,44 @@

     
     
    -294
    -295
    -296
    -297
    -298
    -299
    -300
    -301
    -302
    -303
    -304
    -305
    -306
    -307
    -308
     309
     310
    -311
    +311 +312 +313 +314 +315 +316 +317 +318 +319 +320 +321 +322 +323 +324 +325 +326 -
    # File 'lib/mocha/mock.rb', line 294
    +      
    # File 'lib/mocha/mock.rb', line 309
     
     def method_missing(symbol, *arguments, &block)
       if @responder && !@responder.respond_to?(symbol)
         raise NoMethodError, "undefined method `#{symbol}' for #{mocha_inspect} which responds like #{@responder.mocha_inspect}"
       end
    -  if (matching_expectation_allowing_invocation = all_expectations.match_allowing_invocation(symbol, *arguments))
    -    matching_expectation_allowing_invocation.invoke(&block)
    -  elsif (matching_expectation = all_expectations.match(symbol, *arguments)) || (!matching_expectation && !@everything_stubbed)
    +  invocation = Invocation.new(self, symbol, *arguments)
    +  if (matching_expectation_allowing_invocation = all_expectations.match_allowing_invocation(invocation))
    +    matching_expectation_allowing_invocation.invoke(invocation, &block)
    +  elsif (matching_expectation = all_expectations.match(invocation)) || (!matching_expectation && !@everything_stubbed)
         if @unexpected_invocation.nil?
    -      @unexpected_invocation = UnexpectedInvocation.new(self, symbol, *arguments)
    -      matching_expectation.invoke(&block) if matching_expectation
    -      message = @unexpected_invocation.full_description
    -      message << @mockery.mocha_inspect
    +      @unexpected_invocation = invocation
    +      matching_expectation.invoke(invocation, &block) if matching_expectation
    +      message = "#{@unexpected_invocation.call_description}\n#{@mockery.mocha_inspect}"
         else
    -      message = @unexpected_invocation.short_description
    +      message = @unexpected_invocation.short_call_description
         end
    -    raise ExpectationErrorFactory.build(message, caller)
    +    raise ExpectationErrorFactory.build("unexpected invocation: #{message}", caller)
       end
     end
    @@ -451,8 +423,7 @@

    -

    Adds an expectation that the specified method must be called exactly once -with any parameters.

    +

    Adds an expectation that the specified method must be called exactly once with any parameters.

    @@ -492,8 +463,7 @@

    -

    Setup multiple expectations using -expected_methods_vs_return_values.

    +

    Setup multiple expectations using expected_methods_vs_return_values.

    object = mock()
    @@ -506,7 +476,21 @@ 

    object.expects(:expected_method_two).returns(:result_two)

    -

    Parameters:

    + +

    Overloads:

    +
      + + +
    • + #expects(method_name) ⇒ Expectation +
      +
      + + +
      +
      +
      +

      Parameters:

      • @@ -525,6 +509,25 @@

      • +
      + + +
      +
    • + + +
    • + #expects(expected_methods_vs_return_values) ⇒ Expectation +
      +
      + + +
      +
      +
      +

      Parameters:

      +
        +
      • expected_methods_vs_return_values @@ -536,15 +539,19 @@

        -

        expected method name symbols as keys and corresponding return values as -values - these expectations are setup as if #expects were called multiple -times.

        +

        expected method name symbols as keys and corresponding return values as values - these expectations are setup as if #expects were called multiple times.

      + +
      +
    • + +
    +

    Returns:

      @@ -557,8 +564,7 @@

      -

      last-built expectation which can be further modified by methods on -Expectation.

      +

      last-built expectation which can be further modified by methods on Expectation.

      @@ -571,19 +577,19 @@

       
       
      -105
      -106
      -107
      -108
      -109
      -110
       111
       112
       113
      -114
      +114 +115 +116 +117 +118 +119 +120

    -
    # File 'lib/mocha/mock.rb', line 105
    +      
    # File 'lib/mocha/mock.rb', line 111
     
     def expects(method_name_or_hash, backtrace = nil)
       iterator = ArgumentIterator.new(method_name_or_hash)
    @@ -637,12 +643,12 @@ 

     
     
    -329
    -330
    -331
    +344 +345 +346

    -
    # File 'lib/mocha/mock.rb', line 329
    +      
    # File 'lib/mocha/mock.rb', line 344
     
     def respond_to?(symbol, include_private = false)
       respond_to_missing?(symbol, include_private)
    @@ -668,16 +674,11 @@ 

    -

    Constrains the Mocha::Mock instance so that it can only expect or stub methods -to which responder responds. The constraint is only applied at -method invocation time.

    +

    Constrains the Mocha::Mock instance so that it can only expect or stub methods to which responder responds. The constraint is only applied at method invocation time.

    -

    A NoMethodError will be raised if the responder -does not #respond_to? a method invocation (even if the method -has been expected or stubbed).

    +

    A NoMethodError will be raised if the responder does not #respond_to? a method invocation (even if the method has been expected or stubbed).

    -

    The Mocha::Mock instance will delegate its #respond_to? method to -the responder.

    +

    The Mocha::Mock instance will delegate its #respond_to? method to the responder.

    Note that the methods on responder are never actually invoked.

    @@ -754,8 +755,7 @@

    -

    an object used to determine whether Mocha::Mock instance should -#respond_to? to an invocation.

    +

    an object used to determine whether Mocha::Mock instance should #respond_to? to an invocation.

    @@ -774,8 +774,7 @@

    -

    the same Mocha::Mock instance, thereby allowing invocations of other Mocha::Mock -methods to be chained.

    +

    the same Mocha::Mock instance, thereby allowing invocations of other Mocha::Mock methods to be chained.

    @@ -795,13 +794,13 @@

     
     
    -216
    -217
    -218
    -219
    +232 +233 +234 +235

    -
    # File 'lib/mocha/mock.rb', line 216
    +      
    # File 'lib/mocha/mock.rb', line 232
     
     def responds_like(responder)
       @responder = responder
    @@ -828,17 +827,11 @@ 

    -

    Constrains the Mocha::Mock instance so that it can only expect or stub methods -to which an instance of the responder_class responds. The -constraint is only applied at method invocation time. Note that the -responder instance is instantiated using Class#allocate.

    +

    Constrains the Mocha::Mock instance so that it can only expect or stub methods to which an instance of the responder_class responds. The constraint is only applied at method invocation time. Note that the responder instance is instantiated using Class#allocate.

    -

    A NoMethodError will be raised if the responder instance does -not #respond_to? a method invocation (even if the method has -been expected or stubbed).

    +

    A NoMethodError will be raised if the responder instance does not #respond_to? a method invocation (even if the method has been expected or stubbed).

    -

    The Mocha::Mock instance will delegate its #respond_to? method to -the responder instance.

    +

    The Mocha::Mock instance will delegate its #respond_to? method to the responder instance.

    Note that the methods on the responder instance are never actually invoked.

    @@ -886,8 +879,7 @@

    -

    a class used to determine whether Mocha::Mock instance should -#respond_to? to an invocation.

    +

    a class used to determine whether Mocha::Mock instance should #respond_to? to an invocation.

    @@ -906,8 +898,7 @@

    -

    the same Mocha::Mock instance, thereby allowing invocations of other Mocha::Mock -methods to be chained.

    +

    the same Mocha::Mock instance, thereby allowing invocations of other Mocha::Mock methods to be chained.

    @@ -927,12 +918,12 @@

     
     
    -249
    -250
    -251
    +265 +266 +267

    -
    # File 'lib/mocha/mock.rb', line 249
    +      
    # File 'lib/mocha/mock.rb', line 265
     
     def responds_like_instance_of(responder_class)
       responds_like(responder_class.allocate)
    @@ -962,8 +953,7 @@ 

    -

    Adds an expectation that the specified method may be called any number of -times with any parameters.

    +

    Adds an expectation that the specified method may be called any number of times with any parameters.

    @@ -986,8 +976,7 @@

    -

    Setup multiple expectations using -stubbed_methods_vs_return_values.

    +

    Setup multiple expectations using stubbed_methods_vs_return_values.

    object = mock()
    @@ -1000,7 +989,21 @@ 

    object.stubs(:stubbed_method_two).returns(:result_two)

    -

    Parameters:

    + +

    Overloads:

    +
      + + +
    • + #stubs(method_name) ⇒ Expectation +
      +
      + + +
      +
      +
      +

      Parameters:

      • @@ -1019,6 +1022,25 @@

      • +
      + + +
      +
    • + + +
    • + #stubs(stubbed_methods_vs_return_values) ⇒ Expectation +
      +
      + + +
      +
      +
      +

      Parameters:

      +
        +
      • stubbed_methods_vs_return_values @@ -1030,15 +1052,19 @@

        -

        stubbed method name symbols as keys and corresponding return values as -values - these stubbed methods are setup as if #stubs were called -multiple times.

        +

        stubbed method name symbols as keys and corresponding return values as values - these stubbed methods are setup as if #stubs were called multiple times.

      + +
      +
    • + +
    +

    Returns:

      @@ -1051,8 +1077,7 @@

      -

      last-built expectation which can be further modified by methods on -Expectation.

      +

      last-built expectation which can be further modified by methods on Expectation.

      @@ -1065,20 +1090,20 @@

       
       
      -141
      -142
      -143
      -144
      -145
      -146
       147
       148
       149
       150
      -151
      +151 +152 +153 +154 +155 +156 +157

    -
    # File 'lib/mocha/mock.rb', line 141
    +      
    # File 'lib/mocha/mock.rb', line 147
     
     def stubs(method_name_or_hash, backtrace = nil)
       iterator = ArgumentIterator.new(method_name_or_hash)
    @@ -1099,7 +1124,7 @@ 

    - #unstub(method_name) ⇒ Object + #unstub(*method_names) ⇒ Object @@ -1108,8 +1133,7 @@

    -

    Removes the specified stubbed method (added by calls to #expects or -#stubs) and all expectations associated with it.

    +

    Removes the specified stubbed methods (added by calls to #expects or #stubs) and all expectations associated with them.

    @@ -1130,22 +1154,34 @@

    object.unstub(:stubbed_method) object.stubbed_method # => unexpected invocation: #<Mock:mock>.stubbed_method()

    + +

    +

    Unstubbing multiple methods.

    +

    + +
    multiplier.unstub(:double, :triple)
    +
    +# exactly equivalent to
    +
    +multiplier.unstub(:double)
    +multiplier.unstub(:triple)
    +

    Parameters:

    • - method_name + method_names - (Symbol) + (Array<Symbol>)
      -

      name of method to unstub.

      +

      names of methods to unstub.

    • @@ -1159,15 +1195,19 @@

       
       
      -163
      -164
      -165
      +177 +178 +179 +180 +181 -
      # File 'lib/mocha/mock.rb', line 163
      +      
      # File 'lib/mocha/mock.rb', line 177
       
      -def unstub(method_name)
      -  @expectations.remove_all_matching_method(method_name)
      +def unstub(*method_names)
      +  method_names.each do |method_name|
      +    @expectations.remove_all_matching_method(method_name)
      +  end
       end
      @@ -1187,9 +1227,9 @@

      diff --git a/docs/Mocha/ObjectMethods.html b/docs/Mocha/ObjectMethods.html index f0f64eae4..ad75eff84 100644 --- a/docs/Mocha/ObjectMethods.html +++ b/docs/Mocha/ObjectMethods.html @@ -6,7 +6,7 @@ Module: Mocha::ObjectMethods - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -78,9 +78,7 @@
      Defined in:
      -
      lib/mocha/object_methods.rb,
      - lib/mocha/parameter_matchers/object.rb
      -
      +
      lib/mocha/object_methods.rb
      @@ -88,11 +86,9 @@

      Overview

      -

      Methods added to all objects to allow mocking and stubbing on real (i.e. -non-mock) objects.

      +

      Methods added to all objects to allow mocking and stubbing on real (i.e. non-mock) objects.

      -

      Both #expects and #stubs return an Expectation which can be further -modified by methods on Expectation.

      +

      Both #expects and #stubs return an Expectation which can be further modified by methods on Expectation.

      @@ -133,8 +129,7 @@

      -

      Adds an expectation that the specified method must be called exactly once -with any parameters.

      +

      Adds an expectation that the specified method must be called exactly once with any parameters.

      @@ -158,8 +153,7 @@

      -

      Adds an expectation that the specified method may be called any number of -times with any parameters.

      +

      Adds an expectation that the specified method may be called any number of times with any parameters.

      @@ -183,8 +177,7 @@

      -

      Removes the specified stubbed methods (added by calls to #expects or -#stubs) and all expectations associated with them.

      +

      Removes the specified stubbed methods (added by calls to #expects or #stubs) and all expectations associated with them.

      @@ -215,12 +208,9 @@

      -

      Adds an expectation that the specified method must be called exactly once -with any parameters.

      +

      Adds an expectation that the specified method must be called exactly once with any parameters.

      -

      The original implementation of the method is replaced during the test and -then restored at the end of the test. The temporary replacement method has -the same visibility as the original method.

      +

      The original implementation of the method is replaced during the test and then restored at the end of the test. The temporary replacement method has the same visibility as the original method.

      @@ -254,7 +244,21 @@

      product.expects(:save).returns(true)

      -

      Parameters:

      + +

      Overloads:

      +
        + + +
      • + #expects(method_name) ⇒ Expectation +
        +
        + + +
        +
        +
        +

        Parameters:

        • @@ -273,6 +277,25 @@

        • +
        + + +
        +
      • + + +
      • + #expects(expected_methods_vs_return_values) ⇒ Expectation +
        +
        + + +
        +
        +
        +

        Parameters:

        +
          +
        • expected_methods_vs_return_values @@ -284,15 +307,19 @@

          -

          expected method name symbols as keys and corresponding return values as -values - these expectations are setup as if #expects were called multiple -times.

          +

          expected method name symbols as keys and corresponding return values as values - these expectations are setup as if #expects were called multiple times.

        + +
        +
      • + +
      +

      Returns:

        @@ -305,8 +332,7 @@

        -

        last-built expectation which can be further modified by methods on -Expectation.

        +

        last-built expectation which can be further modified by methods on Expectation.

        @@ -344,11 +370,6 @@

         
         
        -66
        -67
        -68
        -69
        -70
         71
         72
         73
        @@ -363,10 +384,15 @@ 

        82 83 84 -85

        +85 +86 +87 +88 +89 +90 -
        # File 'lib/mocha/object_methods.rb', line 66
        +      
        # File 'lib/mocha/object_methods.rb', line 71
         
         def expects(expected_methods_vs_return_values)
           if expected_methods_vs_return_values.to_s =~ /the[^a-z]*spanish[^a-z]*inquisition/i
        @@ -409,12 +435,9 @@ 

        -

        Adds an expectation that the specified method may be called any number of -times with any parameters.

        +

        Adds an expectation that the specified method may be called any number of times with any parameters.

        -

        The original implementation of the method is replaced during the test and -then restored at the end of the test. The temporary replacement method has -the same visibility as the original method.

        +

        The original implementation of the method is replaced during the test and then restored at the end of the test. The temporary replacement method has the same visibility as the original method.

        @@ -448,7 +471,21 @@

        product.stubs(:save).returns(true)

        -

        Parameters:

        + +

        Overloads:

        +
          + + +
        • + #stubs(method_name) ⇒ Expectation +
          +
          + + +
          +
          +
          +

          Parameters:

          • @@ -467,6 +504,25 @@

          • +
          + + +
          +
        • + + +
        • + #stubs(stubbed_methods_vs_return_values) ⇒ Expectation +
          +
          + + +
          +
          +
          +

          Parameters:

          +
            +
          • stubbed_methods_vs_return_values @@ -478,15 +534,19 @@

            -

            stubbed method name symbols as keys and corresponding return values as -values - these stubbed methods are setup as if #stubs were called -multiple times.

            +

            stubbed method name symbols as keys and corresponding return values as values - these stubbed methods are setup as if #stubs were called multiple times.

          + +
          +
        • + +
        +

        Returns:

          @@ -499,8 +559,7 @@

          -

          last-built expectation which can be further modified by methods on -Expectation.

          +

          last-built expectation which can be further modified by methods on Expectation.

          @@ -538,11 +597,6 @@

           
           
          -115
          -116
          -117
          -118
          -119
           120
           121
           122
          @@ -554,10 +608,15 @@ 

          128 129 130 -131

          +131 +132 +133 +134 +135 +136

        -
        # File 'lib/mocha/object_methods.rb', line 115
        +      
        # File 'lib/mocha/object_methods.rb', line 120
         
         def stubs(stubbed_methods_vs_return_values)
           if frozen?
        @@ -593,17 +652,11 @@ 

        -

        Removes the specified stubbed methods (added by calls to #expects or -#stubs) and all expectations associated with them.

        +

        Removes the specified stubbed methods (added by calls to #expects or #stubs) and all expectations associated with them.

        -

        Restores the original behaviour of the methods before they were stubbed. -This is normally done automatically at the end of each test, but in some -circumstances you may want to do it before the end of the -test.

        +

        Restores the original behaviour of the methods before they were stubbed. This is normally done automatically at the end of each test, but in some circumstances you may want to do it before the end of the test.

        -

        WARNING: If you #unstub a method which still has unsatisfied -expectations, you may be removing the only way those expectations can be -satisfied. Use #unstub with care.

        +

        WARNING: If you #unstub a method which still has unsatisfied expectations, you may be removing the only way those expectations can be satisfied. Use #unstub with care.

        @@ -666,16 +719,16 @@

         
         
        -156
        -157
        -158
        -159
        -160
         161
        -162
        +162 +163 +164 +165 +166 +167

        -
        # File 'lib/mocha/object_methods.rb', line 156
        +      
        # File 'lib/mocha/object_methods.rb', line 161
         
         def unstub(*method_names)
           mockery = Mocha::Mockery.instance
        @@ -702,9 +755,9 @@ 

        diff --git a/docs/Mocha/ParameterMatchers.html b/docs/Mocha/ParameterMatchers.html index ed3fc04f9..da0be75df 100644 --- a/docs/Mocha/ParameterMatchers.html +++ b/docs/Mocha/ParameterMatchers.html @@ -6,7 +6,7 @@ Module: Mocha::ParameterMatchers - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -84,7 +84,7 @@
        Defined in:
        lib/mocha/parameter_matchers.rb,
        - lib/mocha/parameter_matchers/not.rb,
        lib/mocha/parameter_matchers/base.rb,
        lib/mocha/parameter_matchers/is_a.rb,
        lib/mocha/parameter_matchers/all_of.rb,
        lib/mocha/parameter_matchers/any_of.rb,
        lib/mocha/parameter_matchers/equals.rb,
        lib/mocha/parameter_matchers/has_key.rb,
        lib/mocha/parameter_matchers/kind_of.rb,
        lib/mocha/parameter_matchers/anything.rb,
        lib/mocha/parameter_matchers/includes.rb,
        lib/mocha/parameter_matchers/has_entry.rb,
        lib/mocha/parameter_matchers/has_value.rb,
        lib/mocha/parameter_matchers/optionally.rb,
        lib/mocha/parameter_matchers/has_entries.rb,
        lib/mocha/parameter_matchers/instance_of.rb,
        lib/mocha/parameter_matchers/responds_with.rb,
        lib/mocha/parameter_matchers/any_parameters.rb,
        lib/mocha/parameter_matchers/equivalent_uri.rb,
        lib/mocha/parameter_matchers/regexp_matches.rb,
        lib/mocha/parameter_matchers/yaml_equivalent.rb
        + lib/mocha/parameter_matchers/not.rb,
        lib/mocha/parameter_matchers/base.rb,
        lib/mocha/parameter_matchers/is_a.rb,
        lib/mocha/parameter_matchers/all_of.rb,
        lib/mocha/parameter_matchers/any_of.rb,
        lib/mocha/parameter_matchers/equals.rb,
        lib/mocha/parameter_matchers/has_key.rb,
        lib/mocha/parameter_matchers/kind_of.rb,
        lib/mocha/parameter_matchers/anything.rb,
        lib/mocha/parameter_matchers/includes.rb,
        lib/mocha/parameter_matchers/has_entry.rb,
        lib/mocha/parameter_matchers/has_value.rb,
        lib/mocha/parameter_matchers/optionally.rb,
        lib/mocha/parameter_matchers/has_entries.rb,
        lib/mocha/parameter_matchers/instance_of.rb,
        lib/mocha/parameter_matchers/responds_with.rb,
        lib/mocha/parameter_matchers/any_parameters.rb,
        lib/mocha/parameter_matchers/equivalent_uri.rb,
        lib/mocha/parameter_matchers/regexp_matches.rb,
        lib/mocha/parameter_matchers/yaml_equivalent.rb,
        lib/mocha/parameter_matchers/instance_methods.rb
        @@ -93,8 +93,7 @@

        Overview

        -

        Used as parameters for Expectation#with to restrict the parameter values -which will match the expectation. Can be nested.

        +

        Used as parameters for Expectation#with to restrict the parameter values which will match the expectation. Can be nested.

        @@ -265,8 +264,7 @@

        -

        Matches a URI without regard to the ordering of parameters in the query -string.

        +

        Matches a URI without regard to the ordering of parameters in the query string.

        @@ -314,32 +312,7 @@

        -

        Matches Hash containing entry with key and -value.

        -
        - - - - -
      • - - - #has_equivalent_query_string(uri) ⇒ Object - - - - - - - - - - deprecated - - - - Deprecated.
        -

        Use #equivalent_uri instead.

        +

        Matches Hash containing entry with key and value.

      • @@ -411,8 +384,7 @@

        -

        Matches any object that responds with true to include?(item) -for all items.

        +

        Matches any object that responds with true to include?(item) for all items.

        @@ -580,8 +552,7 @@

        -

        Matches any object that responds to message with -result.

        +

        Matches any object that responds to message with result.

        @@ -668,7 +639,7 @@

      • - parameter_matchers + matchers (*Array<Base>) @@ -789,7 +760,7 @@

      • - parameter_matchers + matchers (*Array<Base>) @@ -864,8 +835,7 @@

        -

        Matches any parameters. This is used as the default for a newly built -expectation.

        +

        Matches any parameters. This is used as the default for a newly built expectation.

        @@ -1147,8 +1117,7 @@

        -

        Matches a URI without regard to the ordering of parameters in the query -string.

        +

        Matches a URI without regard to the ordering of parameters in the query string.

        @@ -1376,8 +1345,7 @@

        -

        Matches Hash containing entry with key and -value.

        +

        Matches Hash containing entry with key and value.

        rubocop:disable Naming/PredicateName

        @@ -1401,8 +1369,7 @@

        -

        Actual parameter contains expected entry supplied as Hash -entry.

        +

        Actual parameter contains expected entry supplied as Hash entry.

        object = mock()
        @@ -1422,8 +1389,7 @@ 

        -

        Actual parameter does not contain expected entry supplied as -Hash entry.

        +

        Actual parameter does not contain expected entry supplied as Hash entry.

        
        @@ -1628,54 +1594,6 @@ 

        -

        - -
        -

        - - #has_equivalent_query_string(uri) ⇒ Object - - - - - -

        -
        -
        Deprecated.
        -

        Use #equivalent_uri instead.

        -
        - -

        rubocop:disable Naming/PredicateName

        - - -
        -
        -
        - - -
        - - - - -
        -
        -
        -
        -32
        -33
        -34
        -35
        -36
        -
        -
        # File 'lib/mocha/parameter_matchers/equivalent_uri.rb', line 32
        -
        -def has_equivalent_query_string(uri)
        -  Mocha::Deprecation.warning('`has_equivalent_query_string` is deprecated. Please use `equivalent_uri` instead.')
        -
        -  equivalent_uri(uri)
        -end
        -
        @@ -1916,8 +1834,7 @@

        -

        Matches any object that responds with true to include?(item) -for all items.

        +

        Matches any object that responds with true to include?(item) for all items.

        @@ -2564,8 +2481,7 @@

        -

        Only the two required parameters are supplied and they both match their -expected value.

        +

        Only the two required parameters are supplied and they both match their expected value.

        object = mock()
        @@ -2575,8 +2491,7 @@ 

        -

        Both required parameters and one of the optional parameters are supplied -and they all match their expected value.

        +

        Both required parameters and one of the optional parameters are supplied and they all match their expected value.

        object = mock()
        @@ -2586,8 +2501,7 @@ 

        -

        Both required parameters and both of the optional parameters are supplied -and they all match their expected value.

        +

        Both required parameters and both of the optional parameters are supplied and they all match their expected value.

        object = mock()
        @@ -2798,9 +2712,7 @@ 

        -

        Matches any object that responds to message with -result. To put it another way, it tests the quack, not the -duck.

        +

        Matches any object that responds to message with result. To put it another way, it tests the quack, not the duck.

        @@ -3039,9 +2951,9 @@

        diff --git a/docs/Mocha/ParameterMatchers/AllOf.html b/docs/Mocha/ParameterMatchers/AllOf.html index ec97ae042..f51711e19 100644 --- a/docs/Mocha/ParameterMatchers/AllOf.html +++ b/docs/Mocha/ParameterMatchers/AllOf.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::AllOf - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -104,8 +104,7 @@

        Overview

        -

        Parameter matcher which combines a number of other matchers using a logical -AND.

        +

        Parameter matcher which combines a number of other matchers using a logical AND.

        @@ -144,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5).

        diff --git a/docs/Mocha/ParameterMatchers/AnyOf.html b/docs/Mocha/ParameterMatchers/AnyOf.html index b38f174cc..7356025b3 100644 --- a/docs/Mocha/ParameterMatchers/AnyOf.html +++ b/docs/Mocha/ParameterMatchers/AnyOf.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::AnyOf - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -104,8 +104,7 @@

        Overview

        -

        Parameter matcher which combines a number of other matchers using a logical -OR.

        +

        Parameter matcher which combines a number of other matchers using a logical OR.

        @@ -144,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5).

        diff --git a/docs/Mocha/ParameterMatchers/AnyParameters.html b/docs/Mocha/ParameterMatchers/AnyParameters.html index fe7c04a82..73badc89b 100644 --- a/docs/Mocha/ParameterMatchers/AnyParameters.html +++ b/docs/Mocha/ParameterMatchers/AnyParameters.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::AnyParameters - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -143,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5).

        diff --git a/docs/Mocha/ParameterMatchers/Anything.html b/docs/Mocha/ParameterMatchers/Anything.html index 82670539f..e0f1784ae 100644 --- a/docs/Mocha/ParameterMatchers/Anything.html +++ b/docs/Mocha/ParameterMatchers/Anything.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::Anything - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -143,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5).

      • diff --git a/docs/Mocha/ParameterMatchers/Base.html b/docs/Mocha/ParameterMatchers/Base.html index ce8e7eb93..18a0cc8cf 100644 --- a/docs/Mocha/ParameterMatchers/Base.html +++ b/docs/Mocha/ParameterMatchers/Base.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::Base - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -104,10 +104,7 @@

        Overview

        This class is abstract.
        -

        Subclass and implement #matches? and -#mocha_inspect to define a custom matcher. Also add a suitably -named instance method to Mocha::ParameterMatchers to build an instance of the -new matcher c.f. #equals.

        +

        Subclass and implement #matches? and #mocha_inspect to define a custom matcher. Also add a suitably named instance method to Mocha::ParameterMatchers to build an instance of the new matcher c.f. #equals.

        @@ -207,11 +204,9 @@

        A shorthand way of combining two matchers when both must match.

        -

        Returns a new AllOf parameter matcher combining two matchers using a -logical AND.

        +

        Returns a new AllOf parameter matcher combining two matchers using a logical AND.

        -

        This shorthand will not work with an implicit equals match. Instead, an -explicit Equals matcher should be used.

        +

        This shorthand will not work with an implicit equals match. Instead, an explicit Equals matcher should be used.

        @@ -318,11 +313,9 @@

        A shorthand way of combining two matchers when at least one must match.

        -

        Returns a new AnyOf parameter matcher combining two matchers -using a logical OR.

        +

        Returns a new AnyOf parameter matcher combining two matchers using a logical OR.

        -

        This shorthand will not work with an implicit equals match. Instead, an -explicit Equals matcher should be used.

        +

        This shorthand will not work with an implicit equals match. Instead, an explicit Equals matcher should be used.

        @@ -438,9 +431,9 @@

        diff --git a/docs/Mocha/ParameterMatchers/Equals.html b/docs/Mocha/ParameterMatchers/Equals.html index 617cfbb20..c71c21d7d 100644 --- a/docs/Mocha/ParameterMatchers/Equals.html +++ b/docs/Mocha/ParameterMatchers/Equals.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::Equals - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -104,8 +104,7 @@

        Overview

        -

        Parameter matcher which matches when actual parameter equals expected -value.

        +

        Parameter matcher which matches when actual parameter equals expected value.

        @@ -144,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5).

        diff --git a/docs/Mocha/ParameterMatchers/EquivalentUri.html b/docs/Mocha/ParameterMatchers/EquivalentUri.html index bd1f8959a..1d4691515 100644 --- a/docs/Mocha/ParameterMatchers/EquivalentUri.html +++ b/docs/Mocha/ParameterMatchers/EquivalentUri.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::EquivalentUri - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -143,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5). diff --git a/docs/Mocha/ParameterMatchers/HasEntries.html b/docs/Mocha/ParameterMatchers/HasEntries.html index ed7acadda..45ba233f0 100644 --- a/docs/Mocha/ParameterMatchers/HasEntries.html +++ b/docs/Mocha/ParameterMatchers/HasEntries.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::HasEntries - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -104,8 +104,7 @@

        Overview

        -

        Parameter matcher which matches when actual parameter contains all expected -Hash entries.

        +

        Parameter matcher which matches when actual parameter contains all expected Hash entries.

        @@ -144,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5).

        diff --git a/docs/Mocha/ParameterMatchers/HasEntry.html b/docs/Mocha/ParameterMatchers/HasEntry.html index 49577f19b..805439cfc 100644 --- a/docs/Mocha/ParameterMatchers/HasEntry.html +++ b/docs/Mocha/ParameterMatchers/HasEntry.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::HasEntry - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -104,8 +104,7 @@

        Overview

        -

        Parameter matcher which matches when actual parameter contains expected -Hash entry.

        +

        Parameter matcher which matches when actual parameter contains expected Hash entry.

        @@ -144,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5).

        diff --git a/docs/Mocha/ParameterMatchers/HasKey.html b/docs/Mocha/ParameterMatchers/HasKey.html index 4e6649d00..54da34165 100644 --- a/docs/Mocha/ParameterMatchers/HasKey.html +++ b/docs/Mocha/ParameterMatchers/HasKey.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::HasKey - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -104,8 +104,7 @@

        Overview

        -

        Parameter matcher which matches when actual parameter contains -Hash entry with expected key.

        +

        Parameter matcher which matches when actual parameter contains Hash entry with expected key.

        @@ -144,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5).

        diff --git a/docs/Mocha/ParameterMatchers/HasValue.html b/docs/Mocha/ParameterMatchers/HasValue.html index c43e7d23c..6177aef63 100644 --- a/docs/Mocha/ParameterMatchers/HasValue.html +++ b/docs/Mocha/ParameterMatchers/HasValue.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::HasValue - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -104,8 +104,7 @@

        Overview

        -

        Parameter matcher which matches when actual parameter contains -Hash entry with expected value.

        +

        Parameter matcher which matches when actual parameter contains Hash entry with expected value.

        @@ -144,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5).

        diff --git a/docs/Mocha/ParameterMatchers/Includes.html b/docs/Mocha/ParameterMatchers/Includes.html index a1bd19794..85b37c980 100644 --- a/docs/Mocha/ParameterMatchers/Includes.html +++ b/docs/Mocha/ParameterMatchers/Includes.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::Includes - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -104,8 +104,7 @@

        Overview

        -

        Parameter matcher which matches when actual parameter includes expected -values.

        +

        Parameter matcher which matches when actual parameter includes expected values.

        @@ -144,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5).

        diff --git a/docs/Mocha/ParameterMatchers/InstanceOf.html b/docs/Mocha/ParameterMatchers/InstanceOf.html index fb01249b7..42378e08f 100644 --- a/docs/Mocha/ParameterMatchers/InstanceOf.html +++ b/docs/Mocha/ParameterMatchers/InstanceOf.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::InstanceOf - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -104,8 +104,7 @@

        Overview

        -

        Parameter matcher which matches when actual parameter is an instance of the -specified class.

        +

        Parameter matcher which matches when actual parameter is an instance of the specified class.

        @@ -144,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5).

        diff --git a/docs/Mocha/ParameterMatchers/IsA.html b/docs/Mocha/ParameterMatchers/IsA.html index bdeee24a4..7f13b9739 100644 --- a/docs/Mocha/ParameterMatchers/IsA.html +++ b/docs/Mocha/ParameterMatchers/IsA.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::IsA - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -143,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5). diff --git a/docs/Mocha/ParameterMatchers/KindOf.html b/docs/Mocha/ParameterMatchers/KindOf.html index 2aa5f890a..63fffbee4 100644 --- a/docs/Mocha/ParameterMatchers/KindOf.html +++ b/docs/Mocha/ParameterMatchers/KindOf.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::KindOf - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -104,8 +104,7 @@

        Overview

        -

        Parameter matcher which matches when actual parameter is a kind of -specified class.

        +

        Parameter matcher which matches when actual parameter is a kind of specified class.

        @@ -144,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5).

        diff --git a/docs/Mocha/ParameterMatchers/Not.html b/docs/Mocha/ParameterMatchers/Not.html index 7f56a73a1..bc7015d95 100644 --- a/docs/Mocha/ParameterMatchers/Not.html +++ b/docs/Mocha/ParameterMatchers/Not.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::Not - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -104,8 +104,7 @@

        Overview

        -

        Parameter matcher which inverts the logic of the specified matcher using a -logical NOT operation.

        +

        Parameter matcher which inverts the logic of the specified matcher using a logical NOT operation.

        @@ -144,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5).

        diff --git a/docs/Mocha/ParameterMatchers/Optionally.html b/docs/Mocha/ParameterMatchers/Optionally.html index 3223c5c8f..fe99c6aa8 100644 --- a/docs/Mocha/ParameterMatchers/Optionally.html +++ b/docs/Mocha/ParameterMatchers/Optionally.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::Optionally - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -143,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5). diff --git a/docs/Mocha/ParameterMatchers/RegexpMatches.html b/docs/Mocha/ParameterMatchers/RegexpMatches.html index 127628673..7f3fcfb16 100644 --- a/docs/Mocha/ParameterMatchers/RegexpMatches.html +++ b/docs/Mocha/ParameterMatchers/RegexpMatches.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::RegexpMatches - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -104,8 +104,7 @@

        Overview

        -

        Parameter matcher which matches if specified regular expression matches -actual paramter.

        +

        Parameter matcher which matches if specified regular expression matches actual paramter.

        @@ -144,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5).

        diff --git a/docs/Mocha/ParameterMatchers/RespondsWith.html b/docs/Mocha/ParameterMatchers/RespondsWith.html index e371ebed8..120d8c8b0 100644 --- a/docs/Mocha/ParameterMatchers/RespondsWith.html +++ b/docs/Mocha/ParameterMatchers/RespondsWith.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::RespondsWith - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -104,8 +104,7 @@

        Overview

        -

        Parameter matcher which matches if actual parameter returns expected result -when specified method is invoked.

        +

        Parameter matcher which matches if actual parameter returns expected result when specified method is invoked.

        @@ -144,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5).

        diff --git a/docs/Mocha/ParameterMatchers/YamlEquivalent.html b/docs/Mocha/ParameterMatchers/YamlEquivalent.html index f8d0a5ad4..360ab2adb 100644 --- a/docs/Mocha/ParameterMatchers/YamlEquivalent.html +++ b/docs/Mocha/ParameterMatchers/YamlEquivalent.html @@ -6,7 +6,7 @@ Class: Mocha::ParameterMatchers::YamlEquivalent - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -104,8 +104,7 @@

        Overview

        -

        Parameter matcher which matches if actual parameter is YAML equivalent of -specified object.

        +

        Parameter matcher which matches if actual parameter is YAML equivalent of specified object.

        @@ -144,9 +143,9 @@

        Methods inherited from - Generated on Mon Jun 17 18:38:44 2019 by + Generated on Sun Nov 24 15:26:50 2019 by yard - 0.9.19 (ruby-2.5.3). + 0.9.20 (ruby-2.6.5).

        diff --git a/docs/Mocha/Sequence.html b/docs/Mocha/Sequence.html index f71ece075..b2dbcb5e5 100644 --- a/docs/Mocha/Sequence.html +++ b/docs/Mocha/Sequence.html @@ -6,7 +6,7 @@ Class: Mocha::Sequence - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -139,9 +139,9 @@

        Overview

        diff --git a/docs/Mocha/StateMachine.html b/docs/Mocha/StateMachine.html index c467a47d1..429535099 100644 --- a/docs/Mocha/StateMachine.html +++ b/docs/Mocha/StateMachine.html @@ -6,7 +6,7 @@ Class: Mocha::StateMachine - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -102,9 +102,7 @@

        Overview

        -

        A state machine that is used to constrain the order of invocations. An -invocation can be constrained to occur when a state #is, or #is_not, -active.

        +

        A state machine that is used to constrain the order of invocations. An invocation can be constrained to occur when a state #is, or #is_not, active.

        @@ -179,8 +177,7 @@

        -

        Provides a mechanism to change the StateMachine into the state specified -by state_name at some point in the future.

        +

        Provides a mechanism to change the StateMachine into the state specified by state_name at some point in the future.

        @@ -204,8 +201,7 @@

        -

        Provides a mechanism to determine whether the StateMachine is not in the -state specified by state_name at some point in the future.

        +

        Provides a mechanism to determine whether the StateMachine is not in the state specified by state_name at some point in the future.

        @@ -229,8 +225,7 @@

        -

        Put the StateMachine into the state specified by -initial_state_name.

        +

        Put the StateMachine into the state specified by initial_state_name.

        @@ -318,11 +313,9 @@

        -

        Provides a mechanism to change the Mocha::StateMachine into the state specified -by state_name at some point in the future.

        +

        Provides a mechanism to change the Mocha::StateMachine into the state specified by state_name at some point in the future.

        -

        Or provides a mechanism to determine whether the Mocha::StateMachine is in the -state specified by state_name at some point in the future.

        +

        Or provides a mechanism to determine whether the Mocha::StateMachine is in the state specified by state_name at some point in the future.

        @@ -361,8 +354,7 @@

        -

        state which, when activated, will change the Mocha::StateMachine into the state -with the specified state_name.

        +

        state which, when activated, will change the Mocha::StateMachine into the state with the specified state_name.

        @@ -402,9 +394,7 @@

        -

        Provides a mechanism to determine whether the Mocha::StateMachine is not in the -state specified by state_name at some point in the future. -rubocop:disable Naming/PredicateName

        +

        Provides a mechanism to determine whether the Mocha::StateMachine is not in the state specified by state_name at some point in the future. rubocop:disable Naming/PredicateName

        @@ -445,8 +435,7 @@

        -

        Put the Mocha::StateMachine into the state specified by -initial_state_name.

        +

        Put the Mocha::StateMachine into the state specified by initial_state_name.

        @@ -485,8 +474,7 @@

        -

        state machine, thereby allowing invocations of other Mocha::StateMachine methods -to be chained.

        +

        state machine, thereby allowing invocations of other Mocha::StateMachine methods to be chained.

        @@ -529,9 +517,9 @@

        diff --git a/docs/Mocha/StateMachine/State.html b/docs/Mocha/StateMachine/State.html index 9263a16ec..ec499078e 100644 --- a/docs/Mocha/StateMachine/State.html +++ b/docs/Mocha/StateMachine/State.html @@ -6,7 +6,7 @@ Class: Mocha::StateMachine::State - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -102,8 +102,7 @@

        Overview

        -

        Provides a mechanism to change the state of a Mocha::StateMachine at some point -in the future.

        +

        Provides a mechanism to change the state of a Mocha::StateMachine at some point in the future.

        @@ -131,9 +130,9 @@

        Overview

        diff --git a/docs/Mocha/StateMachine/StatePredicate.html b/docs/Mocha/StateMachine/StatePredicate.html index 3c0bbcce2..23fa2d8f4 100644 --- a/docs/Mocha/StateMachine/StatePredicate.html +++ b/docs/Mocha/StateMachine/StatePredicate.html @@ -6,7 +6,7 @@ Class: Mocha::StateMachine::StatePredicate - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -102,8 +102,7 @@

        Overview

        -

        Provides the ability to determine whether a Mocha::StateMachine is in a -specified state at some point in the future.

        +

        Provides the ability to determine whether a Mocha::StateMachine is in a specified state at some point in the future.

        @@ -131,9 +130,9 @@

        Overview

        diff --git a/docs/Mocha/StubbingError.html b/docs/Mocha/StubbingError.html index 51d429b81..fca92ba15 100644 --- a/docs/Mocha/StubbingError.html +++ b/docs/Mocha/StubbingError.html @@ -6,7 +6,7 @@ Class: Mocha::StubbingError - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -140,9 +140,9 @@

        Overview

        diff --git a/docs/Mocha/UnexpectedInvocation.html b/docs/Mocha/UnexpectedInvocation.html deleted file mode 100644 index 73f1d7882..000000000 --- a/docs/Mocha/UnexpectedInvocation.html +++ /dev/null @@ -1,140 +0,0 @@ - - - - - - - Class: Mocha::UnexpectedInvocation - - — Mocha 1.9.0 - - - - - - - - - - - - - - - - - - - -
        - - -

        Class: Mocha::UnexpectedInvocation - - - -

        -
        - -
        -
        Inherits:
        -
        - Object - -
          -
        • Object
        • - - - -
        - show all - -
        -
        - - - - - - - - - - - -
        -
        Defined in:
        -
        lib/mocha/unexpected_invocation.rb
        -
        - -
        - -

        Overview

        -
        - -

        Exception raised when an unexpected method is invoked

        - - -
        -
        -
        - - -
        - - - - - - - - - - -
        - - - -
        - - \ No newline at end of file diff --git a/docs/_index.html b/docs/_index.html index 83b470852..494d84a85 100644 --- a/docs/_index.html +++ b/docs/_index.html @@ -4,7 +4,7 @@ - Mocha 1.9.0 + Mocha 1.10.0.alpha @@ -52,7 +52,7 @@
        -

        Mocha 1.9.0

        +

        Mocha 1.10.0.alpha

        Alphabetic Index

        @@ -478,24 +478,6 @@

        Namespace Listing A-Z

      - - - - - -
      • Y
        • @@ -527,9 +509,9 @@

          Namespace Listing A-Z

          diff --git a/docs/class_list.html b/docs/class_list.html index 146d23589..1f1ee6702 100644 --- a/docs/class_list.html +++ b/docs/class_list.html @@ -43,7 +43,7 @@

          Class List

          diff --git a/docs/file.COPYING.html b/docs/file.COPYING.html index 664f74655..cd6df2b99 100644 --- a/docs/file.COPYING.html +++ b/docs/file.COPYING.html @@ -6,7 +6,7 @@ File: COPYING - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -71,9 +71,9 @@ diff --git a/docs/file.MIT-LICENSE.html b/docs/file.MIT-LICENSE.html index 859d66f4f..512893e0f 100644 --- a/docs/file.MIT-LICENSE.html +++ b/docs/file.MIT-LICENSE.html @@ -6,7 +6,7 @@ File: MIT-LICENSE - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -75,9 +75,9 @@ diff --git a/docs/file.README.html b/docs/file.README.html index d37aa61f1..1a41496d5 100644 --- a/docs/file.README.html +++ b/docs/file.README.html @@ -6,7 +6,7 @@ File: README - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -62,12 +62,16 @@

          Description

            -
          • A Ruby library for mocking and stubbing.
          • +
          • A Ruby library for mocking and stubbing - but deliberately not (yet) faking or spying.
          • A unified, simple and readable syntax for both full & partial mocking.
          • Built-in support for MiniTest and Test::Unit.
          • Supported by many other test frameworks.
          +

          Intended Usage

          + +

          Mocha is intended to be used in unit tests for the Mock Object or Test Stub types of Test Double, not the Fake Object or Test Spy types. Although it would be possible to extend Mocha to allow the implementation of fakes and spies, we have chosen to keep it focused on mocks and stubs.

          +

          Installation

          Gem

          @@ -147,15 +151,6 @@
          RSpec

          Note: There is no need to use a require statement to setup Mocha; RSpec does this itself.

          -

          Rails Plugin

          - -

          Install the Rails plugin...

          - -
          $ rails plugin install git://github.com/freerange/mocha.git
          -
          - -

          Note: As of version 0.9.8, the Mocha plugin is not automatically setup at plugin load time. Instead it must be manually setup e.g. at the bottom of your test_helper.rb.

          -
          MiniTest
          # At bottom of test_helper.rb (or at least after `require 'rails/test_help'`)
          @@ -171,7 +166,6 @@ 

          Known Issues

        • 0.13.x versions cause a harmless, but annoying, deprecation warning when used with Rails 3.2.0-3.2.12, 3.1.0-3.1.10 & 3.0.0-3.0.19.
        • 0.11.x versions don't work with Rails 3.2.13 (TypeError: superclass mismatch for class ExpectationError). See #115.
        • Versions 0.10.2, 0.10.3 & 0.11.0 of the Mocha gem were broken. Please do not use these versions.
        • -
        • Versions 0.9.6 & 0.9.7 of the Mocha Rails plugin were broken. Please do not use these versions.

        Usage

        @@ -341,6 +335,15 @@

        Configuration

        See the documentation for Mocha::Configuration for further details.

        +
        MOCHA_OPTIONS
        + +

        MOCHA_OPTIONS is an environment variable whose value can be set to a comma-separated list, so that we can specify multiple options e.g. MOCHA_OPTIONS=debug,use_test_unit_gem. +Only the following values are currently recognized and have an effect:

        + +
          +
        • debug: Enables a debug mode which will output backtraces for each deprecation warning. This is useful for finding where in the test suite the deprecated calls are.
        • +
        +

        Useful Links

          @@ -367,7 +370,7 @@

          Releasing a new version

        • Commit & push to GitHub
        • Check Travis CI build is passing - https://travis-ci.org/freerange/mocha

        • Sign in to Google Analytics - https://analytics.google.com/analytics/web/

        • -
        • Find the web property ID for Go Free Range Ltd > Mocha Documentation (UA-625523-7)

        • +
        • Find the web property ID for floehopper (625523) > Mocha Documentation (UA-625523-7)

        • Generate documentation:

        @@ -416,9 +419,9 @@

        License

        diff --git a/docs/file.RELEASE.html b/docs/file.RELEASE.html index 616c02fb7..2fefbec38 100644 --- a/docs/file.RELEASE.html +++ b/docs/file.RELEASE.html @@ -6,7 +6,7 @@ File: RELEASE - — Mocha 1.9.0 + — Mocha 1.10.0.alpha @@ -59,6 +59,61 @@

        Release Notes

        +

        1.10.0.alpha

        + +

        External changes

        + +
          +
        • Remove dependency on metaclass gem (#49, #365)
        • +
        • Accept symbol (as well as a string) as mock/stub name - thanks to @nitishr (#347, #353, #377)
        • +
        • More realistic examples in documentation for Expectation#yields and #multiple_yields - thanks to @nitishr (#352, #383)
        • +
        • Improve documentation for Mock#responds_like & #responds_like_instance_of - thanks to @nitishr (#337, #384)
        • +
        • Make Expectation#yields & Expectation#multiple_yields fail when the caller of the stubbed method does not provide a block. This is a change to an undocumented aspect of the public API's behaviour. If this causes your tests to fail, then fix it by removing the unnecessary call to Expectation#yields or Expectation#multiple_yields - thanks to @nitishr (#382)
        • +
        • Document MOCHA_OPTIONS in README - thanks to @nitishr (#311, #386)
        • +
        • Add documentation to explain how Mocha is intended to be used - thanks to @nitishr (#330, #385)
        • +
        • Deprecation warning if integration using 'mocha/test_unit' or 'mocha/minitest' fails - thanks to @nitishr (#229, #389, c6032d0b)
        • +
        • Require at least one specified sequence for Expectation#in_sequence - thanks to @nitishr (#79, #396, 9020248a)
        • +
        • Make signatures of Mock#unstub & ObjectMethods#unstub consistent - thanks to @nitishr (#397, f04d437)
        • +
        • Deprecate requiring 'mocha/setup' (36adf880)
        • +
        • Optionally display matching invocations alongside expectations - thanks to @nitishr (#178, #394, 00f0540, #410)
        • +
        • Put deprecations into effect (#400, #418): + +
            +
          • Remove deprecated 'mocha_standalone.rb' & 'mocha/standalone.rb'
          • +
          • Fail fast if no test library loaded
          • +
          • Removed optional block for Mocha::API#mock, #stub & #stub_everything
          • +
          • Remove deprecated ParameterMatchers#has_equivalent_query_string method
          • +
          • Remove deprecated 'mocha/mini_test.rb'
          • +
        • +
        • Fix typo in docs for Mocha::Configuration.prevent (266ce71c)
        • +
        • New-style configuration (see documentation for Mocha::Configuration) (#407, #421)
        • +
        • Deprecate support for Ruby versions earlier than v1.9 (#325, c5f8496d)
        • +
        • Deprecate support for versions of test-unit & minitest which need monkey-patching (a34e1a88)
        • +
        • Deprecate old-style Rails plugin (#403, 2df77134)
        • +
        • Documentation fixes & improvements which also fix YARD warnings (472d5416, a2c0d64a)
        • +
        + +

        Internal changes

        + +
          +
        • Pin minitest to v5.11.3 for Ruby v1.8.7 to fix build; minitest no longer supports Ruby v1.8.7 (4a0a580)
        • +
        • Upgrade JRuby to v9.2.8.0 in Travis CI builds (aa29b3f)
        • +
        • Only run rubocop for MRI Ruby versions & non-integration test builds (8f1c6af)
        • +
        • Reduce duplication in any instance method class - thanks to @nitishr (#378)
        • +
        • Simplify AnyInstanceMethod, ClassMethod, InstanceMethod, ModuleMethod class hierarchy - thanks to @nitishr (#381)
        • +
        • Simplify ClassMethods#method_exists? & ObjectMethods#method_exists? making them consistent - thanks to @nitishr (#270, #362, #370)
        • +
        • Don't override definition of singleton_class in ClassMethods - thanks to @nitishr (#391, #392)
        • +
        • Do not include 'method_definer' methods into all objects (#268, #402)
        • +
        • Distinguish different ObjectMethods modules (#268, #404)
        • +
        • Pass invocation to expectation list methods - thanks to @nitishr (#408, #409, #411)
        • +
        • Consistently use assert_raises - thanks to @nitishr (#405, #412, a66b7bed)
        • +
        • Update Ruby & JRuby versions in Travis CI config (18cb1a93, eb061c53)
        • +
        • Rubocop improvements (aa16ea67...6f4db70b, 2a1240e6...e95716ae)
        • +
        • Fix inconsistency in CardinalityTest (aa10e0a8)
        • +
        • Fix test failures on Mac OSX Catalina - thanks to @nitishr (#413, #417, #419, 8a0f2535)
        • +
        • Remove default argument in Expectation#invoke - thanks to @nitishr (#414, #420)
        • +
        +

        1.9.0

          @@ -877,9 +932,9 @@

          0.1.1

        diff --git a/docs/frames.html b/docs/frames.html index 9b1c2adbb..41c482a6e 100644 --- a/docs/frames.html +++ b/docs/frames.html @@ -2,7 +2,7 @@ - Mocha 1.9.0 + Mocha 1.10.0.alpha