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

Extract def-end snippets ending with "end"-only line properly #2215

Merged
merged 1 commit into from
Mar 21, 2016

Conversation

yujinakayama
Copy link
Member

This fixes snippet extraction so that missing end line in def-end snippet can be extracted properly (similar issue with #2167).

RSpec.describe 'def-end snippet extraction with ArgumentError' do
  def foo(arg)
    p arg
  end

  it 'cannot extract the last `end` line' do
    foo
  end
end
Failures:

  1) def-end snippet extraction with ArgumentError cannot extract the last `end` line
     Failure/Error:
       def foo(arg)
         p arg

     ArgumentError:
       wrong number of arguments (given 0, expected 1)
@yujinakayama yujinakayama force-pushed the support-method-definition-snippet-extraction branch 3 times, most recently from b0d43a0 to 9818852 Compare March 19, 2016 13:49
end
end

ExpectedError = Class.new(StandardError)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have we removed this? It's not clear to me

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the added example expects ArgumentError raised from def obj.foo(arg)

@yujinakayama yujinakayama force-pushed the support-method-definition-snippet-extraction branch from 9818852 to 4e6260b Compare March 20, 2016 01:16
@myronmarston
Copy link
Member

LGTM!

@myronmarston
Copy link
Member

(I'll leave it to @JonRowe to LGTM it as well since he initially reviewed it).

JonRowe added a commit that referenced this pull request Mar 21, 2016
…-extraction

Extract def-end snippets ending with "end"-only line properly
@JonRowe JonRowe merged commit e95067e into master Mar 21, 2016
@JonRowe JonRowe deleted the support-method-definition-snippet-extraction branch March 21, 2016 01:39
JonRowe added a commit that referenced this pull request May 22, 2016
…-extraction

Extract def-end snippets ending with "end"-only line properly
MatheusRich pushed a commit to MatheusRich/rspec-core that referenced this pull request Oct 30, 2020
…ippet-extraction

Extract def-end snippets ending with "end"-only line properly
yujinakayama pushed a commit to yujinakayama/rspec-monorepo that referenced this pull request Oct 6, 2021
…thod-definition-snippet-extraction

Extract def-end snippets ending with "end"-only line properly

---
This commit was imported from rspec/rspec-core@9a57422.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
3 participants
close