Skip to content

Commit

Permalink
more descriptive steps :RRenameInstanceVariable
Browse files Browse the repository at this point in the history
  • Loading branch information
despo committed May 28, 2011
1 parent 961eb72 commit d49d3a3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
23 changes: 19 additions & 4 deletions features/rename_instance_variable.feature
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 features/step_definitions/rename_instance_variable_steps.rb
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

0 comments on commit d49d3a3

Please sign in to comment.