Permalink
Browse files

Fixed inline temp to work in an rspec it when an arbitrary helper met…

…hod is defined.
  • Loading branch information...
1 parent a3bcffe commit b1419191da29bf31d2809f81e48ec838a50d6627 @rossbeehler rossbeehler committed Aug 22, 2011
Showing with 35 additions and 1 deletion.
  1. +34 −0 features/inline_temp.feature
  2. +1 −1 plugin/refactorings/general/inlinetemp.vim
@@ -124,3 +124,37 @@ Feature: Inline Temp :RInlineTemp
"""
word = "2006-01-01"
"""
+
+ @issue
+ Scenario: Inline temp in an rspec it when an arbitrary helper method exists
+ Given I have the following code:
+ """
+ describe "foo" do
+ def arbitrary
+ 0
+ end
+
+ it "should allow puts" do
+ foo = 10
+ puts foo
+ end
+ end
+
+ """
+ When I go to line "7" and execute:
+ """
+ :RInlineTemp
+ """
+ Then I should see:
+ """
+ describe "foo" do
+ def arbitrary
+ 0
+ end
+
+ it "should allow puts" do
+ puts 10
+ end
+ end
+
+ """
@@ -22,7 +22,7 @@ function! InlineTemp()
" Find the start and end of the current block
" TODO: tidy up if no matching 'def' found (start would be 0 atm)
- let [block_start, block_end] = common#get_range_for_block('\<def\>','Wb')
+ let [block_start, block_end] = common#get_range_for_block('\<def\|it\>','Wb')
" Rename the variable within the range of the block
call common#gsub_all_in_range(current_line, block_end, '\<' . @a . '\>', @b)

0 comments on commit b141919

Please sign in to comment.