rspec-core 3.6.0 → 3.7.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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/Changelog.md +20 -0
- data/lib/rspec/core/configuration.rb +4 -2
- data/lib/rspec/core/drb.rb +1 -1
- data/lib/rspec/core/example.rb +2 -2
- data/lib/rspec/core/example_group.rb +3 -2
- data/lib/rspec/core/formatters/base_formatter.rb +1 -1
- data/lib/rspec/core/formatters/deprecation_formatter.rb +6 -8
- data/lib/rspec/core/formatters/html_printer.rb +3 -1
- data/lib/rspec/core/formatters/html_snippet_extractor.rb +2 -0
- data/lib/rspec/core/formatters/json_formatter.rb +2 -1
- data/lib/rspec/core/hooks.rb +3 -1
- data/lib/rspec/core/notifications.rb +19 -12
- data/lib/rspec/core/option_parser.rb +1 -1
- data/lib/rspec/core/version.rb +1 -1
- metadata +8 -8
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b5c0a6998742c8632fd03444e01f5c63ae7feb1
|
4
|
+
data.tar.gz: 28050c825d4aae86612c92b8e6ed6fc6ea843ec4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b43ec0a2cd3c5286ca23160861983bc4b66948d1c63449e99ea88dda57329e7091483cb033780d253161fd4b9acc1da7e6d08546e12860864ed018ee2725c65
|
7
|
+
data.tar.gz: 6a16b4a35c84eba0dda74004a6cc53b9f9a3e3bc638fb3c30bda49a65230c2296fab5a215a4fb6d42606e99a7f874c3f533181d6eafad45143c3c312f69ebe14
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/Changelog.md
CHANGED
@@ -1,3 +1,23 @@
|
|
1
|
+
### Development
|
2
|
+
[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.7.0...master)
|
3
|
+
|
4
|
+
### 3.7.0 / 2017-10-17
|
5
|
+
[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.6.0...v3.7.0)
|
6
|
+
|
7
|
+
Enhancements:
|
8
|
+
|
9
|
+
* Add `-n` alias for `--next-failure`. (Ian Ker-Seymer, #2434)
|
10
|
+
* Improve compatibility with `--enable-frozen-string-literal` option
|
11
|
+
on Ruby 2.3+. (Pat Allan, #2425, #2427, #2437)
|
12
|
+
* Do not run `:context` hooks for example groups that have been skipped.
|
13
|
+
(Devon Estes, #2442)
|
14
|
+
* Add `errors_outside_of_examples_count` to the JSON formatter.
|
15
|
+
(Takeshi Arabiki, #2448)
|
16
|
+
|
17
|
+
Bug Fixes:
|
18
|
+
|
19
|
+
* Improve compatibility with frozen string literal flag. (#2425, Pat Allan)
|
20
|
+
|
1
21
|
### 3.6.0 / 2017-05-04
|
2
22
|
[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.6.0.beta2...v3.6.0)
|
3
23
|
|
@@ -161,7 +161,7 @@ module RSpec
|
|
161
161
|
|
162
162
|
# @macro define_reader
|
163
163
|
# The file path to use for persisting example statuses. Necessary for the
|
164
|
-
# `--only-failures` and `--next-
|
164
|
+
# `--only-failures` and `--next-failure` CLI options.
|
165
165
|
#
|
166
166
|
# @overload example_status_persistence_file_path
|
167
167
|
# @return [String] the file path
|
@@ -170,7 +170,7 @@ module RSpec
|
|
170
170
|
define_reader :example_status_persistence_file_path
|
171
171
|
|
172
172
|
# Sets the file path to use for persisting example statuses. Necessary for the
|
173
|
-
# `--only-failures` and `--next-
|
173
|
+
# `--only-failures` and `--next-failure` CLI options.
|
174
174
|
def example_status_persistence_file_path=(value)
|
175
175
|
@example_status_persistence_file_path = value
|
176
176
|
clear_values_derived_from_example_status_persistence_file_path
|
@@ -413,6 +413,8 @@ module RSpec
|
|
413
413
|
|
414
414
|
# rubocop:disable Metrics/AbcSize
|
415
415
|
# rubocop:disable Metrics/MethodLength
|
416
|
+
|
417
|
+
# Build an object to store runtime configuration options and set defaults
|
416
418
|
def initialize
|
417
419
|
# rubocop:disable Style/GlobalVars
|
418
420
|
@start_time = $_rspec_core_load_started_at || ::RSpec::Core::Time.now
|
data/lib/rspec/core/drb.rb
CHANGED
@@ -84,7 +84,7 @@ module RSpec
|
|
84
84
|
def add_filter(argv, name, hash)
|
85
85
|
hash.each_pair do |k, v|
|
86
86
|
next if CONDITIONAL_FILTERS.include?(k)
|
87
|
-
tag = name == :inclusion ? k.to_s : "~#{k}"
|
87
|
+
tag = name == :inclusion ? k.to_s : "~#{k}".dup
|
88
88
|
tag << ":#{v}" if v.is_a?(String)
|
89
89
|
argv << "--tag" << tag
|
90
90
|
end unless hash.empty?
|
data/lib/rspec/core/example.rb
CHANGED
@@ -87,7 +87,7 @@ module RSpec
|
|
87
87
|
def inspect_output
|
88
88
|
inspect_output = "\"#{description}\""
|
89
89
|
unless metadata[:description].to_s.empty?
|
90
|
-
inspect_output
|
90
|
+
inspect_output += " (#{location})"
|
91
91
|
end
|
92
92
|
inspect_output
|
93
93
|
end
|
@@ -523,7 +523,7 @@ module RSpec
|
|
523
523
|
def assign_generated_description
|
524
524
|
if metadata[:description].empty? && (description = generate_description)
|
525
525
|
metadata[:description] = description
|
526
|
-
metadata[:full_description]
|
526
|
+
metadata[:full_description] += description
|
527
527
|
end
|
528
528
|
ensure
|
529
529
|
RSpec::Matchers.clear_generated_description
|
@@ -3,6 +3,7 @@ RSpec::Support.require_rspec_support 'recursive_const_methods'
|
|
3
3
|
module RSpec
|
4
4
|
module Core
|
5
5
|
# rubocop:disable Metrics/ClassLength
|
6
|
+
|
6
7
|
# ExampleGroup and {Example} are the main structural elements of
|
7
8
|
# rspec-core. Consider this example:
|
8
9
|
#
|
@@ -838,10 +839,10 @@ module RSpec
|
|
838
839
|
end
|
839
840
|
|
840
841
|
def self.base_name_for(group)
|
841
|
-
return "Anonymous" if group.description.empty?
|
842
|
+
return "Anonymous".dup if group.description.empty?
|
842
843
|
|
843
844
|
# Convert to CamelCase.
|
844
|
-
name = ' '
|
845
|
+
name = ' ' + group.description
|
845
846
|
name.gsub!(/[^0-9a-zA-Z]+([0-9a-zA-Z])/) do
|
846
847
|
match = ::Regexp.last_match[1]
|
847
848
|
match.upcase!
|
@@ -5,7 +5,7 @@ module RSpec
|
|
5
5
|
module Core
|
6
6
|
module Formatters
|
7
7
|
# RSpec's built-in formatters are all subclasses of
|
8
|
-
# RSpec::Core::Formatters::
|
8
|
+
# RSpec::Core::Formatters::BaseFormatter.
|
9
9
|
#
|
10
10
|
# @see RSpec::Core::Formatters::BaseTextFormatter
|
11
11
|
# @see RSpec::Core::Reporter
|
@@ -59,6 +59,8 @@ module RSpec
|
|
59
59
|
|
60
60
|
DEPRECATION_STREAM_NOTICE = "Pass `--deprecation-out` or set " \
|
61
61
|
"`config.deprecation_stream` to a file for full output."
|
62
|
+
TOO_MANY_WARNINGS_NOTICE = "Too many similar deprecation messages " \
|
63
|
+
"reported, disregarding further reports. #{DEPRECATION_STREAM_NOTICE}"
|
62
64
|
|
63
65
|
SpecifiedDeprecationMessage = Struct.new(:type) do
|
64
66
|
def initialize(data)
|
@@ -71,9 +73,7 @@ module RSpec
|
|
71
73
|
end
|
72
74
|
|
73
75
|
def too_many_warnings_message
|
74
|
-
|
75
|
-
msg << DEPRECATION_STREAM_NOTICE
|
76
|
-
msg
|
76
|
+
TOO_MANY_WARNINGS_NOTICE
|
77
77
|
end
|
78
78
|
|
79
79
|
private
|
@@ -96,16 +96,14 @@ module RSpec
|
|
96
96
|
end
|
97
97
|
|
98
98
|
def to_s
|
99
|
-
msg =
|
99
|
+
msg = String.new("#{@data.deprecated} is deprecated.")
|
100
100
|
msg << " Use #{@data.replacement} instead." if @data.replacement
|
101
|
-
msg << " Called from #{@data.call_site}."
|
101
|
+
msg << " Called from #{@data.call_site}." if @data.call_site
|
102
102
|
msg
|
103
103
|
end
|
104
104
|
|
105
105
|
def too_many_warnings_message
|
106
|
-
|
107
|
-
msg << DEPRECATION_STREAM_NOTICE
|
108
|
-
msg
|
106
|
+
"Too many uses of deprecated '#{type}'. #{DEPRECATION_STREAM_NOTICE}"
|
109
107
|
end
|
110
108
|
end
|
111
109
|
|
@@ -59,7 +59,9 @@ module RSpec
|
|
59
59
|
end
|
60
60
|
|
61
61
|
def print_summary(duration, example_count, failure_count, pending_count)
|
62
|
-
totals =
|
62
|
+
totals = String.new(
|
63
|
+
"#{example_count} example#{'s' unless example_count == 1}, "
|
64
|
+
)
|
63
65
|
totals << "#{failure_count} failure#{'s' unless failure_count == 1}"
|
64
66
|
totals << ", #{pending_count} pending" if pending_count > 0
|
65
67
|
|
@@ -26,7 +26,8 @@ module RSpec
|
|
26
26
|
:duration => summary.duration,
|
27
27
|
:example_count => summary.example_count,
|
28
28
|
:failure_count => summary.failure_count,
|
29
|
-
:pending_count => summary.pending_count
|
29
|
+
:pending_count => summary.pending_count,
|
30
|
+
:errors_outside_of_examples_count => summary.errors_outside_of_examples_count
|
30
31
|
}
|
31
32
|
@output_hash[:summary_line] = summary.totals_line
|
32
33
|
end
|
data/lib/rspec/core/hooks.rb
CHANGED
@@ -456,7 +456,9 @@ module RSpec
|
|
456
456
|
return if RSpec.configuration.dry_run?
|
457
457
|
|
458
458
|
if scope == :context
|
459
|
-
|
459
|
+
unless example_or_group.class.metadata[:skip]
|
460
|
+
run_owned_hooks_for(position, :context, example_or_group)
|
461
|
+
end
|
460
462
|
else
|
461
463
|
case position
|
462
464
|
when :before then run_example_hooks_for(example_or_group, :before, :reverse_each)
|
@@ -111,7 +111,7 @@ module RSpec::Core
|
|
111
111
|
formatted = "\nFailures:\n"
|
112
112
|
|
113
113
|
failure_notifications.each_with_index do |failure, index|
|
114
|
-
formatted
|
114
|
+
formatted += failure.fully_formatted(index.next, colorizer)
|
115
115
|
end
|
116
116
|
|
117
117
|
formatted
|
@@ -120,7 +120,7 @@ module RSpec::Core
|
|
120
120
|
# @return [String] The list of pending examples, fully formatted in the
|
121
121
|
# way that RSpec's built-in formatters emit.
|
122
122
|
def fully_formatted_pending_examples(colorizer=::RSpec::Core::Formatters::ConsoleCodes)
|
123
|
-
formatted = "\nPending: (Failures listed here are expected and do not affect your suite's status)\n"
|
123
|
+
formatted = "\nPending: (Failures listed here are expected and do not affect your suite's status)\n".dup
|
124
124
|
|
125
125
|
pending_notifications.each_with_index do |notification, index|
|
126
126
|
formatted << notification.fully_formatted(index.next, colorizer)
|
@@ -232,9 +232,14 @@ module RSpec::Core
|
|
232
232
|
# RSpec's built-in formatters emit.
|
233
233
|
def fully_formatted(pending_number, colorizer=::RSpec::Core::Formatters::ConsoleCodes)
|
234
234
|
formatted_caller = RSpec.configuration.backtrace_formatter.backtrace_line(example.location)
|
235
|
-
|
236
|
-
|
237
|
-
|
235
|
+
|
236
|
+
[
|
237
|
+
colorizer.wrap("\n #{pending_number}) #{example.full_description}", :pending),
|
238
|
+
"\n ",
|
239
|
+
Formatters::ExceptionPresenter::PENDING_DETAIL_FORMATTER.call(example, colorizer),
|
240
|
+
"\n",
|
241
|
+
colorizer.wrap(" # #{formatted_caller}\n", :detail)
|
242
|
+
].join("")
|
238
243
|
end
|
239
244
|
end
|
240
245
|
|
@@ -315,13 +320,15 @@ module RSpec::Core
|
|
315
320
|
# @api
|
316
321
|
# @return [String] A line summarising the result totals of the spec run.
|
317
322
|
def totals_line
|
318
|
-
summary = Formatters::Helpers.pluralize(example_count, "example")
|
319
|
-
|
320
|
-
summary
|
323
|
+
summary = Formatters::Helpers.pluralize(example_count, "example") +
|
324
|
+
", " + Formatters::Helpers.pluralize(failure_count, "failure")
|
325
|
+
summary += ", #{pending_count} pending" if pending_count > 0
|
321
326
|
if errors_outside_of_examples_count > 0
|
322
|
-
summary
|
323
|
-
|
324
|
-
|
327
|
+
summary += (
|
328
|
+
", " +
|
329
|
+
Formatters::Helpers.pluralize(errors_outside_of_examples_count, "error") +
|
330
|
+
" occurred outside of examples"
|
331
|
+
)
|
325
332
|
end
|
326
333
|
summary
|
327
334
|
end
|
@@ -380,7 +387,7 @@ module RSpec::Core
|
|
380
387
|
"#{colorized_totals_line(colorizer)}\n"
|
381
388
|
|
382
389
|
unless failed_examples.empty?
|
383
|
-
formatted
|
390
|
+
formatted += (colorized_rerun_commands(colorizer) + "\n")
|
384
391
|
end
|
385
392
|
|
386
393
|
formatted
|
@@ -201,7 +201,7 @@ FILTERING
|
|
201
201
|
configure_only_failures(options)
|
202
202
|
end
|
203
203
|
|
204
|
-
parser.on("--next-failure", "Apply `--only-failures` and abort after one failure.",
|
204
|
+
parser.on("-n", "--next-failure", "Apply `--only-failures` and abort after one failure.",
|
205
205
|
" (Equivalent to `--only-failures --fail-fast --order defined`)") do
|
206
206
|
configure_only_failures(options)
|
207
207
|
set_fail_fast(options, 1)
|
data/lib/rspec/core/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Baker
|
@@ -46,7 +46,7 @@ cert_chain:
|
|
46
46
|
ZsVDj6a7lH3cNqtWXZxrb2wO38qV5AkYj8SQK7Hj3/Yui9myUX3crr+PdetazSqQ
|
47
47
|
F3MdtaDehhjC
|
48
48
|
-----END CERTIFICATE-----
|
49
|
-
date: 2017-
|
49
|
+
date: 2017-10-17 00:00:00.000000000 Z
|
50
50
|
dependencies:
|
51
51
|
- !ruby/object:Gem::Dependency
|
52
52
|
name: rspec-support
|
@@ -54,14 +54,14 @@ dependencies:
|
|
54
54
|
requirements:
|
55
55
|
- - "~>"
|
56
56
|
- !ruby/object:Gem::Version
|
57
|
-
version: 3.
|
57
|
+
version: 3.7.0
|
58
58
|
type: :runtime
|
59
59
|
prerelease: false
|
60
60
|
version_requirements: !ruby/object:Gem::Requirement
|
61
61
|
requirements:
|
62
62
|
- - "~>"
|
63
63
|
- !ruby/object:Gem::Version
|
64
|
-
version: 3.
|
64
|
+
version: 3.7.0
|
65
65
|
- !ruby/object:Gem::Dependency
|
66
66
|
name: cucumber
|
67
67
|
requirement: !ruby/object:Gem::Requirement
|
@@ -110,14 +110,14 @@ dependencies:
|
|
110
110
|
requirements:
|
111
111
|
- - "~>"
|
112
112
|
- !ruby/object:Gem::Version
|
113
|
-
version: 1.
|
113
|
+
version: 1.1.1
|
114
114
|
type: :development
|
115
115
|
prerelease: false
|
116
116
|
version_requirements: !ruby/object:Gem::Requirement
|
117
117
|
requirements:
|
118
118
|
- - "~>"
|
119
119
|
- !ruby/object:Gem::Version
|
120
|
-
version: 1.
|
120
|
+
version: 1.1.1
|
121
121
|
- !ruby/object:Gem::Dependency
|
122
122
|
name: mocha
|
123
123
|
requirement: !ruby/object:Gem::Requirement
|
@@ -277,9 +277,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
277
277
|
version: '0'
|
278
278
|
requirements: []
|
279
279
|
rubyforge_project:
|
280
|
-
rubygems_version: 2.
|
280
|
+
rubygems_version: 2.6.14
|
281
281
|
signing_key:
|
282
282
|
specification_version: 4
|
283
|
-
summary: rspec-core-3.
|
283
|
+
summary: rspec-core-3.7.0
|
284
284
|
test_files: []
|
285
285
|
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|