Skip to content

Commit

Permalink
Refactored steps.
Browse files Browse the repository at this point in the history
  • Loading branch information
baphled committed Apr 21, 2010
1 parent aec07ea commit edd2bd5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
8 changes: 0 additions & 8 deletions features/step_definitions/feature_file_steps.rb
Expand Up @@ -10,10 +10,6 @@
File.exists?("#{RAILS_ROOT}/spec/fixtures/test.feature").should be_true
end

Given /^the feature file can be opened with Cucumbers FeatureFile object$/ do
@file = FeatureFile.new "#{RAILS_ROOT}/features/plain/enhancements.feature"
end

Given /^we create a FeatureFile from a cucumber feature file with a scenario outline$/ do
@file = FeatureFile.new "#{RAILS_ROOT}/features/plain/enhancements.feature"
end
Expand Down Expand Up @@ -101,10 +97,6 @@
@file.export.stories.each { |story| story.scenario.should_not contain /^Scenario Outline:/}
end

Then /^our parse FeatureFile should be called$/ do
@file.should_receive :parse
end

Then /^a scenario outline should be found$/ do
@file.export.stories.first.examples.first.should_not be_nil
end
Expand Down
3 changes: 2 additions & 1 deletion features/step_definitions/information_and_summary_steps.rb
@@ -1,10 +1,11 @@
Given /^there is a "([^\"]*)"$/ do |model|
pending 'This step seems to cause all subsequent steps to break which use find on a model, need to find out why'
# pending 'This step seems to cause all subsequent steps to break which use find on a model, need to find out why'
@model = mock_model(model.capitalize.constantize).as_null_object
model.capitalize.constantize.stub!(:find).and_return @model
end

Given /^the item has no "([^\"]*)"$/ do |association|
# pending 'This step seems to cause all subsequent steps to break which use find on a model, need to find out why'
@model.stub!(association.to_sym).and_return []
@model.send(association).stub!(:count).and_return 0
end
Expand Down
4 changes: 2 additions & 2 deletions features/support/env.rb
Expand Up @@ -16,7 +16,7 @@
require 'webrat/core/matchers'

require 'cucumber/rails/rspec'

require 'spec/stubs/cucumber'
require 'spec/mocks/framework'
require 'spec/mocks/extensions'

Expand Down Expand Up @@ -65,5 +65,5 @@
end

After do
$rspec_stubs.reset_all
$rspec_mocks.reset_all
end

0 comments on commit edd2bd5

Please sign in to comment.