From 15f36c8fc97b0930be37c89fbaf27665bd223d6d Mon Sep 17 00:00:00 2001 From: Joe Ferris Date: Tue, 15 Sep 2009 15:56:54 -0400 Subject: [PATCH] Now running features with Rake --- Rakefile | 10 ++++++++-- lib/factory_girl/step_definitions.rb | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Rakefile b/Rakefile index b1629d0..fb8b583 100644 --- a/Rakefile +++ b/Rakefile @@ -6,9 +6,10 @@ require 'rcov/rcovtask' require 'date' require 'spec/rake/spectask' +require 'cucumber/rake/task' -desc 'Default: run the specs.' -task :default => :spec +desc 'Default: run the specs and features.' +task :default => [:spec, :features] Spec::Rake::SpecTask.new do |t| t.spec_opts = ['--options', "spec/spec.opts"] @@ -73,3 +74,8 @@ task :gemspec do f.write spec.to_ruby end end + +Cucumber::Rake::Task.new(:features) do |t| + t.fork = true + t.cucumber_opts = ['--format', (ENV['CUCUMBER_FORMAT'] || 'progress')] +end diff --git a/lib/factory_girl/step_definitions.rb b/lib/factory_girl/step_definitions.rb index d97e9b4..119e6bb 100644 --- a/lib/factory_girl/step_definitions.rb +++ b/lib/factory_girl/step_definitions.rb @@ -22,6 +22,7 @@ Factory.factories.values.each do |factory| Factory.create(factory.factory_name, attributes) end + # TODO: support irregular pluralizations Given "the following #{factory.human_name}s exist:" do |table| table.hashes.each do |human_hash| attributes = convert_human_hash_to_attribute_hash(human_hash)