Skip to content

Commit

Permalink
Refactored steps to make our 'there is a' step more generic
Browse files Browse the repository at this point in the history
  • Loading branch information
baphled committed Jul 24, 2010
1 parent 995fe9a commit a6e9ba8
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 16 deletions.
4 changes: 0 additions & 4 deletions features/step_definitions/features_steps.rb
Expand Up @@ -2,10 +2,6 @@
@feature.stories = [Story.make]
end

Given /^there is a feature$/ do
@feature = Feature.make
end

Given /^the feature has stories$/ do
@feature.stories = [Story.make]
end
Expand Down
4 changes: 4 additions & 0 deletions features/step_definitions/general_steps.rb
@@ -1,3 +1,7 @@
Given /^there is a ([^\"]*)$/ do |model|
eval("@#{model} = model.camelcase.constantize.make")
end

Given /^the "([^\"]*)" has (\d+) "([^\"]*)"$/ do |model, amount, assoc|
build_associations_by_amount amount, model, assoc
end
Expand Down
4 changes: 0 additions & 4 deletions features/step_definitions/projects_steps.rb
@@ -1,7 +1,3 @@
Given /^there is a project$/ do
@project = Project.make
end

Given /^there are projects$/ do
@projects = Project.stub(:all).and_return [Project.make]
end
Expand Down
4 changes: 0 additions & 4 deletions features/step_definitions/steps_steps.rb
Expand Up @@ -2,10 +2,6 @@
Step.make(:title => step)
end

Given /^there is a step$/ do
@step = Step.make
end

Given /^there are steps$/ do
@step = Step.stub(:all).and_return [Step.make]
end
Expand Down
4 changes: 0 additions & 4 deletions features/step_definitions/stories_steps.rb
Expand Up @@ -6,10 +6,6 @@
@story ||= Story.first
end

Given /^there is a story$/ do
@story = Story.make
end

# TODO Make more flexible and speed up
Given /^we have a stories with examples$/ do
f = FeatureFile.new("#{RAILS_ROOT}/features/plain/tag_cloud.feature").export
Expand Down

0 comments on commit a6e9ba8

Please sign in to comment.