mocha 1.12.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -13
  3. data/.yardopts +0 -1
  4. data/CONTRIBUTING.md +1 -1
  5. data/COPYING.md +2 -2
  6. data/Gemfile +27 -0
  7. data/MIT-LICENSE.md +1 -1
  8. data/README.md +12 -8
  9. data/RELEASE.md +169 -0
  10. data/Rakefile +22 -29
  11. data/gemfiles/Gemfile.minitest.latest +1 -0
  12. data/gemfiles/Gemfile.test-unit.latest +2 -5
  13. data/lib/mocha/any_instance_method.rb +0 -5
  14. data/lib/mocha/api.rb +29 -78
  15. data/lib/mocha/backtrace_filter.rb +2 -2
  16. data/lib/mocha/class_methods.rb +2 -2
  17. data/lib/mocha/configuration.rb +36 -114
  18. data/lib/mocha/debug.rb +2 -5
  19. data/lib/mocha/expectation.rb +63 -8
  20. data/lib/mocha/inspect.rb +6 -4
  21. data/lib/mocha/instance_method.rb +0 -4
  22. data/lib/mocha/integration/mini_test/adapter.rb +1 -1
  23. data/lib/mocha/integration/mini_test.rb +10 -38
  24. data/lib/mocha/integration/test_unit/adapter.rb +4 -4
  25. data/lib/mocha/integration/test_unit.rb +10 -33
  26. data/lib/mocha/invocation.rb +12 -16
  27. data/lib/mocha/minitest.rb +2 -4
  28. data/lib/mocha/mock.rb +32 -32
  29. data/lib/mocha/mockery.rb +1 -3
  30. data/lib/mocha/names.rb +1 -1
  31. data/lib/mocha/parameter_matchers/base.rb +1 -1
  32. data/lib/mocha/parameter_matchers/equivalent_uri.rb +1 -2
  33. data/lib/mocha/parameter_matchers/has_entry.rb +22 -13
  34. data/lib/mocha/parameter_matchers/has_keys.rb +53 -0
  35. data/lib/mocha/parameter_matchers/instance_methods.rb +10 -1
  36. data/lib/mocha/parameter_matchers/positional_or_keyword_hash.rb +64 -0
  37. data/lib/mocha/parameter_matchers.rb +1 -0
  38. data/lib/mocha/parameters_matcher.rb +3 -3
  39. data/lib/mocha/ruby_version.rb +1 -2
  40. data/lib/mocha/stubbed_method.rb +5 -42
  41. data/lib/mocha/test_unit.rb +2 -4
  42. data/lib/mocha/version.rb +1 -1
  43. data/lib/mocha.rb +0 -8
  44. data/mocha.gemspec +4 -29
  45. metadata +10 -87
  46. data/bin/build-matrix +0 -82
  47. data/gemfiles/Gemfile.minitest.1.3.0 +0 -7
  48. data/gemfiles/Gemfile.minitest.1.4.0 +0 -7
  49. data/gemfiles/Gemfile.minitest.1.4.1 +0 -7
  50. data/gemfiles/Gemfile.minitest.1.4.2 +0 -7
  51. data/gemfiles/Gemfile.minitest.2.0.0 +0 -7
  52. data/gemfiles/Gemfile.minitest.2.0.1 +0 -7
  53. data/gemfiles/Gemfile.minitest.2.11.0 +0 -7
  54. data/gemfiles/Gemfile.minitest.2.11.2 +0 -7
  55. data/gemfiles/Gemfile.minitest.2.3.0 +0 -7
  56. data/gemfiles/Gemfile.minitest.5.11.3 +0 -7
  57. data/gemfiles/Gemfile.test-unit.2.0.0 +0 -7
  58. data/gemfiles/Gemfile.test-unit.2.0.1 +0 -7
  59. data/gemfiles/Gemfile.test-unit.2.0.3 +0 -7
  60. data/init.rb +0 -1
  61. data/lib/mocha/integration/mini_test/nothing.rb +0 -19
  62. data/lib/mocha/integration/mini_test/version_13.rb +0 -54
  63. data/lib/mocha/integration/mini_test/version_140.rb +0 -54
  64. data/lib/mocha/integration/mini_test/version_141.rb +0 -65
  65. data/lib/mocha/integration/mini_test/version_142_to_172.rb +0 -65
  66. data/lib/mocha/integration/mini_test/version_200.rb +0 -66
  67. data/lib/mocha/integration/mini_test/version_201_to_222.rb +0 -66
  68. data/lib/mocha/integration/mini_test/version_2110_to_2111.rb +0 -70
  69. data/lib/mocha/integration/mini_test/version_2112_to_320.rb +0 -73
  70. data/lib/mocha/integration/mini_test/version_230_to_2101.rb +0 -68
  71. data/lib/mocha/integration/test_unit/gem_version_200.rb +0 -62
  72. data/lib/mocha/integration/test_unit/gem_version_201_to_202.rb +0 -62
  73. data/lib/mocha/integration/test_unit/gem_version_203_to_220.rb +0 -62
  74. data/lib/mocha/integration/test_unit/gem_version_230_to_250.rb +0 -68
  75. data/lib/mocha/integration/test_unit/nothing.rb +0 -19
  76. data/lib/mocha/integration/test_unit/ruby_version_185_and_below.rb +0 -61
  77. data/lib/mocha/integration/test_unit/ruby_version_186_and_above.rb +0 -63
  78. data/lib/mocha/integration.rb +0 -11
  79. data/lib/mocha/setup.rb +0 -14
  80. data/lib/mocha/singleton_class.rb +0 -9
  81. data/yard-templates/default/layout/html/google_analytics.erb +0 -8
  82. data/yard-templates/default/layout/html/setup.rb +0 -5
