mocha 1.13.0 → 1.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 77366bffa410729ac6089097db85ded323e74d1ec7bc6eb0ea13ae4a18b44eac
4
- data.tar.gz: f9f3c89bbc29393e99ec62e0d1395ed4fa4863d0f790d24bbe6be3537450e4c1
3
+ metadata.gz: fc815752f26d71dc07dcbe29561835e3efd005f8602ada080106a8b000491276
4
+ data.tar.gz: d14e6b7be4792efe68f48eb13c084a151a6e26fe3bd30f85491a990947474ab7
5
5
  SHA512:
6
- metadata.gz: 91e277be3c868ef2f6655016a53f040835b8e9d6390c789b6f047be72e9b96726865eefcb161b86d0f8e89ead1c58e9adbf1a1cbcdf9cba8a0f0b536de86222d
7
- data.tar.gz: 4b7bf751e350762a5a3d9cd17fbe1a590ff5122a718417b75304fa86f8323b20652a24584cedabd859395aeef004402e57c70c15cd88746032659b0d9df4cccf
6
+ metadata.gz: ca77565fde00fa34b850e95072bb32d2daf2886ddaef4ec084b6c462f4d1a8d6104ae1c5ac35f49414d3ed28527589608582b49d7ff1352388642ce710039f0d
7
+ data.tar.gz: 0dab5223dde0fbd762b2a3ff92a7574f771ebcf9e8f5ec032697a3a3a7da96f6d892395b7decec1ad31512138d3f198850b5e1f20aada1885074491b13a57fb3
data/Gemfile CHANGED
@@ -1,3 +1,34 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+
5
+ # rubocop:disable Bundler/DuplicatedGem
6
+ if RUBY_VERSION < '1.9.3'
7
+ gem 'rake', '~> 10.0'
8
+ elsif RUBY_VERSION < '2'
9
+ gem 'rake', '~> 12.2.1'
10
+ elsif RUBY_VERSION < '2.2'
11
+ gem 'rake', '~> 12.3.3'
12
+ else
13
+ gem 'rake'
14
+ end
15
+ # rubocop:enable Bundler/DuplicatedGem
16
+
17
+ gem 'introspection', '~> 0.0.1'
18
+
19
+ # Avoid breaking change in psych v4 (https://bugs.ruby-lang.org/issues/17866)
20
+ if RUBY_VERSION >= '3.1.0'
21
+ gem 'psych', '< 4'
22
+ end
23
+
24
+ if RUBY_VERSION >= '2.2.0'
25
+ # No test libraries in standard library
26
+ gem 'minitest'
27
+ end
28
+ if RUBY_VERSION >= '2.2.0'
29
+ gem 'rubocop', '<= 0.58.2'
30
+ end
31
+ if ENV['MOCHA_GENERATE_DOCS']
32
+ gem 'redcarpet'
33
+ gem 'yard'
34
+ end
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## Mocha [![CircleCI status of freerange/mocha](https://circleci.com/gh/freerange/mocha.svg?style=shield&circle-token=bc1f6576c77da43ec58badde9273fa4eb1d7f53a)](https://app.circleci.com/pipelines/github/freerange/mocha) [![Gem Version](https://badge.fury.io/rb/mocha.svg)](http://badge.fury.io/rb/mocha) [![SemVer](https://api.dependabot.com/badges/compatibility_score?dependency-name=mocha&package-manager=bundler&version-scheme=semver)](https://dependabot.com/compatibility-score.html?dependency-name=mocha&package-manager=bundler&version-scheme=semver)
1
+ ## Mocha [![CircleCI status of freerange/mocha](https://circleci.com/gh/freerange/mocha.svg?style=shield&circle-token=bc1f6576c77da43ec58badde9273fa4eb1d7f53a)](https://app.circleci.com/pipelines/github/freerange/mocha) [![Gem Version](https://badge.fury.io/rb/mocha.svg)](http://badge.fury.io/rb/mocha)
2
2
 
3
3
  ### Description
4
4
 
@@ -338,7 +338,7 @@ $ MOCHA_GENERATE_DOCS=true GOOGLE_ANALYTICS_WEB_PROPERTY_ID=UA-625523-7 rake gen
338
338
  * Sign in to rubygems.org and find API key - https://rubygems.org/profile/edit
339
339
 
