rspec-core 3.9.2 → 3.9.3
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.tar.gz.sig +0 -0
- data/Changelog.md +17 -0
- data/README.md +3 -3
- data/lib/rspec/core/bisect/fork_runner.rb +6 -3
- data/lib/rspec/core/configuration.rb +10 -7
- data/lib/rspec/core/example.rb +10 -3
- data/lib/rspec/core/example_group.rb +2 -1
- data/lib/rspec/core/formatters/exception_presenter.rb +10 -2
- data/lib/rspec/core/hooks.rb +14 -9
- data/lib/rspec/core/invocations.rb +1 -1
- data/lib/rspec/core/version.rb +1 -1
- data/lib/rspec/core/world.rb +1 -0
- metadata +8 -8
- 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: 30e931022769b69911776a8c64de53481785df0074e84693b5e4031c20a53bb2
|
4
|
+
data.tar.gz: 9d5f23168383bff0e8f3152d9e111ed7600ee1cefb9ccaeb6c1a0fa384dfe3b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50a9d24a978ca5c0e13bccb4b10343aeac24d2895692d0a2c7d3a6ab429213ede9b9406d4deca6d7cb496f91919eb38fe711ca0294eb94d26e60e4c07abb2e4b
|
7
|
+
data.tar.gz: e412bad1efb696f88065ba2adab372ef8e613ece6f70dd8bf193daeab5e3c8ea41978d3d2b3f5829c4a11c3eb3e2f01428f979d8b75f1f658dc4dcb78fdbf263
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
# 3.9.3 / 2020-09-30
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.9.2...v3.9.3)
|
3
|
+
|
4
|
+
Bug Fixes:
|
5
|
+
|
6
|
+
* Declare `ruby2_keywords` on `method_missing` for other gems. (Jon Rowe, #2731)
|
7
|
+
* Ensure custom error codes are returned from bisect runs. (Jon Rowe, #2732)
|
8
|
+
* Ensure `RSpec::Core::Configuration` predicate config methods return booleans.
|
9
|
+
(Marc-André Lafortune, #2736)
|
10
|
+
* Prevent `rspec --bisect` from generating zombie processes while executing
|
11
|
+
bisect runs. (Benoit Tigeot, Jon Rowe, #2739)
|
12
|
+
* Predicates for pending examples, (in `RSpec::Core::Example`, `#pending?`, `#skipped?` and
|
13
|
+
`#pending_fixed?`) now return boolean values rather than truthy values.
|
14
|
+
(Marc-André Lafortune, #2756, #2758)
|
15
|
+
* Exceptions which have a message which cannot be cast to a string will no longer
|
16
|
+
cause a crash. (Jon Rowe, #2761)
|
17
|
+
|
1
18
|
### 3.9.2 / 2020-05-02
|
2
19
|
[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.9.1...v3.9.2)
|
3
20
|
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# rspec-core [![Build Status](https://secure.travis-ci.org/rspec/rspec-core.svg?branch=
|
1
|
+
# rspec-core [![Build Status](https://secure.travis-ci.org/rspec/rspec-core.svg?branch=main)](http://travis-ci.org/rspec/rspec-core) [![Code Climate](https://codeclimate.com/github/rspec/rspec-core.svg)](https://codeclimate.com/github/rspec/rspec-core)
|
2
2
|
|
3
3
|
rspec-core provides the structure for writing executable examples of how your
|
4
4
|
code should behave, and an `rspec` command with tools to constrain which
|
@@ -10,12 +10,12 @@ examples get run and tailor the output.
|
|
10
10
|
gem install rspec-core # for rspec-core only
|
11
11
|
rspec --help
|
12
12
|
|
13
|
-
Want to run against the `
|
13
|
+
Want to run against the `main` branch? You'll need to include the dependent
|
14
14
|
RSpec repos as well. Add the following to your `Gemfile`:
|
15
15
|
|
16
16
|
```ruby
|
17
17
|
%w[rspec rspec-core rspec-expectations rspec-mocks rspec-support].each do |lib|
|
18
|
-
gem lib, :git => "https://github.com/rspec/#{lib}.git", :branch => '
|
18
|
+
gem lib, :git => "https://github.com/rspec/#{lib}.git", :branch => 'main'
|
19
19
|
end
|
20
20
|
```
|
21
21
|
|
@@ -6,7 +6,7 @@ module RSpec
|
|
6
6
|
module Core
|
7
7
|
module Bisect
|
8
8
|
# A Bisect runner that runs requested subsets of the suite by forking
|
9
|
-
# sub-processes. The
|
9
|
+
# sub-processes. The main process bootstraps RSpec and the application
|
10
10
|
# environment (including preloading files specified via `--require`) so
|
11
11
|
# that the individual spec runs do not have to re-pay that cost. Each
|
12
12
|
# spec run happens in a forked process, ensuring that the spec files are
|
@@ -91,9 +91,12 @@ module RSpec
|
|
91
91
|
end
|
92
92
|
|
93
93
|
def dispatch_specs(run_descriptor)
|
94
|
-
fork { run_specs(run_descriptor) }
|
94
|
+
pid = fork { run_specs(run_descriptor) }
|
95
95
|
# We don't use Process.waitpid here as it was causing bisects to
|
96
|
-
# block due to the file descriptor limit on OSX / Linux.
|
96
|
+
# block due to the file descriptor limit on OSX / Linux. We need
|
97
|
+
# to detach the process to avoid having zombie processes
|
98
|
+
# consuming slots in the kernel process table during bisect runs.
|
99
|
+
Process.detach(pid)
|
97
100
|
end
|
98
101
|
|
99
102
|
private
|
@@ -67,15 +67,17 @@ module RSpec
|
|
67
67
|
end
|
68
68
|
|
69
69
|
# @private
|
70
|
-
def self.
|
70
|
+
def self.define_alias(name, alias_name)
|
71
71
|
alias_method alias_name, name
|
72
72
|
alias_method "#{alias_name}=", "#{name}="
|
73
|
-
|
73
|
+
define_predicate alias_name
|
74
74
|
end
|
75
75
|
|
76
76
|
# @private
|
77
|
-
def self.
|
78
|
-
|
77
|
+
def self.define_predicate(name)
|
78
|
+
define_method "#{name}?" do
|
79
|
+
!!send(name)
|
80
|
+
end
|
79
81
|
end
|
80
82
|
|
81
83
|
# @private
|
@@ -88,7 +90,7 @@ module RSpec
|
|
88
90
|
add_read_only_setting name
|
89
91
|
|
90
92
|
Array(opts[:alias_with]).each do |alias_name|
|
91
|
-
|
93
|
+
define_alias(name, alias_name)
|
92
94
|
end
|
93
95
|
end
|
94
96
|
|
@@ -98,7 +100,7 @@ module RSpec
|
|
98
100
|
def self.add_read_only_setting(name, opts={})
|
99
101
|
raise "Use the instance add_setting method if you want to set a default" if opts.key?(:default)
|
100
102
|
define_reader name
|
101
|
-
|
103
|
+
define_predicate name
|
102
104
|
end
|
103
105
|
|
104
106
|
# @macro [attach] add_setting
|
@@ -312,7 +314,8 @@ module RSpec
|
|
312
314
|
# Report the times for the slowest examples (default: `false`).
|
313
315
|
# Use this to specify the number of examples to include in the profile.
|
314
316
|
# @return [Boolean]
|
315
|
-
|
317
|
+
attr_writer :profile_examples
|
318
|
+
define_predicate :profile_examples
|
316
319
|
|
317
320
|
# @macro add_setting
|
318
321
|
# Run all examples if none match the configured filters
|
data/lib/rspec/core/example.rb
CHANGED
@@ -231,8 +231,13 @@ module RSpec
|
|
231
231
|
@example_group_class
|
232
232
|
end
|
233
233
|
|
234
|
-
|
235
|
-
|
234
|
+
def pending?
|
235
|
+
!!pending
|
236
|
+
end
|
237
|
+
|
238
|
+
def skipped?
|
239
|
+
!!skip
|
240
|
+
end
|
236
241
|
|
237
242
|
# @api private
|
238
243
|
# instance_execs the block passed to the constructor in the context of
|
@@ -577,7 +582,9 @@ module RSpec
|
|
577
582
|
# this indicates whether or not it now passes.
|
578
583
|
attr_accessor :pending_fixed
|
579
584
|
|
580
|
-
|
585
|
+
def pending_fixed?
|
586
|
+
!!pending_fixed
|
587
|
+
end
|
581
588
|
|
582
589
|
# @return [Boolean] Indicates if the example was completely skipped
|
583
590
|
# (typically done via `:skip` metadata or the `skip` method). Skipped examples
|
@@ -761,8 +761,9 @@ module RSpec
|
|
761
761
|
"on an example group (e.g. a `describe` or `context` block)."
|
762
762
|
end
|
763
763
|
|
764
|
-
super
|
764
|
+
super(name, *args)
|
765
765
|
end
|
766
|
+
ruby2_keywords :method_missing if respond_to?(:ruby2_keywords, true)
|
766
767
|
end
|
767
768
|
# rubocop:enable Metrics/ClassLength
|
768
769
|
|
@@ -51,7 +51,7 @@ module RSpec
|
|
51
51
|
cause << '--- Caused by: ---'
|
52
52
|
cause << "#{exception_class_name(last_cause)}:" unless exception_class_name(last_cause) =~ /RSpec/
|
53
53
|
|
54
|
-
encoded_string(last_cause
|
54
|
+
encoded_string(exception_message_string(last_cause)).split("\n").each do |line|
|
55
55
|
cause << " #{line}"
|
56
56
|
end
|
57
57
|
|
@@ -174,10 +174,18 @@ module RSpec
|
|
174
174
|
lines
|
175
175
|
end
|
176
176
|
|
177
|
+
# rubocop:disable Lint/RescueException
|
178
|
+
def exception_message_string(exception)
|
179
|
+
exception.message.to_s
|
180
|
+
rescue Exception => other
|
181
|
+
"A #{exception.class} for which `exception.message.to_s` raises #{other.class}."
|
182
|
+
end
|
183
|
+
# rubocop:enable Lint/RescueException
|
184
|
+
|
177
185
|
def exception_lines
|
178
186
|
lines = []
|
179
187
|
lines << "#{exception_class_name}:" unless exception_class_name =~ /RSpec/
|
180
|
-
encoded_string(exception
|
188
|
+
encoded_string(exception_message_string(exception)).split("\n").each do |line|
|
181
189
|
lines << (line.empty? ? line : " #{line}")
|
182
190
|
end
|
183
191
|
lines
|
data/lib/rspec/core/hooks.rb
CHANGED
@@ -60,9 +60,10 @@ module RSpec
|
|
60
60
|
# before(:example) # Declared in a parent group.
|
61
61
|
# before(:example) # Declared in the current group.
|
62
62
|
#
|
63
|
-
# If more than one `before` is declared within any one
|
64
|
-
# in the order in which they are declared. Any `around` hooks will
|
65
|
-
#
|
63
|
+
# If more than one `before` is declared within any one example group, they
|
64
|
+
# are run in the order in which they are declared. Any `around` hooks will
|
65
|
+
# execute after `before` context hooks but before any `before` example
|
66
|
+
# hook regardless of where they are declared.
|
66
67
|
#
|
67
68
|
# ### Conditions
|
68
69
|
#
|
@@ -263,9 +264,10 @@ module RSpec
|
|
263
264
|
# after(:suite) # Declared in RSpec.configure.
|
264
265
|
#
|
265
266
|
# This is the reverse of the order in which `before` hooks are run.
|
266
|
-
# Similarly, if more than one `after` is declared within any
|
267
|
-
# they are run in reverse order of that in which they are declared.
|
268
|
-
# `around` hooks will
|
267
|
+
# Similarly, if more than one `after` is declared within any example
|
268
|
+
# group, they are run in reverse order of that in which they are declared.
|
269
|
+
# Also `around` hooks will run after any `after` example hooks are
|
270
|
+
# invoked but before any `after` context hooks.
|
269
271
|
#
|
270
272
|
# @note The `:example` and `:context` scopes are also available as
|
271
273
|
# `:each` and `:all`, respectively. Use whichever you prefer.
|
@@ -310,7 +312,7 @@ module RSpec
|
|
310
312
|
#
|
311
313
|
# @note the syntax of `around` is similar to that of `before` and `after`
|
312
314
|
# but the semantics are quite different. `before` and `after` hooks are
|
313
|
-
# run in the context of
|
315
|
+
# run in the context of the examples with which they are associated,
|
314
316
|
# whereas `around` hooks are actually responsible for running the
|
315
317
|
# examples. Consequently, `around` hooks do not have direct access to
|
316
318
|
# resources that are made available within the examples and their
|
@@ -337,8 +339,11 @@ module RSpec
|
|
337
339
|
#
|
338
340
|
# ### Order
|
339
341
|
#
|
340
|
-
#
|
341
|
-
#
|
342
|
+
# The `around` hooks execute surrounding an example and its hooks.
|
343
|
+
#
|
344
|
+
# This means after any `before` context hooks, but before any `before`
|
345
|
+
# example hooks, and similarly after any `after` example hooks but before
|
346
|
+
# any `after` context hooks.
|
342
347
|
#
|
343
348
|
# They are not a synonym for `before`/`after`.
|
344
349
|
def around(*args, &block)
|
data/lib/rspec/core/version.rb
CHANGED
data/lib/rspec/core/world.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.9.
|
4
|
+
version: 3.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Baker
|
8
8
|
- David Chelimsky
|
9
9
|
- Chad Humphries
|
10
10
|
- Myron Marston
|
11
|
-
autorequire:
|
11
|
+
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain:
|
14
14
|
- |
|
@@ -46,7 +46,7 @@ cert_chain:
|
|
46
46
|
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
|
47
47
|
F3MdtaDehhjC
|
48
48
|
-----END CERTIFICATE-----
|
49
|
-
date: 2020-
|
49
|
+
date: 2020-09-30 00:00:00.000000000 Z
|
50
50
|
dependencies:
|
51
51
|
- !ruby/object:Gem::Dependency
|
52
52
|
name: rspec-support
|
@@ -267,11 +267,11 @@ licenses:
|
|
267
267
|
- MIT
|
268
268
|
metadata:
|
269
269
|
bug_tracker_uri: https://github.com/rspec/rspec-core/issues
|
270
|
-
changelog_uri: https://github.com/rspec/rspec-core/blob/v3.9.
|
270
|
+
changelog_uri: https://github.com/rspec/rspec-core/blob/v3.9.3/Changelog.md
|
271
271
|
documentation_uri: https://rspec.info/documentation/
|
272
272
|
mailing_list_uri: https://groups.google.com/forum/#!forum/rspec
|
273
273
|
source_code_uri: https://github.com/rspec/rspec-core
|
274
|
-
post_install_message:
|
274
|
+
post_install_message:
|
275
275
|
rdoc_options:
|
276
276
|
- "--charset=UTF-8"
|
277
277
|
require_paths:
|
@@ -287,8 +287,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
287
287
|
- !ruby/object:Gem::Version
|
288
288
|
version: '0'
|
289
289
|
requirements: []
|
290
|
-
rubygems_version: 3.1.
|
291
|
-
signing_key:
|
290
|
+
rubygems_version: 3.1.3
|
291
|
+
signing_key:
|
292
292
|
specification_version: 4
|
293
|
-
summary: rspec-core-3.9.
|
293
|
+
summary: rspec-core-3.9.3
|
294
294
|
test_files: []
|
metadata.gz.sig
CHANGED
Binary file
|