rspec-core 3.5.0.beta2 → 3.5.0.beta3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ae10092df64000bc49a31c63ea1e6fb90f8bed34
4
- data.tar.gz: 34f6ffdfff90d32dbb96fde2fd9a45e1280bfaeb
3
+ metadata.gz: eb7575d0b8b74488fe65c38a1309ed0e81fb553b
4
+ data.tar.gz: bd6fccb0c6652936a44cd8159e328f581af3c72e
5
5
  SHA512:
6
- metadata.gz: d58b487bff47a2a7d54c86a91e50ec8dadd2f4c5a5a842557cdaa6a2a575dd1409f612a41161ef1862eb15a71b8d9c60bfb3acfc5aec471e0a7fec14467b53d9
7
- data.tar.gz: 7e6f624e87c70244933bc521d67d6bed2b3b455556a57aaca8bda715d07a738920414ae179bf432054222507323f002fc2e30a344c999125606672c6dbdccd4f
6
+ metadata.gz: e036ab4dc99141921ab013f94cc58434b5e16ec3e58a0675cfbaa44a7236b676f16eb81f6e7b02ed211f229298350170ca5c97903c8d84046a548280cae4f926
7
+ data.tar.gz: f55ba181425dd3c264d4a16983718140e43469a28c25300a077858a528d3403d39fad355fde0ca7a8c4156f1a7be41cd846bd4b3c9efc664873bc72dbd25ddc3
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -11,6 +11,17 @@ Enhancements:
11
11
  (Jon Rowe, #2193)
12
12
  * Add new `config.when_first_matching_example_defined` hook. (Myron
13
13
  Marston, #2175)
14
+ * Add new `config.filter_run_when_matching` API, intended to replace
15
+ the combination of `config.filter_run` and
16
+ `config.run_all_when_everything_filtered` (Myron Marston, #2206)
17
+
18
+ Bug Fixes:
19
+
20
+ * Use the encoded string logic for source extraction. (Jon Rowe, #2183)
21
+ * Fix rounding issue in duration formatting helper. (Fabersky, Jon Rowe, #2208)
22
+ * Fix failure snippet extraction so that `def-end` snippets
23
+ ending with `end`-only line can be extracted properly.
24
+ (Yuji Nakayama, #2215)
14
25
 
15
26
  ### 3.5.0.beta1 / 2016-02-06
16
27
  [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.4.3...v3.5.0.beta1)
@@ -264,6 +264,8 @@ module RSpec
264
264
  # @macro add_setting
265
265
  # Run all examples if none match the configured filters
266
266
  # (default: `false`).
267
+ # @deprecated Use {#filter_run_when_matching} instead for the specific
268
+ # filters that you want to be ignored if none match.
267
269
  add_setting :run_all_when_everything_filtered
268
270
 
269
271
  # @macro add_setting
@@ -1039,9 +1041,23 @@ module RSpec
1039
1041
  filter_manager.include_with_low_priority meta
1040
1042
  static_config_filter_manager.include_with_low_priority Metadata.deep_hash_dup(meta)
1041
1043
  end
1042
-
1043
1044
  alias_method :filter_run, :filter_run_including
1044
1045
 
1046
+ # Applies the provided filter only if any of examples match, in constrast
1047
+ # to {#filter_run}, which always applies even if no examples match, in
1048
+ # which case no examples will be run. This allows you to leave configured
1049
+ # filters in place that are intended only for temporary use. The most common
1050
+ # example is focus filtering: `config.filter_run_when_matching :focus`.
1051
+ # With that configured, you can temporarily focus an example or group
1052
+ # by tagging it with `:focus` metadata, or prefixing it with an `f`
1053
+ # (as in `fdescribe`, `fcontext` and `fit`) since those are aliases for
1054
+ # `describe`/`context`/`it` with `:focus` metadata.
1055
+ def filter_run_when_matching(*args)
1056
+ when_first_matching_example_defined(*args) do
1057
+ filter_run(*args)
1058
+ end
1059
+ end
1060
+
1045
1061
  # Clears and reassigns the `inclusion_filter`. Set to `nil` if you don't
1046
1062
  # want any inclusion filter at all.
1047
1063
  #
@@ -30,8 +30,8 @@ module RSpec
30
30
  end
31
31
 
32
32
  if duration > 60
33
- minutes = (duration.to_i / 60).to_i
34
- seconds = duration - minutes * 60
33
+ minutes = (duration.round / 60).to_i
34
+ seconds = (duration - minutes * 60)
35
35
 
36
36
  "#{pluralize(minutes, 'minute')} #{pluralize(format_seconds(seconds, precision), 'second')}"
37
37
  else
@@ -58,6 +58,7 @@ module RSpec
58
58
  #
59
59
  # @see #strip_trailing_zeroes
60
60
  def self.format_seconds(float, precision=nil)
61
+ return '0' if float < 0
61
62
  precision ||= (float < 1) ? SUB_SECOND_PRECISION : DEFAULT_PRECISION
62
63
  formatted = "%.#{precision}f" % float
63
64
  strip_trailing_zeroes(formatted)
@@ -202,7 +202,7 @@ module RSpec::Core
202
202
 
203
203
  private
204
204
 
205
- def initialize(example, exception_presenter=Formatters::ExceptionPresenter.new(example.execution_result.exception, example))
205
+ def initialize(example, exception_presenter)
206
206
  @exception_presenter = exception_presenter
207
207
  super(example)
208
208
  end
@@ -43,12 +43,12 @@ RSpec.configure do |config|
43
43
  # The settings below are suggested to provide a good initial experience
44
44
  # with RSpec, but feel free to customize to your heart's content.
45
45
  =begin
46
- # These two settings work together to allow you to limit a spec run
47
- # to individual examples or groups you care about by tagging them with
48
- # `:focus` metadata. When nothing is tagged with `:focus`, all examples
49
- # get run.
50
- config.filter_run :focus
51
- config.run_all_when_everything_filtered = true
46
+ # This allows you to limit a spec run to individual examples or groups
47
+ # you care about by tagging them with `:focus` metadata. When nothing
48
+ # is tagged with `:focus`, all examples get run. RSpec also provides
49
+ # aliases for `it`, `describe`, and `context` that include `:focus`
50
+ # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
51
+ config.filter_run_when_matching :focus
52
52
 
53
53
  # Allows RSpec to persist some state between runs in order to support
54
54
  # the `--only-failures` and `--next-failure` CLI options. We recommend
@@ -1,3 +1,4 @@
1
+ RSpec::Support.require_rspec_support "encoded_string"
1
2
  RSpec::Support.require_rspec_core 'source/node'
2
3
  RSpec::Support.require_rspec_core 'source/syntax_highlighter'
3
4
  RSpec::Support.require_rspec_core 'source/token'
@@ -14,9 +15,18 @@ module RSpec
14
15
  new(source, path)
15
16
  end
16
17
 
17
- def initialize(source_string, path=nil)
18
- @source = source_string
19
- @path = path ? File.expand_path(path) : '(string)'
18
+ if String.method_defined?(:encoding)
19
+ def initialize(source_string, path=nil)
20
+ @source = RSpec::Support::EncodedString.new(source_string, Encoding.default_external)
21
+ @path = path ? File.expand_path(path) : '(string)'
22
+ end
23
+ else # for 1.8.7
24
+ # :nocov:
25
+ def initialize(source_string, path=nil)
26
+ @source = RSpec::Support::EncodedString.new(source_string)
27
+ @path = path ? File.expand_path(path) : '(string)'
28
+ end
29
+ # :nocov:
20
30
  end
21
31
 
22
32
  def lines
@@ -14,7 +14,8 @@ module RSpec
14
14
  }.freeze
15
15
 
16
16
  CLOSING_KEYWORDS_BY_OPENING_KEYWORD = {
17
- 'do' => 'end'
17
+ 'def' => 'end',
18
+ 'do' => 'end',
18
19
  }.freeze
19
20
 
20
21
  attr_reader :token
@@ -3,7 +3,7 @@ module RSpec
3
3
  # Version information for RSpec Core.
4
4
  module Version
5
5
  # Current version of RSpec Core, in semantic versioning format.
6
- STRING = '3.5.0.beta2'
6
+ STRING = '3.5.0.beta3'
7
7
  end
8
8
  end
9
9
  end
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.5.0.beta2
4
+ version: 3.5.0.beta3
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: 2016-03-10 00:00:00.000000000 Z
49
+ date: 2016-04-02 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.5.0.beta2
57
+ version: 3.5.0.beta3
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.5.0.beta2
64
+ version: 3.5.0.beta3
65
65
  - !ruby/object:Gem::Dependency
66
66
  name: cucumber
67
67
  requirement: !ruby/object:Gem::Requirement
@@ -258,7 +258,7 @@ files:
258
258
  - lib/rspec/core/version.rb
259
259
  - lib/rspec/core/warnings.rb
260
260
  - lib/rspec/core/world.rb
261
- homepage: http://github.com/rspec/rspec-core
261
+ homepage: https://github.com/rspec/rspec-core
262
262
  licenses:
263
263
  - MIT
264
264
  metadata: {}
@@ -279,9 +279,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
279
279
  version: 1.3.1
280
280
  requirements: []
281
281
  rubyforge_project:
282
- rubygems_version: 2.5.1
282
+ rubygems_version: 2.4.5.1
283
283
  signing_key:
284
284
  specification_version: 4
285
- summary: rspec-core-3.5.0.beta2
285
+ summary: rspec-core-3.5.0.beta3
286
286
  test_files: []
287
287
  has_rdoc:
metadata.gz.sig CHANGED
Binary file