@@ -1,5 +1,5 @@
1
+ require 'ruby2_keywords'
1
2
  require 'mocha/ruby_version'
2
- require 'mocha/singleton_class'
3
3
 
4
4
  module Mocha
5
5
  class StubbedMethod
@@ -11,7 +11,7 @@ module Mocha
11
11
  @stubbee = stubbee
12
12
  @original_method = nil
13
13
  @original_visibility = nil
14
- @method_name = PRE_RUBY_V19 ? method_name.to_s : method_name.to_sym
14
+ @method_name = method_name.to_sym
15
15
  end
16
16
 
17
17
  def stub
@@ -21,7 +21,6 @@ module Mocha
21
21
 
22
22
  def unstub
23
23
  remove_new_method
24
- restore_original_method
25
24
  mock.unstub(method_name.to_sym)
26
25
  return if mock.any_expectations?
27
26
  reset_mocha
@@ -38,28 +37,16 @@ module Mocha
38
37
  def hide_original_method
39
38
  return unless original_method_owner.__method_exists__?(method_name)
40
39
  store_original_method_visibility
41
- if use_prepended_module_for_stub_method?
42
- use_prepended_module_for_stub_method
43
- else
44
- begin
45
- store_original_method
46
- # rubocop:disable Lint/HandleExceptions
47
- rescue NameError
48
- # deal with nasties like ActiveRecord::Associations::AssociationProxy
49
- end
50
- # rubocop:enable Lint/HandleExceptions
51
- if stub_method_overwrites_original_method?
52
- remove_original_method_from_stubbee
53
- end
54
- end
40
+ use_prepended_module_for_stub_method
55
41
  end
56
42
 
57
43
  def define_new_method
58
44
  self_in_scope = self
59
45
  method_name_in_scope = method_name
60
46
  stub_method_owner.send(:define_method, method_name) do |*args, &block|
61
- self_in_scope.mock.method_missing(method_name_in_scope, *args, &block)
47
+ self_in_scope.mock.handle_method_call(method_name_in_scope, args, block)
62
48
  end
49
+ stub_method_owner.send(:ruby2_keywords, method_name)
63
50
  retain_original_visibility(stub_method_owner)
64
51
  end
65
52
 
@@ -67,18 +54,6 @@ module Mocha
67
54
  stub_method_owner.send(:remove_method, method_name)
68
55
  end
69
56
 
70
- def store_original_method
71
- @original_method = stubbee_method(method_name)
72
- end
73
-
74
- def restore_original_method
75
- return if use_prepended_module_for_stub_method?
76
- if stub_method_overwrites_original_method?
77
- original_method_owner.send(:define_method, method_name, method_body(@original_method))
78
- end
79
- retain_original_visibility(original_method_owner)
80
- end
81
-
82
57
  def matches?(other)
83
58
  return false unless other.class == self.class
84
59
  (stubbee.object_id == other.stubbee.object_id) && (method_name == other.method_name)
@@ -101,18 +76,6 @@ module Mocha
101
76
  @original_visibility = original_method_owner.__method_visibility__(method_name)
102
77
  end
103
78
 
