forked from ecomba/vim-ruby-refactoring
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more descriptive steps :RRenameInstanceVariable
- Loading branch information
Showing
2 changed files
with
25 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
Feature: Renaming instance variable | ||
Feature: Renaming instance variable :RenameInstanceVariable | ||
|
||
Scenario: Renaming a single occurence of an instance variable | ||
Given I have a single occurence of an instance variable | ||
When I rename the instance variable | ||
Then I see the renamed instance variable | ||
Given I have the following code: | ||
""" | ||
def method | ||
@instance_variable | ||
end | ||
""" | ||
When I select the instance variable and execute: | ||
""" | ||
:RRenameInstanceVariable | ||
""" | ||
And I fill in the parameter "foo" | ||
Then I should see: | ||
""" | ||
def method | ||
@foo | ||
end | ||
""" |
27 changes: 6 additions & 21 deletions
27
features/step_definitions/rename_instance_variable_steps.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,9 @@ | ||
Given /^I have a single occurence of an instance variable$/ do | ||
@input = <<-DOC | ||
def method | ||
@instance_variable | ||
When /^I select the instance variable and execute:$/ do |command| | ||
select_instance_variable | ||
add_to_commands command | ||
end | ||
DOC | ||
end | ||
|
||
When /^I rename the instance variable$/ do | ||
@commands = <<-DOC | ||
:normal 2Glve | ||
:RRenameInstanceVariable | ||
foo | ||
DOC | ||
end | ||
|
||
Then /^I see the renamed instance variable$/ do | ||
result_of_executing_the_commands.should == <<-DOC | ||
def method | ||
@foo | ||
end | ||
DOC | ||
|
||
def select_instance_variable | ||
@commands = ":normal 2Glve" | ||
add_return_key | ||
end |