rspec-expectations 3.11.0 → 3.11.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/Changelog.md +11 -1
- data/lib/rspec/expectations/version.rb +1 -1
- data/lib/rspec/matchers/built_in/contain_exactly.rb +10 -2
- data/lib/rspec/matchers/built_in/count_expectation.rb +1 -1
- data/lib/rspec/matchers/built_in/exist.rb +1 -1
- data/lib/rspec/matchers/built_in/raise_error.rb +6 -6
- data/lib/rspec/matchers/built_in/throw_symbol.rb +4 -4
- data/lib/rspec/matchers/dsl.rb +2 -2
- data/lib/rspec/matchers.rb +3 -3
- data.tar.gz.sig +0 -0
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '08d59721f87da7bbd0a7c28b23ee44289f3a0f876675d23f08db3753192524e6'
|
4
|
+
data.tar.gz: ef0d8b4194fab020501b5326cdf8b929d772e3e1c5f37bf89274100ed4f534c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a20276c87a051f5bbe1a8d74b732cb160f2c93f2631b0805118946739379445e88ece39b4deafaeefff65df4b003d3f5f899a2a71dd190e6c82d0c86e63a0bc
|
7
|
+
data.tar.gz: 49b24958098b1e69a9adb1f6b162dfcf945ea96f5a17d5b725cf2488e544d39d9bdcde7fe4c6f2c988653f9f953885e3e603428f83a61032a8bbeb6fa6cbc0f2
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
### Development
|
2
|
-
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.11.
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.11.1...3-11-maintenance)
|
3
|
+
|
4
|
+
### 3.11.1 / 2022-09-12
|
5
|
+
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.11.0...v3.11.1)
|
6
|
+
|
7
|
+
Bug Fixes:
|
8
|
+
|
9
|
+
* Allow the `contain_exactly` matcher to be reused by resetting its
|
10
|
+
internals on `matches?` (@bclayman-sq, #1326)
|
11
|
+
* Using the exist matcher on `FileTest` no longer produces a deprecation warning.
|
12
|
+
(Ryo Nakamura, #1383)
|
3
13
|
|
4
14
|
### 3.11.0 / 2022-02-09
|
5
15
|
[Full Changelog](http://github.com/rspec/rspec-expectations/compare/v3.10.2...v3.11.0)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module RSpec
|
2
2
|
module Matchers
|
3
3
|
module BuiltIn
|
4
|
-
# rubocop:disable ClassLength
|
4
|
+
# rubocop:disable Metrics/ClassLength
|
5
5
|
# @api private
|
6
6
|
# Provides the implementation for `contain_exactly` and `match_array`.
|
7
7
|
# Not intended to be instantiated directly.
|
@@ -31,6 +31,14 @@ module RSpec
|
|
31
31
|
"contain exactly#{list}"
|
32
32
|
end
|
33
33
|
|
34
|
+
def matches?(actual)
|
35
|
+
@pairings_maximizer = nil
|
36
|
+
@best_solution = nil
|
37
|
+
@extra_items = nil
|
38
|
+
@missing_items = nil
|
39
|
+
super(actual)
|
40
|
+
end
|
41
|
+
|
34
42
|
private
|
35
43
|
|
36
44
|
def generate_failure_message
|
@@ -296,7 +304,7 @@ module RSpec
|
|
296
304
|
end
|
297
305
|
end
|
298
306
|
end
|
299
|
-
# rubocop:enable ClassLength
|
307
|
+
# rubocop:enable Metrics/ClassLength
|
300
308
|
end
|
301
309
|
end
|
302
310
|
end
|
@@ -4,8 +4,8 @@ module RSpec
|
|
4
4
|
# @api private
|
5
5
|
# Provides the implementation for `raise_error`.
|
6
6
|
# Not intended to be instantiated directly.
|
7
|
-
# rubocop:disable ClassLength
|
8
|
-
# rubocop:disable RescueException
|
7
|
+
# rubocop:disable Metrics/ClassLength
|
8
|
+
# rubocop:disable Lint/RescueException
|
9
9
|
class RaiseError
|
10
10
|
include Composable
|
11
11
|
|
@@ -43,7 +43,7 @@ module RSpec
|
|
43
43
|
self
|
44
44
|
end
|
45
45
|
|
46
|
-
# rubocop:disable MethodLength
|
46
|
+
# rubocop:disable Metrics/MethodLength
|
47
47
|
# @private
|
48
48
|
def matches?(given_proc, negative_expectation=false, &block)
|
49
49
|
@given_proc = given_proc
|
@@ -73,7 +73,7 @@ module RSpec
|
|
73
73
|
|
74
74
|
expectation_matched?
|
75
75
|
end
|
76
|
-
# rubocop:enable MethodLength
|
76
|
+
# rubocop:enable Metrics/MethodLength
|
77
77
|
|
78
78
|
# @private
|
79
79
|
def does_not_match?(given_proc)
|
@@ -264,8 +264,8 @@ module RSpec
|
|
264
264
|
warning if @actual_error
|
265
265
|
end
|
266
266
|
end
|
267
|
-
# rubocop:enable RescueException
|
268
|
-
# rubocop:enable ClassLength
|
267
|
+
# rubocop:enable Lint/RescueException
|
268
|
+
# rubocop:enable Metrics/ClassLength
|
269
269
|
end
|
270
270
|
end
|
271
271
|
end
|
@@ -13,7 +13,7 @@ module RSpec
|
|
13
13
|
@caught_symbol = @caught_arg = nil
|
14
14
|
end
|
15
15
|
|
16
|
-
# rubocop:disable MethodLength
|
16
|
+
# rubocop:disable Metrics/MethodLength
|
17
17
|
# @private
|
18
18
|
def matches?(given_proc)
|
19
19
|
@block = given_proc
|
@@ -48,7 +48,7 @@ module RSpec
|
|
48
48
|
rescue => other_exception
|
49
49
|
raise
|
50
50
|
ensure
|
51
|
-
# rubocop:disable EnsureReturn
|
51
|
+
# rubocop:disable Lint/EnsureReturn
|
52
52
|
unless other_exception
|
53
53
|
if @expected_symbol.nil?
|
54
54
|
return !!@caught_symbol
|
@@ -60,10 +60,10 @@ module RSpec
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
63
|
-
# rubocop:enable EnsureReturn
|
63
|
+
# rubocop:enable Lint/EnsureReturn
|
64
64
|
end
|
65
65
|
end
|
66
|
-
# rubocop:enable MethodLength
|
66
|
+
# rubocop:enable Metrics/MethodLength
|
67
67
|
|
68
68
|
def does_not_match?(given_proc)
|
69
69
|
!matches?(given_proc) && Proc === given_proc
|
data/lib/rspec/matchers/dsl.rb
CHANGED
@@ -122,7 +122,7 @@ module RSpec
|
|
122
122
|
#
|
123
123
|
# By default the match block will swallow expectation errors (e.g.
|
124
124
|
# caused by using an expectation such as `expect(1).to eq 2`), if you
|
125
|
-
#
|
125
|
+
# wish to allow these to bubble up, pass in the option
|
126
126
|
# `:notify_expectation_failures => true`.
|
127
127
|
#
|
128
128
|
# @param [Hash] options for defining the behavior of the match block.
|
@@ -151,7 +151,7 @@ module RSpec
|
|
151
151
|
#
|
152
152
|
# By default the match block will swallow expectation errors (e.g.
|
153
153
|
# caused by using an expectation such as `expect(1).to eq 2`), if you
|
154
|
-
#
|
154
|
+
# wish to allow these to bubble up, pass in the option
|
155
155
|
# `:notify_expectation_failures => true`.
|
156
156
|
#
|
157
157
|
# @param [Hash] options for defining the behavior of the match block.
|
data/lib/rspec/matchers.rb
CHANGED
@@ -36,7 +36,7 @@ module RSpec
|
|
36
36
|
# expect([]).to be_empty # => [].empty?() | passes
|
37
37
|
# expect([]).not_to be_empty # => [].empty?() | fails
|
38
38
|
#
|
39
|
-
# In
|
39
|
+
# In addition to prefixing the predicate matchers with "be_", you can also use "be_a_"
|
40
40
|
# and "be_an_", making your specs read much more naturally:
|
41
41
|
#
|
42
42
|
# expect("a string").to be_an_instance_of(String) # =>"a string".instance_of?(String) # passes
|
@@ -753,8 +753,8 @@ module RSpec
|
|
753
753
|
|
754
754
|
# With no args, matches if any error is raised.
|
755
755
|
# With a named error, matches only if that specific error is raised.
|
756
|
-
# With a named error and
|
757
|
-
# With a named error and
|
756
|
+
# With a named error and message specified as a String, matches only if both match.
|
757
|
+
# With a named error and message specified as a Regexp, matches only if both match.
|
758
758
|
# Pass an optional block to perform extra verifications on the exception matched
|
759
759
|
#
|
760
760
|
# @example
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-expectations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.11.
|
4
|
+
version: 3.11.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Baker
|
@@ -45,7 +45,7 @@ cert_chain:
|
|
45
45
|
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
|
46
46
|
F3MdtaDehhjC
|
47
47
|
-----END CERTIFICATE-----
|
48
|
-
date: 2022-
|
48
|
+
date: 2022-09-12 00:00:00.000000000 Z
|
49
49
|
dependencies:
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
51
|
name: rspec-support
|
@@ -203,7 +203,7 @@ licenses:
|
|
203
203
|
- MIT
|
204
204
|
metadata:
|
205
205
|
bug_tracker_uri: https://github.com/rspec/rspec-expectations/issues
|
206
|
-
changelog_uri: https://github.com/rspec/rspec-expectations/blob/v3.11.
|
206
|
+
changelog_uri: https://github.com/rspec/rspec-expectations/blob/v3.11.1/Changelog.md
|
207
207
|
documentation_uri: https://rspec.info/documentation/
|
208
208
|
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
|
209
209
|
source_code_uri: https://github.com/rspec/rspec-expectations
|
@@ -226,5 +226,5 @@ requirements: []
|
|
226
226
|
rubygems_version: 3.3.3
|
227
227
|
signing_key:
|
228
228
|
specification_version: 4
|
229
|
-
summary: rspec-expectations-3.11.
|
229
|
+
summary: rspec-expectations-3.11.1
|
230
230
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|