104
- def stub_method_overwrites_original_method?
105
- @original_method && @original_method.owner == original_method_owner
106
- end
107
-
108
- def remove_original_method_from_stubbee
109
- original_method_owner.send(:remove_method, method_name)
110
- end
111
-
112
- def use_prepended_module_for_stub_method?
113
- RUBY_V2_PLUS
114
- end
115
-
116
79
  def use_prepended_module_for_stub_method
117
80
  @stub_method_owner = PrependedModule.new
118
81
  original_method_owner.__send__ :prepend, @stub_method_owner
@@ -1,8 +1,6 @@
1
+ require 'mocha/ruby_version'
1
2
  require 'mocha/integration/test_unit'
2
- require 'mocha/deprecation'
3
3
 
4
4
  unless Mocha::Integration::TestUnit.activate
5
- Mocha::Deprecation.warning(
6
- "Test::Unit must be loaded *before* `require 'mocha/test_unit'`."
7
- )
5
+ raise "Test::Unit must be loaded *before* `require 'mocha/test_unit'`."
8
6
  end
data/lib/mocha/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mocha
2
- VERSION = '1.12.0'.freeze
2
+ VERSION = '2.1.0'.freeze
3
3
  end
data/lib/mocha.rb CHANGED
@@ -1,9 +1 @@
1
1
  require 'mocha/version'
2
- require 'mocha/ruby_version'
3
- require 'mocha/deprecation'
4
-
5
- if Mocha::PRE_RUBY_V19
6
- Mocha::Deprecation.warning(
7
- 'Versions of Ruby earlier than v1.9 will not be supported in future versions of Mocha.'
8
- )
9
- end
data/mocha.gemspec CHANGED
@@ -2,11 +2,11 @@ lib = File.expand_path('../lib/', __FILE__)
2
2
  $LOAD_PATH.unshift lib unless $LOAD_PATH.include?(lib)
3
3
  require 'mocha/version'
4
4
 
5
- Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength
5
+ Gem::Specification.new do |s|
6
6
  s.name = 'mocha'
7
7
  s.version = Mocha::VERSION
8
8
  s.licenses = ['MIT', 'BSD-2-Clause']
9
- s.required_ruby_version = '>= 1.8.7'
9
+ s.required_ruby_version = '>= 2.0'
10
10
 
11
11
  s.authors = ['James Mead']
12
12
  s.description = 'Mocking and stubbing library with JMock/SchMock syntax, which allows mocking and stubbing of methods on real (non-mock) classes.'
@@ -15,37 +15,12 @@ Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength
15
15
  s.files = Dir.chdir(File.expand_path('..', __FILE__)) do
16
16
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(docs|test)/}) }
17
17
  end
18
- s.files.delete('.travis.yml')
18
+ s.files.delete('.circleci/config.yml')
19
19
  s.files.delete('.gitignore')
20
20
 
21
21
  s.homepage = 'https://mocha.jamesmead.org'
22
22
  s.require_paths = ['lib']
23
23
  s.summary = 'Mocking and stubbing library'
24
24
 
25
- unless s.respond_to?(:add_development_dependency)
26
- class << s
27
- def add_development_dependency(*args)
28
- add_dependency(*args)
29
- end
30
- end
31
- end
32
-
33
- if RUBY_VERSION >= '1.9.3'
34
- s.add_development_dependency('rake')
35
- else
36
- # Rake >= v11 does not support Ruby < v1.9.3 so use
37
- s.add_development_dependency('rake', '~> 10.0')
38
- end
39
- s.add_development_dependency('introspection', '~> 0.0.1')
40
- if RUBY_VERSION >= '2.2.0'
41
- # No test libraries in standard library
42
- s.add_development_dependency('minitest')
43
- end
44
- if RUBY_VERSION >= '1.9.2'
45
- s.add_development_dependency('rubocop', '<= 0.58.2')
46
- end
47
- if ENV['MOCHA_GENERATE_DOCS']
48
- s.add_development_dependency('redcarpet')
49
- s.add_development_dependency('yard')
50
- end
25
+ s.add_runtime_dependency 'ruby2_keywords', '>= 0.0.5'
51
26
  end
metadata CHANGED
@@ -1,71 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mocha
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Mead
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-23 00:00:00.000000000 Z
11
+ date: 2023-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rake
14
+ name: ruby2_keywords
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
19
+ version: 0.0.5
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: introspection
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - "~>"
32
- - !ruby/object:Gem::Version
33
- version: 0.0.1
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - "~>"
39
- - !ruby/object:Gem::Version
40
- version: 0.0.1
41
- - !ruby/object:Gem::Dependency
42
- name: minitest
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: rubocop
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "<="
60
- - !ruby/object:Gem::Version
61
- version: 0.58.2
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "<="
67
- - !ruby/object:Gem::Version
68
- version: 0.58.2
26
+ version: 0.0.5
69
27
  description: Mocking and stubbing library with JMock/SchMock syntax, which allows
