Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit f2bb06a

Browse files
authored
Merge pull request #2287 from rspec/2278_changelog_and_tidy
Follow up to #2278
2 parents 56fad31 + e7ff176 commit f2bb06a

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

Changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
### Development
22
[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.5.1...master)
33

4+
Enhancements:
5+
6+
* Warn when duplicate shared exmaples definitions are loaded due to being
7+
defined in files matching the spec pattern (e.g. `_spec.rb`) (#2278, Devon Estes)
8+
49
### 3.5.1 / 2016-07-06
510
[Full Changelog](http://github.com/rspec/rspec-core/compare/v3.5.0...v3.5.1)
611

lib/rspec/core/shared_example_group.rb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,16 @@ def warn_if_key_taken(context, key, new_block)
240240
end
241241
end
242242

243-
def formatted_location(block)
244-
block.source_location.join(":").gsub(/:in.*$/, '')
243+
if RUBY_VERSION.to_f >= 1.9
244+
def formatted_location(block)
245+
block.source_location.join(":")
246+
end
247+
else # 1.8.7
248+
# :nocov:
249+
def formatted_location(block)
250+
block.source_location.join(":").gsub(/:in.*$/, '')
251+
end
252+
# :nocov:
245253
end
246254

247255
if Proc.method_defined?(:source_location)

0 commit comments

Comments
 (0)