lib/rspec/request_describer.rb in rspec-request_describer-0.0.1 vs lib/rspec/request_describer.rb in rspec-request_describer-0.0.2
- old
+ new
@@ -44,10 +44,11 @@
result.merge(key => value)
end
end
let(:endpoint_segments) do
- example.full_description.match(/(#{SUPPORTED_METHODS.join("|")}) ([\/a-z0-9_:]+)/).to_a
+ current_example = RSpec.respond_to?(:current_example) ? RSpec.current_example : example
+ current_example.full_description.match(/(#{SUPPORTED_METHODS.join("|")}) ([\/a-z0-9_:]+)/).to_a
end
let(:method) do
endpoint_segments[1].downcase
end