70
28
  mocking and stubbing of methods on real (non-mock) classes.
71
29
  email: mocha-developer@googlegroups.com
@@ -85,23 +43,8 @@ files:
85
43
  - README.md
86
44
  - RELEASE.md
87
45
  - Rakefile
88
- - bin/build-matrix
89
- - gemfiles/Gemfile.minitest.1.3.0
90
- - gemfiles/Gemfile.minitest.1.4.0
91
- - gemfiles/Gemfile.minitest.1.4.1
92
- - gemfiles/Gemfile.minitest.1.4.2
93
- - gemfiles/Gemfile.minitest.2.0.0
94
- - gemfiles/Gemfile.minitest.2.0.1
95
- - gemfiles/Gemfile.minitest.2.11.0
96
- - gemfiles/Gemfile.minitest.2.11.2
97
- - gemfiles/Gemfile.minitest.2.3.0
98
- - gemfiles/Gemfile.minitest.5.11.3
99
46
  - gemfiles/Gemfile.minitest.latest
100
- - gemfiles/Gemfile.test-unit.2.0.0
101
- - gemfiles/Gemfile.test-unit.2.0.1
102
- - gemfiles/Gemfile.test-unit.2.0.3
103
47
  - gemfiles/Gemfile.test-unit.latest
104
- - init.rb
105
48
  - lib/mocha.rb
106
49
  - lib/mocha/any_instance_method.rb
107
50
  - lib/mocha/api.rb
@@ -127,31 +70,13 @@ files:
127
70
  - lib/mocha/in_state_ordering_constraint.rb
128
71
  - lib/mocha/inspect.rb
129
72
  - lib/mocha/instance_method.rb
130
- - lib/mocha/integration.rb
131
73
  - lib/mocha/integration/assertion_counter.rb
132
74
  - lib/mocha/integration/mini_test.rb
133
75
  - lib/mocha/integration/mini_test/adapter.rb
134
76
  - lib/mocha/integration/mini_test/exception_translation.rb
135
- - lib/mocha/integration/mini_test/nothing.rb
136
- - lib/mocha/integration/mini_test/version_13.rb
137
- - lib/mocha/integration/mini_test/version_140.rb
138
- - lib/mocha/integration/mini_test/version_141.rb
139
- - lib/mocha/integration/mini_test/version_142_to_172.rb
140
- - lib/mocha/integration/mini_test/version_200.rb
141
- - lib/mocha/integration/mini_test/version_201_to_222.rb
142
- - lib/mocha/integration/mini_test/version_2110_to_2111.rb
143
- - lib/mocha/integration/mini_test/version_2112_to_320.rb
144
- - lib/mocha/integration/mini_test/version_230_to_2101.rb
145
77
  - lib/mocha/integration/monkey_patcher.rb
146
78
  - lib/mocha/integration/test_unit.rb
147
79
  - lib/mocha/integration/test_unit/adapter.rb
148
- - lib/mocha/integration/test_unit/gem_version_200.rb
149
- - lib/mocha/integration/test_unit/gem_version_201_to_202.rb
150
- - lib/mocha/integration/test_unit/gem_version_203_to_220.rb
151
- - lib/mocha/integration/test_unit/gem_version_230_to_250.rb
152
- - lib/mocha/integration/test_unit/nothing.rb
153
- - lib/mocha/integration/test_unit/ruby_version_185_and_below.rb
154
- - lib/mocha/integration/test_unit/ruby_version_186_and_above.rb
155
80
  - lib/mocha/invocation.rb
156
81
  - lib/mocha/is_a.rb
157
82
  - lib/mocha/logger.rb
@@ -174,6 +99,7 @@ files:
174
99
  - lib/mocha/parameter_matchers/has_entries.rb
175
100
  - lib/mocha/parameter_matchers/has_entry.rb
176
101
  - lib/mocha/parameter_matchers/has_key.rb
102
+ - lib/mocha/parameter_matchers/has_keys.rb
177
103
  - lib/mocha/parameter_matchers/has_value.rb
178
104
  - lib/mocha/parameter_matchers/includes.rb
