mocha 1.10.2 → 1.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/FUNDING.yml +1 -0
- data/.yardopts +1 -0
- data/CONTRIBUTING.md +1 -1
- data/README.md +28 -30
- data/RELEASE.md +87 -0
- data/Rakefile +7 -5
- data/lib/mocha/api.rb +2 -3
- data/lib/mocha/block_matcher.rb +31 -0
- data/lib/mocha/cardinality.rb +30 -27
- data/lib/mocha/configuration.rb +2 -2
- data/lib/mocha/expectation.rb +71 -30
- data/lib/mocha/inspect.rb +6 -4
- data/lib/mocha/invocation.rb +9 -5
- data/lib/mocha/mock.rb +41 -15
- data/lib/mocha/mockery.rb +17 -27
- data/lib/mocha/parameter_matchers.rb +1 -0
- data/lib/mocha/parameter_matchers/has_entries.rb +2 -3
- data/lib/mocha/parameter_matchers/has_entry.rb +24 -16
- data/lib/mocha/parameter_matchers/has_key.rb +2 -3
- data/lib/mocha/parameter_matchers/has_keys.rb +53 -0
- data/lib/mocha/parameter_matchers/has_value.rb +2 -3
- data/lib/mocha/parameter_matchers/is_a.rb +2 -3
- data/lib/mocha/parameter_matchers/not.rb +2 -3
- data/lib/mocha/state_machine.rb +31 -40
- data/lib/mocha/stubbed_method.rb +4 -6
- data/lib/mocha/version.rb +1 -1
- data/lib/mocha/yield_parameters.rb +5 -11
- data/mocha.gemspec +13 -7
- metadata +8 -210
- data/bin/build-matrix +0 -82
- data/docs/CNAME +0 -1
- data/docs/Mocha.html +0 -254
- data/docs/Mocha/API.html +0 -1287
- data/docs/Mocha/ClassMethods.html +0 -264
- data/docs/Mocha/Configuration.html +0 -1525
- data/docs/Mocha/Expectation.html +0 -2654
- data/docs/Mocha/ExpectationError.html +0 -152
- data/docs/Mocha/ExpectationErrorFactory.html +0 -260
- data/docs/Mocha/Hooks.html +0 -370
- data/docs/Mocha/Integration.html +0 -125
- data/docs/Mocha/Integration/MiniTest.html +0 -123
- data/docs/Mocha/Integration/MiniTest/Adapter.html +0 -164
- data/docs/Mocha/Integration/TestUnit.html +0 -123
- data/docs/Mocha/Integration/TestUnit/Adapter.html +0 -164
- data/docs/Mocha/Mock.html +0 -1237
- data/docs/Mocha/ObjectMethods.html +0 -765
- data/docs/Mocha/ParameterMatchers.html +0 -2961
- data/docs/Mocha/ParameterMatchers/AllOf.html +0 -153
- data/docs/Mocha/ParameterMatchers/AnyOf.html +0 -153
- data/docs/Mocha/ParameterMatchers/AnyParameters.html +0 -153
- data/docs/Mocha/ParameterMatchers/Anything.html +0 -153
- data/docs/Mocha/ParameterMatchers/Base.html +0 -441
- data/docs/Mocha/ParameterMatchers/Equals.html +0 -153
- data/docs/Mocha/ParameterMatchers/EquivalentUri.html +0 -153
- data/docs/Mocha/ParameterMatchers/HasEntries.html +0 -153
- data/docs/Mocha/ParameterMatchers/HasEntry.html +0 -153
- data/docs/Mocha/ParameterMatchers/HasKey.html +0 -153
- data/docs/Mocha/ParameterMatchers/HasValue.html +0 -153
- data/docs/Mocha/ParameterMatchers/Includes.html +0 -153
- data/docs/Mocha/ParameterMatchers/InstanceOf.html +0 -153
- data/docs/Mocha/ParameterMatchers/IsA.html +0 -153
- data/docs/Mocha/ParameterMatchers/KindOf.html +0 -153
- data/docs/Mocha/ParameterMatchers/Not.html +0 -153
- data/docs/Mocha/ParameterMatchers/Optionally.html +0 -153
- data/docs/Mocha/ParameterMatchers/RegexpMatches.html +0 -153
- data/docs/Mocha/ParameterMatchers/RespondsWith.html +0 -153
- data/docs/Mocha/ParameterMatchers/YamlEquivalent.html +0 -153
- data/docs/Mocha/Sequence.html +0 -149
- data/docs/Mocha/StateMachine.html +0 -527
- data/docs/Mocha/StateMachine/State.html +0 -140
- data/docs/Mocha/StateMachine/StatePredicate.html +0 -140
- data/docs/Mocha/StubbingError.html +0 -150
- data/docs/_index.html +0 -519
- data/docs/class_list.html +0 -51
- data/docs/css/common.css +0 -1
- data/docs/css/full_list.css +0 -58
- data/docs/css/style.css +0 -496
- data/docs/file.COPYING.html +0 -81
- data/docs/file.MIT-LICENSE.html +0 -85
- data/docs/file.README.html +0 -448
- data/docs/file.RELEASE.html +0 -974
- data/docs/file_list.html +0 -71
- data/docs/frames.html +0 -17
- data/docs/index.html +0 -448
- data/docs/js/app.js +0 -303
- data/docs/js/full_list.js +0 -216
- data/docs/js/jquery.js +0 -4
- data/docs/method_list.html +0 -635
- data/docs/top-level-namespace.html +0 -118
- data/gemfiles/Gemfile.minitest.1.3.0 +0 -7
- data/gemfiles/Gemfile.minitest.1.4.0 +0 -7
- data/gemfiles/Gemfile.minitest.1.4.1 +0 -7
- data/gemfiles/Gemfile.minitest.1.4.2 +0 -7
- data/gemfiles/Gemfile.minitest.2.0.0 +0 -7
- data/gemfiles/Gemfile.minitest.2.0.1 +0 -7
- data/gemfiles/Gemfile.minitest.2.11.0 +0 -7
- data/gemfiles/Gemfile.minitest.2.11.2 +0 -7
- data/gemfiles/Gemfile.minitest.2.3.0 +0 -7
- data/gemfiles/Gemfile.minitest.5.11.3 +0 -7
- data/gemfiles/Gemfile.test-unit.2.0.0 +0 -7
- data/gemfiles/Gemfile.test-unit.2.0.1 +0 -7
- data/gemfiles/Gemfile.test-unit.2.0.3 +0 -7
- data/lib/mocha/multiple_yields.rb +0 -15
- data/lib/mocha/no_yields.rb +0 -5
- data/lib/mocha/pretty_parameters.rb +0 -24
- data/lib/mocha/single_yield.rb +0 -13
- data/test/acceptance/acceptance_test_helper.rb +0 -41
- data/test/acceptance/bug_18914_test.rb +0 -37
- data/test/acceptance/bug_21465_test.rb +0 -31
- data/test/acceptance/bug_21563_test.rb +0 -22
- data/test/acceptance/display_matching_invocations_alongside_expectations_test.rb +0 -69
- data/test/acceptance/exception_rescue_test.rb +0 -53
- data/test/acceptance/expectations_on_multiple_methods_test.rb +0 -55
- data/test/acceptance/expected_invocation_count_test.rb +0 -229
- data/test/acceptance/failure_messages_test.rb +0 -61
- data/test/acceptance/issue_272_test.rb +0 -50
- data/test/acceptance/issue_65_test.rb +0 -64
- data/test/acceptance/issue_70_test.rb +0 -53
- data/test/acceptance/mocha_example_test.rb +0 -96
- data/test/acceptance/mocha_test_result_test.rb +0 -83
- data/test/acceptance/mock_built_with_first_argument_type_being_string_test.rb +0 -99
- data/test/acceptance/mock_test.rb +0 -139
- data/test/acceptance/mocked_methods_dispatch_test.rb +0 -75
- data/test/acceptance/multiple_expectations_failure_message_test.rb +0 -66
- data/test/acceptance/optional_parameters_test.rb +0 -67
- data/test/acceptance/parameter_matcher_test.rb +0 -299
- data/test/acceptance/partial_mocks_test.rb +0 -44
- data/test/acceptance/prepend_test.rb +0 -86
- data/test/acceptance/prevent_use_of_mocha_outside_test_test.rb +0 -76
- data/test/acceptance/raise_exception_test.rb +0 -36
- data/test/acceptance/return_value_test.rb +0 -49
- data/test/acceptance/sequence_test.rb +0 -189
- data/test/acceptance/states_test.rb +0 -71
- data/test/acceptance/stub_any_instance_method_defined_on_superclass_test.rb +0 -64
- data/test/acceptance/stub_any_instance_method_test.rb +0 -301
- data/test/acceptance/stub_class_method_defined_on_active_record_association_proxy_test.rb +0 -105
- data/test/acceptance/stub_class_method_defined_on_class_test.rb +0 -78
- data/test/acceptance/stub_class_method_defined_on_module_test.rb +0 -73
- data/test/acceptance/stub_class_method_defined_on_superclass_test.rb +0 -144
- data/test/acceptance/stub_everything_test.rb +0 -53
- data/test/acceptance/stub_instance_method_defined_on_active_record_association_proxy_test.rb +0 -91
- data/test/acceptance/stub_instance_method_defined_on_class_and_aliased_test.rb +0 -67
- data/test/acceptance/stub_instance_method_defined_on_class_test.rb +0 -67
- data/test/acceptance/stub_instance_method_defined_on_kernel_module_test.rb +0 -136
- data/test/acceptance/stub_instance_method_defined_on_module_test.rb +0 -76
- data/test/acceptance/stub_instance_method_defined_on_object_class_test.rb +0 -75
- data/test/acceptance/stub_instance_method_defined_on_singleton_class_test.rb +0 -67
- data/test/acceptance/stub_instance_method_defined_on_superclass_test.rb +0 -70
- data/test/acceptance/stub_method_defined_on_module_and_aliased_test.rb +0 -38
- data/test/acceptance/stub_module_method_test.rb +0 -200
- data/test/acceptance/stub_test.rb +0 -49
- data/test/acceptance/stubba_example_test.rb +0 -93
- data/test/acceptance/stubba_test_result_test.rb +0 -71
- data/test/acceptance/stubbing_error_backtrace_test.rb +0 -63
- data/test/acceptance/stubbing_frozen_object_test.rb +0 -88
- data/test/acceptance/stubbing_method_accepting_block_parameter_test.rb +0 -52
- data/test/acceptance/stubbing_method_unnecessarily_test.rb +0 -63
- data/test/acceptance/stubbing_nil_test.rb +0 -60
- data/test/acceptance/stubbing_non_existent_any_instance_method_test.rb +0 -157
- data/test/acceptance/stubbing_non_existent_class_method_test.rb +0 -157
- data/test/acceptance/stubbing_non_existent_instance_method_test.rb +0 -145
- data/test/acceptance/stubbing_non_public_any_instance_method_test.rb +0 -128
- data/test/acceptance/stubbing_non_public_class_method_test.rb +0 -163
- data/test/acceptance/stubbing_non_public_instance_method_test.rb +0 -141
- data/test/acceptance/stubbing_on_non_mock_object_test.rb +0 -70
- data/test/acceptance/stubbing_same_class_method_on_parent_and_child_classes_test.rb +0 -33
- data/test/acceptance/throw_test.rb +0 -42
- data/test/acceptance/unexpected_invocation_test.rb +0 -23
- data/test/acceptance/unstubbing_test.rb +0 -194
- data/test/assertions.rb +0 -8
- data/test/deprecation_disabler.rb +0 -15
- data/test/execution_point.rb +0 -36
- data/test/integration/mini_test_test.rb +0 -8
- data/test/integration/shared_tests.rb +0 -178
- data/test/integration/test_unit_test.rb +0 -8
- data/test/method_definer.rb +0 -16
- data/test/mini_test_result.rb +0 -96
- data/test/minitest_result.rb +0 -48
- data/test/simple_counter.rb +0 -11
- data/test/test_helper.rb +0 -58
- data/test/test_runner.rb +0 -58
- data/test/test_unit_result.rb +0 -22
- data/test/unit/any_instance_method_test.rb +0 -175
- data/test/unit/array_inspect_test.rb +0 -14
- data/test/unit/backtrace_filter_test.rb +0 -17
- data/test/unit/cardinality_test.rb +0 -72
- data/test/unit/central_test.rb +0 -98
- data/test/unit/change_state_side_effect_test.rb +0 -37
- data/test/unit/class_methods_test.rb +0 -69
- data/test/unit/configuration_test.rb +0 -37
- data/test/unit/date_time_inspect_test.rb +0 -19
- data/test/unit/exception_raiser_test.rb +0 -45
- data/test/unit/expectation_list_test.rb +0 -82
- data/test/unit/expectation_test.rb +0 -492
- data/test/unit/hash_inspect_test.rb +0 -14
- data/test/unit/hooks_test.rb +0 -35
- data/test/unit/in_state_ordering_constraint_test.rb +0 -39
- data/test/unit/instance_method_test.rb +0 -282
- data/test/unit/method_matcher_test.rb +0 -26
- data/test/unit/mock_test.rb +0 -372
- data/test/unit/mockery_test.rb +0 -171
- data/test/unit/module_methods_test.rb +0 -16
- data/test/unit/multiple_yields_test.rb +0 -16
- data/test/unit/no_yields_test.rb +0 -16
- data/test/unit/object_inspect_test.rb +0 -60
- data/test/unit/object_methods_test.rb +0 -63
- data/test/unit/parameter_matchers/all_of_test.rb +0 -24
- data/test/unit/parameter_matchers/any_of_test.rb +0 -24
- data/test/unit/parameter_matchers/anything_test.rb +0 -19
- data/test/unit/parameter_matchers/equals_test.rb +0 -23
- data/test/unit/parameter_matchers/equivalent_uri_test.rb +0 -41
- data/test/unit/parameter_matchers/has_entries_test.rb +0 -51
- data/test/unit/parameter_matchers/has_entry_test.rb +0 -128
- data/test/unit/parameter_matchers/has_key_test.rb +0 -54
- data/test/unit/parameter_matchers/has_value_test.rb +0 -55
- data/test/unit/parameter_matchers/includes_test.rb +0 -106
- data/test/unit/parameter_matchers/instance_of_test.rb +0 -23
- data/test/unit/parameter_matchers/is_a_test.rb +0 -23
- data/test/unit/parameter_matchers/kind_of_test.rb +0 -23
- data/test/unit/parameter_matchers/not_test.rb +0 -24
- data/test/unit/parameter_matchers/regexp_matches_test.rb +0 -45
- data/test/unit/parameter_matchers/responds_with_test.rb +0 -38
- data/test/unit/parameter_matchers/stub_matcher.rb +0 -23
- data/test/unit/parameter_matchers/yaml_equivalent_test.rb +0 -23
- data/test/unit/parameters_matcher_test.rb +0 -119
- data/test/unit/receivers_test.rb +0 -96
- data/test/unit/return_values_test.rb +0 -66
- data/test/unit/sequence_test.rb +0 -100
- data/test/unit/single_return_value_test.rb +0 -17
- data/test/unit/single_yield_test.rb +0 -16
- data/test/unit/state_machine_test.rb +0 -96
- data/test/unit/string_inspect_test.rb +0 -9
- data/test/unit/thrower_test.rb +0 -23
- data/test/unit/yield_parameters_test.rb +0 -91
data/lib/mocha/state_machine.rb
CHANGED
@@ -2,46 +2,32 @@ module Mocha
|
|
2
2
|
# A state machine that is used to constrain the order of invocations.
|
3
3
|
# An invocation can be constrained to occur when a state {#is}, or {#is_not}, active.
|
4
4
|
class StateMachine
|
5
|
-
# Provides
|
6
|
-
class
|
5
|
+
# Provides the ability to determine whether a {StateMachine} is in a specified state at some point in the future.
|
6
|
+
class StatePredicate
|
7
7
|
# @private
|
8
|
-
def initialize(state_machine, state)
|
8
|
+
def initialize(state_machine, state, description, &active_check)
|
9
9
|
@state_machine = state_machine
|
10
10
|
@state = state
|
11
|
-
|
12
|
-
|
13
|
-
# @private
|
14
|
-
def activate
|
15
|
-
@state_machine.current_state = @state
|
11
|
+
@description = description
|
12
|
+
@active_check = active_check
|
16
13
|
end
|
17
14
|
|
18
15
|
# @private
|
19
16
|
def active?
|
20
|
-
@state_machine.current_state
|
17
|
+
@active_check.call(@state_machine.current_state, @state)
|
21
18
|
end
|
22
19
|
|
23
20
|
# @private
|
24
21
|
def mocha_inspect
|
25
|
-
"#{@state_machine.name}
|
22
|
+
"#{@state_machine.name} #{@description} #{@state.mocha_inspect}"
|
26
23
|
end
|
27
24
|
end
|
28
25
|
|
29
|
-
# Provides
|
30
|
-
class StatePredicate
|
31
|
-
# @private
|
32
|
-
def initialize(state_machine, state)
|
33
|
-
@state_machine = state_machine
|
34
|
-
@state = state
|
35
|
-
end
|
36
|
-
|
37
|
-
# @private
|
38
|
-
def active?
|
39
|
-
@state_machine.current_state != @state
|
40
|
-
end
|
41
|
-
|
26
|
+
# Provides a mechanism to change the state of a {StateMachine} at some point in the future.
|
27
|
+
class State < StatePredicate
|
42
28
|
# @private
|
43
|
-
def
|
44
|
-
|
29
|
+
def activate
|
30
|
+
@state_machine.current_state = @state
|
45
31
|
end
|
46
32
|
end
|
47
33
|
|
@@ -73,30 +59,35 @@ module Mocha
|
|
73
59
|
@current_state = next_state_name
|
74
60
|
end
|
75
61
|
|
76
|
-
# Provides a
|
62
|
+
# Provides mechanisms to (a) determine whether the {StateMachine} is in a given state; or (b) to change the {StateMachine} into the given state.
|
77
63
|
#
|
78
|
-
#
|
64
|
+
# @param [String] state_name name of expected/desired state.
|
65
|
+
# @return [StatePredicate,State] (a) state predicate which, when queried, will indicate whether the {StateMachine} is in the given state; or (b) state which, when activated, will change the {StateMachine} into the given state.
|
79
66
|
#
|
80
|
-
# @
|
81
|
-
#
|
67
|
+
# @overload def is(expected_state_name)
|
68
|
+
# Provides a mechanism to determine whether the {StateMachine} is in the state specified by +expected_state_name+ at some point in the future
|
69
|
+
# @param [String] expected_state_name name of expected state.
|
70
|
+
# @return [StatePredicate] state predicate which, when queried, will indicate whether the {StateMachine} is in the state specified by +expected_state_name+
|
71
|
+
#
|
72
|
+
# @overload def is(desired_state_name)
|
73
|
+
# Provides a mechanism to change the {StateMachine} into the state specified by +desired_state_name+ at some point in the future.
|
74
|
+
# @param [String] desired_state_name name of desired new state.
|
75
|
+
# @return [State] state which, when activated, will change the {StateMachine} into the state with the specified +desired_state_name+.
|
82
76
|
def is(state_name)
|
83
|
-
State.new(self, state_name)
|
77
|
+
State.new(self, state_name, 'is') { |current, given| current == given }
|
84
78
|
end
|
85
79
|
|
86
|
-
# Provides a mechanism to determine whether the {StateMachine} is not in the state specified by +
|
87
|
-
#
|
88
|
-
|
89
|
-
|
80
|
+
# Provides a mechanism to determine whether the {StateMachine} is *not* in the state specified by +unexpected_state_name+ at some point in the future.
|
81
|
+
#
|
82
|
+
# @param [String] unexpected_state_name name of unexpected state.
|
83
|
+
# @return [StatePredicate] state predicate which, when queried, will indicate whether the {StateMachine} is *not* in the state specified by +unexpected_state_name+.
|
84
|
+
def is_not(unexpected_state_name) # rubocop:disable Naming/PredicateName
|
85
|
+
StatePredicate.new(self, unexpected_state_name, 'is not') { |current, given| current != given }
|
90
86
|
end
|
91
|
-
# rubocop:enable Naming/PredicateName
|
92
87
|
|
93
88
|
# @private
|
94
89
|
def mocha_inspect
|
95
|
-
|
96
|
-
"#{@name} is #{@current_state.mocha_inspect}"
|
97
|
-
else
|
98
|
-
"#{@name} has no current state"
|
99
|
-
end
|
90
|
+
%(#{@name} #{@current_state ? "is #{@current_state.mocha_inspect}" : 'has no current state'})
|
100
91
|
end
|
101
92
|
end
|
102
93
|
end
|
data/lib/mocha/stubbed_method.rb
CHANGED
@@ -74,7 +74,7 @@ module Mocha
|
|
74
74
|
def restore_original_method
|
75
75
|
return if use_prepended_module_for_stub_method?
|
76
76
|
if stub_method_overwrites_original_method?
|
77
|
-
original_method_owner.send(:define_method, method_name, method_body(original_method))
|
77
|
+
original_method_owner.send(:define_method, method_name, method_body(@original_method))
|
78
78
|
end
|
79
79
|
retain_original_visibility(original_method_owner)
|
80
80
|
end
|
@@ -93,18 +93,16 @@ module Mocha
|
|
93
93
|
private
|
94
94
|
|
95
95
|
def retain_original_visibility(method_owner)
|
96
|
-
return unless original_visibility
|
97
|
-
Module.instance_method(original_visibility).bind(method_owner).call(method_name)
|
96
|
+
return unless @original_visibility
|
97
|
+
Module.instance_method(@original_visibility).bind(method_owner).call(method_name)
|
98
98
|
end
|
99
99
|
|
100
|
-
attr_reader :original_method, :original_visibility
|
101
|
-
|
102
100
|
def store_original_method_visibility
|
103
101
|
@original_visibility = original_method_owner.__method_visibility__(method_name)
|
104
102
|
end
|
105
103
|
|
106
104
|
def stub_method_overwrites_original_method?
|
107
|
-
original_method && original_method.owner == original_method_owner
|
105
|
+
@original_method && @original_method.owner == original_method_owner
|
108
106
|
end
|
109
107
|
|
110
108
|
def remove_original_method_from_stubbee
|
data/lib/mocha/version.rb
CHANGED
@@ -1,7 +1,3 @@
|
|
1
|
-
require 'mocha/no_yields'
|
2
|
-
require 'mocha/single_yield'
|
3
|
-
require 'mocha/multiple_yields'
|
4
|
-
|
5
1
|
module Mocha
|
6
2
|
class YieldParameters
|
7
3
|
def initialize
|
@@ -10,18 +6,16 @@ module Mocha
|
|
10
6
|
|
11
7
|
def next_invocation
|
12
8
|
case @parameter_groups.length
|
13
|
-
when 0 then
|
9
|
+
when 0 then []
|
14
10
|
when 1 then @parameter_groups.first
|
15
11
|
else @parameter_groups.shift
|
16
12
|
end
|
17
13
|
end
|
18
14
|
|
19
|
-
def add(*
|
20
|
-
@parameter_groups <<
|
21
|
-
|
22
|
-
|
23
|
-
def multiple_add(*parameter_groups)
|
24
|
-
@parameter_groups << MultipleYields.new(*parameter_groups)
|
15
|
+
def add(*parameter_groups)
|
16
|
+
@parameter_groups << parameter_groups.map do |pg|
|
17
|
+
pg.is_a?(Array) ? pg : [pg]
|
18
|
+
end
|
25
19
|
end
|
26
20
|
end
|
27
21
|
end
|
data/mocha.gemspec
CHANGED
@@ -12,8 +12,10 @@ Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength
|
|
12
12
|
s.description = 'Mocking and stubbing library with JMock/SchMock syntax, which allows mocking and stubbing of methods on real (non-mock) classes.'
|
13
13
|
s.email = 'mocha-developer@googlegroups.com'
|
14
14
|
|
15
|
-
s.files =
|
16
|
-
|
15
|
+
s.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
16
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(docs|test)/}) }
|
17
|
+
end
|
18
|
+
s.files.delete('.circleci/config.yml')
|
17
19
|
s.files.delete('.gitignore')
|
18
20
|
|
19
21
|
s.homepage = 'https://mocha.jamesmead.org'
|
@@ -28,18 +30,22 @@ Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength
|
|
28
30
|
end
|
29
31
|
end
|
30
32
|
|
31
|
-
if RUBY_VERSION
|
32
|
-
s.add_development_dependency
|
33
|
+
if RUBY_VERSION < '1.9.3'
|
34
|
+
s.add_development_dependency 'rake', '~> 10.0'
|
35
|
+
elsif RUBY_VERSION < '2'
|
36
|
+
s.add_development_dependency 'rake', '~> 12.2.1'
|
37
|
+
elsif RUBY_VERSION < '2.2'
|
38
|
+
s.add_development_dependency 'rake', '~> 12.3.3'
|
33
39
|
else
|
34
|
-
|
35
|
-
s.add_development_dependency('rake', '~> 10.0')
|
40
|
+
s.add_development_dependency 'rake'
|
36
41
|
end
|
42
|
+
|
37
43
|
s.add_development_dependency('introspection', '~> 0.0.1')
|
38
44
|
if RUBY_VERSION >= '2.2.0'
|
39
45
|
# No test libraries in standard library
|
40
46
|
s.add_development_dependency('minitest')
|
41
47
|
end
|
42
|
-
if RUBY_VERSION >= '
|
48
|
+
if RUBY_VERSION >= '2.2.0'
|
43
49
|
s.add_development_dependency('rubocop', '<= 0.58.2')
|
44
50
|
end
|
45
51
|
if ENV['MOCHA_GENERATE_DOCS']
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mocha
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Mead
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -74,6 +74,7 @@ extensions: []
|
|
74
74
|
extra_rdoc_files: []
|
75
75
|
files:
|
76
76
|
- ".gemtest"
|
77
|
+
- ".github/FUNDING.yml"
|
77
78
|
- ".rubocop.yml"
|
78
79
|
- ".rubocop_todo.yml"
|
79
80
|
- ".yardopts"
|
@@ -84,80 +85,7 @@ files:
|
|
84
85
|
- README.md
|
85
86
|
- RELEASE.md
|
86
87
|
- Rakefile
|
87
|
-
- bin/build-matrix
|
88
|
-
- docs/CNAME
|
89
|
-
- docs/Mocha.html
|
90
|
-
- docs/Mocha/API.html
|
91
|
-
- docs/Mocha/ClassMethods.html
|
92
|
-
- docs/Mocha/Configuration.html
|
93
|
-
- docs/Mocha/Expectation.html
|
94
|
-
- docs/Mocha/ExpectationError.html
|
95
|
-
- docs/Mocha/ExpectationErrorFactory.html
|
96
|
-
- docs/Mocha/Hooks.html
|
97
|
-
- docs/Mocha/Integration.html
|
98
|
-
- docs/Mocha/Integration/MiniTest.html
|
99
|
-
- docs/Mocha/Integration/MiniTest/Adapter.html
|
100
|
-
- docs/Mocha/Integration/TestUnit.html
|
101
|
-
- docs/Mocha/Integration/TestUnit/Adapter.html
|
102
|
-
- docs/Mocha/Mock.html
|
103
|
-
- docs/Mocha/ObjectMethods.html
|
104
|
-
- docs/Mocha/ParameterMatchers.html
|
105
|
-
- docs/Mocha/ParameterMatchers/AllOf.html
|
106
|
-
- docs/Mocha/ParameterMatchers/AnyOf.html
|
107
|
-
- docs/Mocha/ParameterMatchers/AnyParameters.html
|
108
|
-
- docs/Mocha/ParameterMatchers/Anything.html
|
109
|
-
- docs/Mocha/ParameterMatchers/Base.html
|
110
|
-
- docs/Mocha/ParameterMatchers/Equals.html
|
111
|
-
- docs/Mocha/ParameterMatchers/EquivalentUri.html
|
112
|
-
- docs/Mocha/ParameterMatchers/HasEntries.html
|
113
|
-
- docs/Mocha/ParameterMatchers/HasEntry.html
|
114
|
-
- docs/Mocha/ParameterMatchers/HasKey.html
|
115
|
-
- docs/Mocha/ParameterMatchers/HasValue.html
|
116
|
-
- docs/Mocha/ParameterMatchers/Includes.html
|
117
|
-
- docs/Mocha/ParameterMatchers/InstanceOf.html
|
118
|
-
- docs/Mocha/ParameterMatchers/IsA.html
|
119
|
-
- docs/Mocha/ParameterMatchers/KindOf.html
|
120
|
-
- docs/Mocha/ParameterMatchers/Not.html
|
121
|
-
- docs/Mocha/ParameterMatchers/Optionally.html
|
122
|
-
- docs/Mocha/ParameterMatchers/RegexpMatches.html
|
123
|
-
- docs/Mocha/ParameterMatchers/RespondsWith.html
|
124
|
-
- docs/Mocha/ParameterMatchers/YamlEquivalent.html
|
125
|
-
- docs/Mocha/Sequence.html
|
126
|
-
- docs/Mocha/StateMachine.html
|
127
|
-
- docs/Mocha/StateMachine/State.html
|
128
|
-
- docs/Mocha/StateMachine/StatePredicate.html
|
129
|
-
- docs/Mocha/StubbingError.html
|
130
|
-
- docs/_index.html
|
131
|
-
- docs/class_list.html
|
132
|
-
- docs/css/common.css
|
133
|
-
- docs/css/full_list.css
|
134
|
-
- docs/css/style.css
|
135
|
-
- docs/file.COPYING.html
|
136
|
-
- docs/file.MIT-LICENSE.html
|
137
|
-
- docs/file.README.html
|
138
|
-
- docs/file.RELEASE.html
|
139
|
-
- docs/file_list.html
|
140
|
-
- docs/frames.html
|
141
|
-
- docs/index.html
|
142
|
-
- docs/js/app.js
|
143
|
-
- docs/js/full_list.js
|
144
|
-
- docs/js/jquery.js
|
145
|
-
- docs/method_list.html
|
146
|
-
- docs/top-level-namespace.html
|
147
|
-
- gemfiles/Gemfile.minitest.1.3.0
|
148
|
-
- gemfiles/Gemfile.minitest.1.4.0
|
149
|
-
- gemfiles/Gemfile.minitest.1.4.1
|
150
|
-
- gemfiles/Gemfile.minitest.1.4.2
|
151
|
-
- gemfiles/Gemfile.minitest.2.0.0
|
152
|
-
- gemfiles/Gemfile.minitest.2.0.1
|
153
|
-
- gemfiles/Gemfile.minitest.2.11.0
|
154
|
-
- gemfiles/Gemfile.minitest.2.11.2
|
155
|
-
- gemfiles/Gemfile.minitest.2.3.0
|
156
|
-
- gemfiles/Gemfile.minitest.5.11.3
|
157
88
|
- gemfiles/Gemfile.minitest.latest
|
158
|
-
- gemfiles/Gemfile.test-unit.2.0.0
|
159
|
-
- gemfiles/Gemfile.test-unit.2.0.1
|
160
|
-
- gemfiles/Gemfile.test-unit.2.0.3
|
161
89
|
- gemfiles/Gemfile.test-unit.latest
|
162
90
|
- init.rb
|
163
91
|
- lib/mocha.rb
|
@@ -165,6 +93,7 @@ files:
|
|
165
93
|
- lib/mocha/api.rb
|
166
94
|
- lib/mocha/argument_iterator.rb
|
167
95
|
- lib/mocha/backtrace_filter.rb
|
96
|
+
- lib/mocha/block_matcher.rb
|
168
97
|
- lib/mocha/cardinality.rb
|
169
98
|
- lib/mocha/central.rb
|
170
99
|
- lib/mocha/change_state_side_effect.rb
|
@@ -217,9 +146,7 @@ files:
|
|
217
146
|
- lib/mocha/minitest.rb
|
218
147
|
- lib/mocha/mock.rb
|
219
148
|
- lib/mocha/mockery.rb
|
220
|
-
- lib/mocha/multiple_yields.rb
|
221
149
|
- lib/mocha/names.rb
|
222
|
-
- lib/mocha/no_yields.rb
|
223
150
|
- lib/mocha/not_initialized_error.rb
|
224
151
|
- lib/mocha/object_methods.rb
|
225
152
|
- lib/mocha/parameter_matchers.rb
|
@@ -233,6 +160,7 @@ files:
|
|
233
160
|
- lib/mocha/parameter_matchers/has_entries.rb
|
234
161
|
- lib/mocha/parameter_matchers/has_entry.rb
|
235
162
|
- lib/mocha/parameter_matchers/has_key.rb
|
163
|
+
- lib/mocha/parameter_matchers/has_keys.rb
|
236
164
|
- lib/mocha/parameter_matchers/has_value.rb
|
237
165
|
- lib/mocha/parameter_matchers/includes.rb
|
238
166
|
- lib/mocha/parameter_matchers/instance_methods.rb
|
@@ -245,7 +173,6 @@ files:
|
|
245
173
|
- lib/mocha/parameter_matchers/responds_with.rb
|
246
174
|
- lib/mocha/parameter_matchers/yaml_equivalent.rb
|
247
175
|
- lib/mocha/parameters_matcher.rb
|
248
|
-
- lib/mocha/pretty_parameters.rb
|
249
176
|
- lib/mocha/raised_exception.rb
|
250
177
|
- lib/mocha/receivers.rb
|
251
178
|
- lib/mocha/return_values.rb
|
@@ -253,7 +180,6 @@ files:
|
|
253
180
|
- lib/mocha/sequence.rb
|
254
181
|
- lib/mocha/setup.rb
|
255
182
|
- lib/mocha/single_return_value.rb
|
256
|
-
- lib/mocha/single_yield.rb
|
257
183
|
- lib/mocha/singleton_class.rb
|
258
184
|
- lib/mocha/state_machine.rb
|
259
185
|
- lib/mocha/stubbed_method.rb
|
@@ -264,134 +190,6 @@ files:
|
|
264
190
|
- lib/mocha/version.rb
|
265
191
|
- lib/mocha/yield_parameters.rb
|
266
192
|
- mocha.gemspec
|
267
|
-
- test/acceptance/acceptance_test_helper.rb
|
268
|
-
- test/acceptance/bug_18914_test.rb
|
269
|
-
- test/acceptance/bug_21465_test.rb
|
270
|
-
- test/acceptance/bug_21563_test.rb
|
271
|
-
- test/acceptance/display_matching_invocations_alongside_expectations_test.rb
|
272
|
-
- test/acceptance/exception_rescue_test.rb
|
273
|
-
- test/acceptance/expectations_on_multiple_methods_test.rb
|
274
|
-
- test/acceptance/expected_invocation_count_test.rb
|
275
|
-
- test/acceptance/failure_messages_test.rb
|
276
|
-
- test/acceptance/issue_272_test.rb
|
277
|
-
- test/acceptance/issue_65_test.rb
|
278
|
-
- test/acceptance/issue_70_test.rb
|
279
|
-
- test/acceptance/mocha_example_test.rb
|
280
|
-
- test/acceptance/mocha_test_result_test.rb
|
281
|
-
- test/acceptance/mock_built_with_first_argument_type_being_string_test.rb
|
282
|
-
- test/acceptance/mock_test.rb
|
283
|
-
- test/acceptance/mocked_methods_dispatch_test.rb
|
284
|
-
- test/acceptance/multiple_expectations_failure_message_test.rb
|
285
|
-
- test/acceptance/optional_parameters_test.rb
|
286
|
-
- test/acceptance/parameter_matcher_test.rb
|
287
|
-
- test/acceptance/partial_mocks_test.rb
|
288
|
-
- test/acceptance/prepend_test.rb
|
289
|
-
- test/acceptance/prevent_use_of_mocha_outside_test_test.rb
|
290
|
-
- test/acceptance/raise_exception_test.rb
|
291
|
-
- test/acceptance/return_value_test.rb
|
292
|
-
- test/acceptance/sequence_test.rb
|
293
|
-
- test/acceptance/states_test.rb
|
294
|
-
- test/acceptance/stub_any_instance_method_defined_on_superclass_test.rb
|
295
|
-
- test/acceptance/stub_any_instance_method_test.rb
|
296
|
-
- test/acceptance/stub_class_method_defined_on_active_record_association_proxy_test.rb
|
297
|
-
- test/acceptance/stub_class_method_defined_on_class_test.rb
|
298
|
-
- test/acceptance/stub_class_method_defined_on_module_test.rb
|
299
|
-
- test/acceptance/stub_class_method_defined_on_superclass_test.rb
|
300
|
-
- test/acceptance/stub_everything_test.rb
|
301
|
-
- test/acceptance/stub_instance_method_defined_on_active_record_association_proxy_test.rb
|
302
|
-
- test/acceptance/stub_instance_method_defined_on_class_and_aliased_test.rb
|
303
|
-
- test/acceptance/stub_instance_method_defined_on_class_test.rb
|
304
|
-
- test/acceptance/stub_instance_method_defined_on_kernel_module_test.rb
|
305
|
-
- test/acceptance/stub_instance_method_defined_on_module_test.rb
|
306
|
-
- test/acceptance/stub_instance_method_defined_on_object_class_test.rb
|
307
|
-
- test/acceptance/stub_instance_method_defined_on_singleton_class_test.rb
|
308
|
-
- test/acceptance/stub_instance_method_defined_on_superclass_test.rb
|
309
|
-
- test/acceptance/stub_method_defined_on_module_and_aliased_test.rb
|
310
|
-
- test/acceptance/stub_module_method_test.rb
|
311
|
-
- test/acceptance/stub_test.rb
|
312
|
-
- test/acceptance/stubba_example_test.rb
|
313
|
-
- test/acceptance/stubba_test_result_test.rb
|
314
|
-
- test/acceptance/stubbing_error_backtrace_test.rb
|
315
|
-
- test/acceptance/stubbing_frozen_object_test.rb
|
316
|
-
- test/acceptance/stubbing_method_accepting_block_parameter_test.rb
|
317
|
-
- test/acceptance/stubbing_method_unnecessarily_test.rb
|
318
|
-
- test/acceptance/stubbing_nil_test.rb
|
319
|
-
- test/acceptance/stubbing_non_existent_any_instance_method_test.rb
|
320
|
-
- test/acceptance/stubbing_non_existent_class_method_test.rb
|
321
|
-
- test/acceptance/stubbing_non_existent_instance_method_test.rb
|
322
|
-
- test/acceptance/stubbing_non_public_any_instance_method_test.rb
|
323
|
-
- test/acceptance/stubbing_non_public_class_method_test.rb
|
324
|
-
- test/acceptance/stubbing_non_public_instance_method_test.rb
|
325
|
-
- test/acceptance/stubbing_on_non_mock_object_test.rb
|
326
|
-
- test/acceptance/stubbing_same_class_method_on_parent_and_child_classes_test.rb
|
327
|
-
- test/acceptance/throw_test.rb
|
328
|
-
- test/acceptance/unexpected_invocation_test.rb
|
329
|
-
- test/acceptance/unstubbing_test.rb
|
330
|
-
- test/assertions.rb
|
331
|
-
- test/deprecation_disabler.rb
|
332
|
-
- test/execution_point.rb
|
333
|
-
- test/integration/mini_test_test.rb
|
334
|
-
- test/integration/shared_tests.rb
|
335
|
-
- test/integration/test_unit_test.rb
|
336
|
-
- test/method_definer.rb
|
337
|
-
- test/mini_test_result.rb
|
338
|
-
- test/minitest_result.rb
|
339
|
-
- test/simple_counter.rb
|
340
|
-
- test/test_helper.rb
|
341
|
-
- test/test_runner.rb
|
342
|
-
- test/test_unit_result.rb
|
343
|
-
- test/unit/any_instance_method_test.rb
|
344
|
-
- test/unit/array_inspect_test.rb
|
345
|
-
- test/unit/backtrace_filter_test.rb
|
346
|
-
- test/unit/cardinality_test.rb
|
347
|
-
- test/unit/central_test.rb
|
348
|
-
- test/unit/change_state_side_effect_test.rb
|
349
|
-
- test/unit/class_methods_test.rb
|
350
|
-
- test/unit/configuration_test.rb
|
351
|
-
- test/unit/date_time_inspect_test.rb
|
352
|
-
- test/unit/exception_raiser_test.rb
|
353
|
-
- test/unit/expectation_list_test.rb
|
354
|
-
- test/unit/expectation_test.rb
|
355
|
-
- test/unit/hash_inspect_test.rb
|
356
|
-
- test/unit/hooks_test.rb
|
357
|
-
- test/unit/in_state_ordering_constraint_test.rb
|
358
|
-
- test/unit/instance_method_test.rb
|
359
|
-
- test/unit/method_matcher_test.rb
|
360
|
-
- test/unit/mock_test.rb
|
361
|
-
- test/unit/mockery_test.rb
|
362
|
-
- test/unit/module_methods_test.rb
|
363
|
-
- test/unit/multiple_yields_test.rb
|
364
|
-
- test/unit/no_yields_test.rb
|
365
|
-
- test/unit/object_inspect_test.rb
|
366
|
-
- test/unit/object_methods_test.rb
|
367
|
-
- test/unit/parameter_matchers/all_of_test.rb
|
368
|
-
- test/unit/parameter_matchers/any_of_test.rb
|
369
|
-
- test/unit/parameter_matchers/anything_test.rb
|
370
|
-
- test/unit/parameter_matchers/equals_test.rb
|
371
|
-
- test/unit/parameter_matchers/equivalent_uri_test.rb
|
372
|
-
- test/unit/parameter_matchers/has_entries_test.rb
|
373
|
-
- test/unit/parameter_matchers/has_entry_test.rb
|
374
|
-
- test/unit/parameter_matchers/has_key_test.rb
|
375
|
-
- test/unit/parameter_matchers/has_value_test.rb
|
376
|
-
- test/unit/parameter_matchers/includes_test.rb
|
377
|
-
- test/unit/parameter_matchers/instance_of_test.rb
|
378
|
-
- test/unit/parameter_matchers/is_a_test.rb
|
379
|
-
- test/unit/parameter_matchers/kind_of_test.rb
|
380
|
-
- test/unit/parameter_matchers/not_test.rb
|
381
|
-
- test/unit/parameter_matchers/regexp_matches_test.rb
|
382
|
-
- test/unit/parameter_matchers/responds_with_test.rb
|
383
|
-
- test/unit/parameter_matchers/stub_matcher.rb
|
384
|
-
- test/unit/parameter_matchers/yaml_equivalent_test.rb
|
385
|
-
- test/unit/parameters_matcher_test.rb
|
386
|
-
- test/unit/receivers_test.rb
|
387
|
-
- test/unit/return_values_test.rb
|
388
|
-
- test/unit/sequence_test.rb
|
389
|
-
- test/unit/single_return_value_test.rb
|
390
|
-
- test/unit/single_yield_test.rb
|
391
|
-
- test/unit/state_machine_test.rb
|
392
|
-
- test/unit/string_inspect_test.rb
|
393
|
-
- test/unit/thrower_test.rb
|
394
|
-
- test/unit/yield_parameters_test.rb
|
395
193
|
- yard-templates/default/layout/html/google_analytics.erb
|
396
194
|
- yard-templates/default/layout/html/setup.rb
|
397
195
|
homepage: https://mocha.jamesmead.org
|
@@ -399,7 +197,7 @@ licenses:
|
|
399
197
|
- MIT
|
400
198
|
- BSD-2-Clause
|
401
199
|
metadata: {}
|
402
|
-
post_install_message:
|
200
|
+
post_install_message:
|
403
201
|
rdoc_options: []
|
404
202
|
require_paths:
|
405
203
|
- lib
|
@@ -415,7 +213,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
415
213
|
version: '0'
|
416
214
|
requirements: []
|
417
215
|
rubygems_version: 3.0.3
|
418
|
-
signing_key:
|
216
|
+
signing_key:
|
419
217
|
specification_version: 4
|
420
218
|
summary: Mocking and stubbing library
|
421
219
|
test_files: []
|