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

Commit 49b536c

Browse files
committed
conditionally define Ruby 1.8.7 patch
1 parent 76c9222 commit 49b536c

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/rspec/core/shared_example_group.rb

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,14 @@ 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+
def formatted_location(block)
249+
block.source_location.join(":").gsub(/:in.*$/, '')
250+
end
245251
end
246252

247253
if Proc.method_defined?(:source_location)

0 commit comments

Comments
 (0)