179
105
  - lib/mocha/parameter_matchers/instance_methods.rb
@@ -182,6 +108,7 @@ files:
182
108
  - lib/mocha/parameter_matchers/kind_of.rb
183
109
  - lib/mocha/parameter_matchers/not.rb
184
110
  - lib/mocha/parameter_matchers/optionally.rb
111
+ - lib/mocha/parameter_matchers/positional_or_keyword_hash.rb
185
112
  - lib/mocha/parameter_matchers/regexp_matches.rb
186
113
  - lib/mocha/parameter_matchers/responds_with.rb
187
114
  - lib/mocha/parameter_matchers/yaml_equivalent.rb
@@ -191,9 +118,7 @@ files:
191
118
  - lib/mocha/return_values.rb
192
119
  - lib/mocha/ruby_version.rb
193
120
  - lib/mocha/sequence.rb
194
- - lib/mocha/setup.rb
195
121
  - lib/mocha/single_return_value.rb
196
- - lib/mocha/singleton_class.rb
197
122
  - lib/mocha/state_machine.rb
198
123
  - lib/mocha/stubbed_method.rb
199
124
  - lib/mocha/stubbing_error.rb
@@ -203,8 +128,6 @@ files:
203
128
  - lib/mocha/version.rb
204
129
  - lib/mocha/yield_parameters.rb
205
130
  - mocha.gemspec
206
- - yard-templates/default/layout/html/google_analytics.erb
207
- - yard-templates/default/layout/html/setup.rb
208
131
  homepage: https://mocha.jamesmead.org
209
132
  licenses:
210
133
  - MIT
@@ -218,14 +141,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
218
141
  requirements:
219
142
  - - ">="
220
143
  - !ruby/object:Gem::Version
221
- version: 1.8.7
144
+ version: '2.0'
222
145
  required_rubygems_version: !ruby/object:Gem::Requirement
223
146
  requirements:
224
147
  - - ">="
225
148
  - !ruby/object:Gem::Version
226
149
  version: '0'
227
150
  requirements: []
228
- rubygems_version: 3.0.3
151
+ rubygems_version: 3.4.1
229
152
  signing_key:
230
153
  specification_version: 4
231
154
  summary: Mocking and stubbing library