340
340
  ```bash
341
- $ curl -u james@floehopper.org https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials`
341
+ $ curl -u james@floehopper.org https://rubygems.org/api/v1/api_key.yaml > ~/.gem/credentials; chmod 0600 ~/.gem/credentials
342
342
  ```
343
343
 
344
344
  * Release gem to Rubygems:
data/RELEASE.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Release Notes
2
2
 
3
+ ## 1.14.0
4
+
5
+ ### External changes
6
+
7
+ * Mock#expects,#stubs should return last expectation - thanks to @vlad-pisanov for #524 (b6b637db)
8
+
9
+ ### Internal changes
10
+
11
+ * Avoid breaking change in psych v4 in ruby v3.1 (08b9f4ca)
12
+ * Remove broken Dependabot badge from README (d446657a)
13
+ * Add Ruby 3.0 to the CI matrix - thanks to @mishina2228 for #526 (65bc626e)
14
+ * Move development dependencies from gemspec to Gemfile - thanks to @mishina2228 for #527 (dd127f7b)
15
+
3
16
  ## 1.13.0
4
17
 
5
18
  ### External changes
@@ -3,5 +3,6 @@ source 'https://rubygems.org'
3
3
  gemspec :path=>"../"
4
4
 
5
5
  group :development do
6
+ gem "rake"
6
7
  gem "minitest"
7
8
  end
@@ -3,6 +3,7 @@ source 'https://rubygems.org'
3
3
  gemspec :path=>"../"
4
4
 
5
5
  group :development do
6
+ gem "rake"
6
7
  if RUBY_VERSION < '1.9'
7
8
  gem "test-unit", "~> 2"
8
9
  else
data/lib/mocha/mock.rb CHANGED
@@ -109,6 +109,7 @@ module Mocha
109
109
  # object.expects(:expected_method_one).returns(:result_one)
110
110
  # object.expects(:expected_method_two).returns(:result_two)
111
111
  def expects(method_name_or_hash, backtrace = nil)
112
+ expectation = nil
112
113
  iterator = ArgumentIterator.new(method_name_or_hash)
113
114
  iterator.each do |*args|
114
115
  method_name = args.shift
@@ -117,6 +118,7 @@ module Mocha
117
118
  expectation.returns(args.shift) unless args.empty?
118
119
  @expectations.add(expectation)
119
120
  end
121
+ expectation
120
122
  end
121
123
 
122
124
  # Adds an expectation that the specified method may be called any number of times with any parameters.
@@ -145,6 +147,7 @@ module Mocha
145
147
  # object.stubs(:stubbed_method_one).returns(:result_one)
146
148
  # object.stubs(:stubbed_method_two).returns(:result_two)
147
149
  def stubs(method_name_or_hash, backtrace = nil)
150
+ expectation = nil
148
151
  iterator = ArgumentIterator.new(method_name_or_hash)
149
152
  iterator.each do |*args|
150
153
  method_name = args.shift
@@ -154,6 +157,7 @@ module Mocha
154
157
  expectation.returns(args.shift) unless args.empty?
155
158
  @expectations.add(expectation)
156
159
  end
160
+ expectation
157
161
  end
158
162
 
159
163
  # Removes the specified stubbed methods (added by calls to {#expects} or {#stubs}) and all expectations associated with them.
data/lib/mocha/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Mocha
2
- VERSION = '1.13.0'.freeze
2
+ VERSION = '1.14.0'.freeze
3
3
  end
data/mocha.gemspec CHANGED
@@ -2,7 +2,7 @@ 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']
@@ -21,35 +21,4 @@ Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength
21
21
  s.homepage = 'https://mocha.jamesmead.org'
22
22
  s.require_paths = ['lib']
23
23
  s.summary = 'Mocking and stubbing library'
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', '~> 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'
39
- else
40
- s.add_development_dependency 'rake'
41
- end
42
-
43
- s.add_development_dependency('introspection', '~> 0.0.1')
44
- if RUBY_VERSION >= '2.2.0'
45
- # No test libraries in standard library
46
- s.add_development_dependency('minitest')
47
- end
48
- if RUBY_VERSION >= '2.2.0'
49
- s.add_development_dependency('rubocop', '<= 0.58.2')
50
- end
51
- if ENV['MOCHA_GENERATE_DOCS']
52
- s.add_development_dependency('redcarpet')
53
- s.add_development_dependency('yard')
54
- end
55
24
  end
metadata CHANGED
@@ -1,71 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mocha
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 1.14.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: 2021-06-25 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: rake
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
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
11
+ date: 1980-01-01 00:00:00.000000000 Z
12
+ dependencies: []
69
13
  description: Mocking and stubbing library with JMock/SchMock syntax, which allows
70
14
  mocking and stubbing of methods on real (non-mock) classes.
71
15
  email: mocha-developer@googlegroups.com
@@ -212,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
212
156
  - !ruby/object:Gem::Version
213
157
  version: '0'
214
158
  requirements: []
215
- rubygems_version: 3.0.3
159
+ rubygems_version: 3.2.26
216
160
  signing_key:
217
161
  specification_version: 4
218
162
  summary: Mocking and stubbing library