rspec-core 3.1.6 → 3.1.7

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
  SHA1:
3
- metadata.gz: b2b3632b51db161f35c5b34de9edc51e46d9cf3d
4
- data.tar.gz: 3c8b1ce86cafdcc09fe9dbca4cecc32c2b10efb7
3
+ metadata.gz: dc437d7748b2d4e51abc67ecdee4b3222ddbee53
4
+ data.tar.gz: fa6c35c84c11393fa3f72dd0bdd8712e31b8ca9e
5
5
  SHA512:
6
- metadata.gz: cf9a1a0778774bc4f4c19b2ca537e9cc6a96e48e52e0d4ffb1de7254ec92338a9e103dea333a3b61050b040328518ee2ac77ffab82b35af357b6c863d2c71d46
7
- data.tar.gz: 41557dacbba9ce26a55a7d04ff315664fa5d23c9a8d1d451cdd3812fc33c3cbd086b13fb2b13e51d97faa3fe8efc8fd52331a2e6c7a79b3894fd802f9a965707
6
+ metadata.gz: cc7190d5420cb26fa663b62e4355284b6a869300c118b6ea535d37f5d86bfc8ce9199259f1c1036be7b4193090e03db2e57ef8b7e41574cfb69c239349479a54
7
+ data.tar.gz: 0f213b46212dfe8233f1d7466f7e519ef375b6eb1757db8f4a3cdaf630554d43588bf248385eaa79ae0b0d523acb3800493e84e3c31d9c26b1dfc23867db161a
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,19 @@
1
+ ### 3.1.7 / 2014-10-11
2
+ [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.1.6...v3.1.7)
3
+
4
+ Bug Fixes:
5
+
6
+ * Fix `Metadata.relative_path` so that for a current directory of
7
+ `/foo/bar`, `/foo/bar_1` is not wrongly converted to `._1`.
8
+ (Akos Vandra, #1730)
9
+ * Prevent constant lookup mistakenly finding `RSpec::ExampleGroups` generated
10
+ constants on 1.9.2 by appending a trailing `_` to the generated names.
11
+ (Jon Rowe, #1737)
12
+ * Fix bug in `:pending` metadata. If it got set in any way besides passing
13
+ it as part of the metadata literal passed to `it` (such as by using
14
+ `define_derived_metadata`), it did not have the desired effect,
15
+ instead marking the example as `:passed`. (Myron Marston, #1739)
16
+
1
17
  ### 3.1.6 / 2014-10-08
2
18
  [Full Changelog](http://github.com/rspec/rspec-core/compare/v3.1.5...v3.1.6)
3
19
 
@@ -140,6 +140,7 @@ module RSpec
140
140
  RSpec.current_example = self
141
141
 
142
142
  start(reporter)
143
+ Pending.mark_pending!(self, pending) if pending?
143
144
 
144
145
  begin
145
146
  if skipped?
@@ -109,21 +109,11 @@ module RSpec
109
109
  def self.define_example_method(name, extra_options={})
110
110
  define_singleton_method(name) do |*all_args, &block|
111
111
  desc, *args = *all_args
112
+
112
113
  options = Metadata.build_hash_from(args)
113
114
  options.update(:skip => RSpec::Core::Pending::NOT_YET_IMPLEMENTED) unless block
114
115
  options.update(extra_options)
115
116
 
116
- # Metadata inheritance normally happens in `Example#initialize`,
117
- # but for `:pending` specifically we need it earlier.
118
- pending_metadata = options[:pending] || metadata[:pending]
119
-
120
- if pending_metadata
121
- options, block = ExampleGroup.pending_metadata_and_block_for(
122
- options.merge(:pending => pending_metadata),
123
- block
124
- )
125
- end
126
-
127
117
  examples << RSpec::Core::Example.new(self, desc, options, block)
128
118
  examples.last
129
119
  end
@@ -546,30 +536,6 @@ module RSpec
546
536
  def self.set_ivars(instance, ivars)
547
537
  ivars.each { |name, value| instance.instance_variable_set(name, value) }
548
538
  end
549
-
550
- # @private
551
- def self.pending_metadata_and_block_for(options, block)
552
- if String === options[:pending]
553
- reason = options[:pending]
554
- else
555
- options[:pending] = true
556
- reason = RSpec::Core::Pending::NO_REASON_GIVEN
557
- end
558
-
559
- # Assign :caller so that the callback's source_location isn't used
560
- # as the example location.
561
- options[:caller] ||= Metadata.backtrace_from(block)
562
-
563
- # This will fail if no block is provided, which is effectively the
564
- # same as failing the example so it will be marked correctly as
565
- # pending.
566
- callback = Proc.new do
567
- pending(reason)
568
- instance_exec(&block)
569
- end
570
-
571
- return options, callback
572
- end
573
539
  end
574
540
 
575
541
  # @private
@@ -618,6 +584,16 @@ module RSpec
618
584
  name
619
585
  end
620
586
 
587
+ if RUBY_VERSION == '1.9.2'
588
+ class << self
589
+ alias _base_name_for base_name_for
590
+ def base_name_for(group)
591
+ _base_name_for(group) + '_'
592
+ end
593
+ end
594
+ private_class_method :_base_name_for
595
+ end
596
+
621
597
  def self.disambiguate(name, const_scope)
622
598
  return name unless const_defined_on?(const_scope, name)
623
599
 
@@ -30,7 +30,18 @@ module RSpec
30
30
  # @param line [String] current code line
31
31
  # @return [String] relative path to line
32
32
  def self.relative_path(line)
33
- line = line.sub(File.expand_path("."), ".")
33
+ # Matches strings either at the beginning of the input or prefixed with a whitespace,
34
+ # containing the current path, either postfixed with the separator, or at the end of the string.
35
+ # Match groups are the character before and the character after the string if any.
36
+ #
37
+ # http://rubular.com/r/fT0gmX6VJX
38
+ # http://rubular.com/r/duOrD4i3wb
39
+ # http://rubular.com/r/sbAMHFrOx1
40
+ #
41
+
42
+ regex = /(\A|\s)#{File.expand_path('.')}(#{File::SEPARATOR}|\s|\Z)/
43
+
44
+ line = line.sub(regex, "\\1.\\2")
34
45
  line = line.sub(/\A([^:]+:\d+)$/, '\\1')
35
46
  return nil if line == '-e:1'
36
47
  line
@@ -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.1.6'
6
+ STRING = '3.1.7'
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.1.6
4
+ version: 3.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Baker
@@ -34,7 +34,7 @@ cert_chain:
34
34
  1yHC1AcSYpvi2dAbOiHT5iQF+krm4wse8KctXgTNnjMsHEoGKulJS2/sZl90jcCz
35
35
  muA=
36
36
  -----END CERTIFICATE-----
37
- date: 2014-10-09 00:00:00.000000000 Z
37
+ date: 2014-10-12 00:00:00.000000000 Z
38
38
  dependencies:
39
39
  - !ruby/object:Gem::Dependency
40
40
  name: rspec-support
@@ -266,6 +266,6 @@ rubyforge_project: rspec
266
266
  rubygems_version: 2.2.2
267
267
  signing_key:
268
268
  specification_version: 4
269
- summary: rspec-core-3.1.6
269
+ summary: rspec-core-3.1.7
270
270
  test_files: []
271
271
  has_rdoc:
metadata.gz.sig CHANGED
Binary file