data/bin/build-matrix DELETED
@@ -1,82 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require 'yaml'
4
- require 'set'
5
- require 'English'
6
-
7
- def execute(*commands)
8
- commands.each do |command|
9
- system(command)
10
- next if $CHILD_STATUS.success?
11
- message = [
12
- 'Executing shell command failed.',
13
- " Command: #{command}",
14
- " Status: #{$CHILD_STATUS.exitstatus}"
15
- ].join("\n")
16
- raise message
17
- end
18
- end
19
-
20
- def reset_bundle
21
- execute(
22
- 'rm -rf .bundle/gems',
23
- 'rm -rf gemfiles/.bundle/gems',
24
- 'rm -f *.lock',
25
- 'rm -f gemfiles/*.lock'
26
- )
27
- end
28
-
29
- def with_rbenv(command)
30
- %{export PATH="$HOME/.rbenv/bin:$PATH"; eval "$(rbenv init -)"; #{command}}
31
- end
32
-
33
- def run(ruby_version, gemfile, task = 'test')
34
- ENV['RBENV_VERSION'] = ruby_version
35
- ENV['BUNDLE_GEMFILE'] = gemfile
36
- ENV['MOCHA_OPTIONS'] = 'debug'
37
- reset_bundle
38
- execute(
39
- with_rbenv("bundle install --gemfile=#{gemfile}"),
40
- with_rbenv("bundle exec rake #{task}")
41
- )
42
- end
43
-
44
- AVAILABLE_RUBY_VERSIONS = `rbenv versions --bare`.split("\n")
45
-
46
- travis_config = YAML.safe_load(File.read('.travis.yml'))
47
- build_configs = travis_config['matrix']['include']
48
- travis_config['rvm'].each do |ruby_version|
49
- travis_config['gemfile'].each do |gemfile|
50
- travis_config['env'].each do |env|
51
- build_configs << { 'rvm' => ruby_version, 'gemfile' => gemfile, 'env' => env }
52
- end
53
- end
54
- end
55
-
56
- missing_ruby_versions = Set.new
57
-
58
- build_configs.each do |config|
59
- ruby_version = config['rvm']
60
- gemfile = config['gemfile']
61
- environment_variables = Hash[*config['env'].split.flat_map { |e| e.split('=') }]
62
- original_environment_variables = {}
63
- begin
64
- environment_variables.each do |k, v|
65
- original_environment_variables[k] = ENV[k]
66
- ENV[k] = v
67
- end
68
- if AVAILABLE_RUBY_VERSIONS.include?(ruby_version)
69
- puts
70
- puts "Ruby v#{ruby_version}; Gemfile path: #{gemfile}; Environment: #{environment_variables}"
71
- run(ruby_version, gemfile)
72
- else
73
- missing_ruby_versions << ruby_version
74
- end
75
- ensure
76
- original_environment_variables.each do |k, v|
77
- ENV[k] = v
78
- end
79
- end
80
- end
81
-
82
- puts "Missing Ruby versions: #{missing_ruby_versions.to_a.join(', ')}"
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path=>"../"
4
-
5
- group :development do
6
- gem "minitest", "1.3.0"
7
- end
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path=>"../"
4
-
5
- group :development do
6
- gem "minitest", "1.4.0"
7
- end
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path=>"../"
4
-
5
- group :development do
6
- gem "minitest", "1.4.1"
7
- end
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path=>"../"
4
-
5
- group :development do
6
- gem "minitest", "1.4.2"
7
- end
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path=>"../"
4
-
5
- group :development do
6
- gem "minitest", "2.0.0"
7
- end
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path=>"../"
4
-
5
- group :development do
6
- gem "minitest", "2.0.1"
7
- end
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path=>"../"
4
-
5
- group :development do
6
- gem "minitest", "2.11.0"
7
- end
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path=>"../"
4
-
5
- group :development do
6
- gem "minitest", "2.11.2"
7
- end
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path=>"../"
4
-
5
- group :development do
6
- gem "minitest", "2.3.0"
7
- end
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path=>"../"
4
-
5
- group :development do
6
- gem "minitest", "5.11.3"
7
- end
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path=>"../"
4
-
5
- group :development do
6
- gem "test-unit", "2.0.0"
7
- end
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path=>"../"
4
-
5
- group :development do
6
- gem "test-unit", "2.0.1"
7
- end
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec :path=>"../"
4
-
5
- group :development do
6
- gem "test-unit", "2.0.3"
7
- end
data/init.rb DELETED
@@ -1 +0,0 @@
1
- warn 'Mocha deprecation warning: The old-style Rails plugin will not be supported in future versions of Mocha.'
@@ -1,19 +0,0 @@
1
- module Mocha
2
- module Integration
3
- module MiniTest
4
- module Nothing
5
- def self.applicable_to?(_test_unit_version, _ruby_version = nil)
6
- true
7
- end
8
-
9
- def self.description
10
- 'nothing (no MiniTest integration available)'
11
- end
12
-
13
- def self.included(_mod)
14
- raise 'No MiniTest integration available'
15
- end
16
- end
17
- end
18
- end
19
- end
@@ -1,54 +0,0 @@
1
- require 'mocha/integration/assertion_counter'
2
- require 'mocha/integration/monkey_patcher'
3
- require 'mocha/integration/mini_test/exception_translation'
4
-
5
- module Mocha
6
- module Integration
7
- module MiniTest
8
- module Version13
9
- def self.applicable_to?(mini_test_version)
10
- Gem::Requirement.new('>= 1.3.0', '<= 1.3.1').satisfied_by?(mini_test_version)
11
- end
12
-
13
- def self.description
14
- 'monkey patch for MiniTest gem v1.3'
15
- end
16
-
17
- def self.included(mod)
18
- MonkeyPatcher.apply(mod, RunMethodPatch)
19
- end
20
-
21
- module RunMethodPatch
22
- # rubocop:disable all
23
- def run runner
24
- assertion_counter = AssertionCounter.new(self)
25
- result = '.'
26
- begin
27
- begin
28
- @passed = nil
29
- mocha_setup
30
- self.setup
31
- self.__send__ self.name
32
- mocha_verify(assertion_counter)
33
- @passed = true
34
- rescue Exception => e
35
- @passed = false
36
- result = runner.puke(self.class, self.name, Mocha::Integration::MiniTest.translate(e))
37
- ensure
38
- begin
39
- self.teardown
40
- rescue Exception => e
41
- result = runner.puke(self.class, self.name, Mocha::Integration::MiniTest.translate(e))
42
- end
43
- end
44
- ensure
45
- mocha_teardown
46
- end
47
- result
48
- end
49
- # rubocop:enable all
50
- end
51
- end
52
- end
53
- end
54
- end