Permalink
Browse files

Reworking cucumber setup to play nicely with latest version of Cucumber.

  • Loading branch information...
1 parent 172b3f0 commit 2ec9352787a7175cec5fa937f7129373acebd9c9 @pat pat committed May 13, 2009
Showing with 13 additions and 17 deletions.
  1. +5 −1 cucumber.yml
  2. +1 −1 features/support/post_database.rb
  3. +7 −15 tasks/testing.rb
View
@@ -1 +1,5 @@
-default: "--require features/support/env.rb --require features/support/db/mysql.rb --require features/support/db/active_record.rb --require features/support/post_database.rb --require features/step_definitions/alpha_steps.rb --require features/step_definitions/beta_steps.rb --require features/step_definitions/cat_steps.rb --require features/step_definitions/common_steps.rb --require features/step_definitions/datetime_delta_steps.rb --require features/step_definitions/delayed_delta_indexing_steps.rb --require features/step_definitions/extensible_delta_indexing_steps --require features/step_definitions/facet_steps.rb --require features/step_definitions/find_arguments_steps.rb --require features/step_definitions/gamma_steps.rb --require features/step_definitions/search_steps.rb --require features/step_definitions/sphinx_steps.rb"
+default: "--require features/support/env.rb --require features/support/db/mysql.rb --require features/support/db/active_record.rb --require features/support/post_database.rb --require features/step_definitions/alpha_steps.rb --require features/step_definitions/beta_steps.rb --require features/step_definitions/cat_steps.rb --require features/step_definitions/common_steps.rb --require features/step_definitions/datetime_delta_steps.rb --require features/step_definitions/delayed_delta_indexing_steps.rb --require features/step_definitions/extensible_delta_indexing_steps.rb --require features/step_definitions/facet_steps.rb --require features/step_definitions/find_arguments_steps.rb --require features/step_definitions/gamma_steps.rb --require features/step_definitions/search_steps.rb --require features/step_definitions/sphinx_steps.rb"
+
+mysql: "--require features/support/env.rb --require features/support/db/mysql.rb --require features/support/db/active_record.rb --require features/support/post_database.rb --require features/step_definitions/alpha_steps.rb --require features/step_definitions/beta_steps.rb --require features/step_definitions/cat_steps.rb --require features/step_definitions/common_steps.rb --require features/step_definitions/datetime_delta_steps.rb --require features/step_definitions/delayed_delta_indexing_steps.rb --require features/step_definitions/extensible_delta_indexing_steps.rb --require features/step_definitions/facet_steps.rb --require features/step_definitions/find_arguments_steps.rb --require features/step_definitions/gamma_steps.rb --require features/step_definitions/search_steps.rb --require features/step_definitions/sphinx_steps.rb features/attribute_transformation.feature features/attribute_updates.feature features/datetime_deltas.feature features/delayed_delta_indexing.feature features/deleting_instances.feature features/extensible_delta_indexing.feature features/facets.feature features/facets_across_model.feature features/handling_edits.feature features/retry_stale_indexes.feature features/searching_across_models.feature features/searching_by_model.feature features/searching_with_find_arguments.feature features/sphinx_detection.feature"
+
+postgresql: "--require features/support/env.rb --require features/support/db/postgresql.rb --require features/support/db/active_record.rb --require features/support/post_database.rb --require features/step_definitions/alpha_steps.rb --require features/step_definitions/beta_steps.rb --require features/step_definitions/cat_steps.rb --require features/step_definitions/common_steps.rb --require features/step_definitions/datetime_delta_steps.rb --require features/step_definitions/delayed_delta_indexing_steps.rb --require features/step_definitions/extensible_delta_indexing_steps.rb --require features/step_definitions/facet_steps.rb --require features/step_definitions/find_arguments_steps.rb --require features/step_definitions/gamma_steps.rb --require features/step_definitions/search_steps.rb --require features/step_definitions/sphinx_steps.rb features/attribute_transformation.feature features/attribute_updates.feature features/datetime_deltas.feature features/delayed_delta_indexing.feature features/deleting_instances.feature features/extensible_delta_indexing.feature features/facets.feature features/facets_across_model.feature features/handling_edits.feature features/retry_stale_indexes.feature features/searching_across_models.feature features/searching_by_model.feature features/searching_with_find_arguments.feature features/sphinx_detection.feature"
@@ -28,7 +28,7 @@
ActiveRecord::Base.clear_reloadable_connections!
# Wait for ActiveRecord to catch up.
-sleep 1
+sleep 2
# Set up database tables and records
Dir["features/support/db/migrations/*.rb"].each do |file|
View
@@ -20,13 +20,7 @@
def add_task(name, description)
Cucumber::Rake::Task.new(name, description) do |t|
t.cucumber_opts = "--format pretty"
- t.step_pattern = [
- "features/support/env",
- "features/support/db/#{name}",
- "features/support/db/active_record",
- "features/support/post_database",
- "features/step_definitions/**.rb"
- ]
+ t.profile = name
end
end
@@ -46,13 +40,7 @@ def add_task(name, description)
def add_task(name, description)
Cucumber::Rake::Task.new(name, description) do |t|
t.cucumber_opts = "--format pretty"
- t.step_pattern = [
- "features/support/env",
- "features/support/db/#{name}",
- "features/support/db/active_record",
- "features/support/post_database",
- "features/step_definitions/**.rb"
- ]
+ t.profile = name
t.rcov = true
t.rcov_opts = [
'--exclude', 'spec',
@@ -80,7 +68,11 @@ def add_task(name, description)
"--require #{path}"
}.join(" ")
+ features = FileList["features/*.feature"].join(" ")
+
File.open('cucumber.yml', 'w') { |f|
- f.write "default: \"#{default_requires} #{step_definitions}\""
+ f.write "default: \"#{default_requires} #{step_definitions}\"\n\n"
+ f.write "mysql: \"#{default_requires} #{step_definitions} #{features}\"\n\n"
+ f.write "postgresql: \"#{default_requires.gsub(/mysql/, 'postgresql')} #{step_definitions} #{features}\""
}
end

0 comments on commit 2ec9352

Please sign in to comment.