Permalink
Browse files

Reorganize and prune Cucumber features

The intent is to speed up the Cucumber suite while retaining sufficient
feature coverage.

Before: 66 scenarios, 319 steps, ~ 5 minutes
After:  39 scenarios, 188 steps, ~ 3 minutes
  • Loading branch information...
1 parent c8619bf commit fee17ac1aa56fc667ae01a50ea2fbbba34e28011 @njonsson committed Dec 8, 2012
@@ -0,0 +1,40 @@
+Feature: The #mirror_rake_tasks DSL method, inside a Capistrano namespace
+
+ In order to include Rake tasks with descriptions in my Capistrano recipes,
+ As a developer using Cape,
+ I want to use the Cape DSL.
+
+ Scenario: mirror all Rake tasks
+ Given a full-featured Rakefile
+ And a Capfile with:
+ """
+ namespace :ns do
+ Cape do |cape|
+ cape.mirror_rake_tasks
+ end
+ end
+ """
+ When I run `cap -vT`
+ Then the output should contain:
+ """
+ cap ns:with_period # Ends with period.
+ """
+
+ Scenario: mirror a Rake task with its implementation
+ Given a full-featured Rakefile
+ And a Capfile with:
+ """
+ set :current_path, '/path/to/current/deployed/application'
+
+ namespace :ns do
+ Cape do |cape|
+ cape.mirror_rake_tasks
+ end
+ end
+ """
+ When I run `cap ns:with_period`
+ Then the output should contain:
+ """
+ * executing `ns:with_period'
+ * executing "cd /path/to/current/deployed/application && /usr/bin/env `/usr/bin/env bundle check >/dev/null 2>&1; case $? in 0|1 ) echo bundle exec ;; esac` rake with_period"
+ """
@@ -1,110 +0,0 @@
-Feature: The #mirror_rake_tasks DSL method, inside a Capistrano namespace, with an argument of a defined namespace
-
- In order to include Rake tasks with descriptions in my Capistrano recipes,
- As a developer using Cape,
- I want to use the Cape DSL.
-
- Scenario: mirror only the Rake tasks in the matching namespace
- Given a full-featured Rakefile
- And a Capfile with:
- """
- namespace :ns do
- Cape do |cape|
- cape.mirror_rake_tasks 'my_namespace'
- end
- end
- """
- When I run `cap -vT`
- Then the output should not contain "cap ns:with_period"
- And the output should contain:
- """
- cap ns:my_namespace # A task that shadows a names...
- """
- And the output should contain:
- """
- cap ns:my_namespace:in_a_namespace # My task in a namespace.
- """
- And the output should contain:
- """
- cap ns:my_namespace:my_nested_namespace:in_a_nested_namespace # My task in a nested namespace.
- """
-
- Scenario: do not mirror Rake task 'with_period'
- Given a full-featured Rakefile
- And a Capfile with:
- """
- namespace :ns do
- Cape do |cape|
- cape.mirror_rake_tasks :my_namespace
- end
- end
- """
- When I run `cap -e ns:with_period`
- Then the output should contain exactly:
- """
- The task `ns:with_period' does not exist.
-
- """
-
- Scenario: mirror Rake task 'my_namespace' with its description
- Given a full-featured Rakefile
- And a Capfile with:
- """
- namespace :ns do
- Cape do |cape|
- cape.mirror_rake_tasks :my_namespace
- end
- end
- """
- When I run `cap -e ns:my_namespace`
- Then the output should contain exactly:
- """
- ------------------------------------------------------------
- cap ns:my_namespace
- ------------------------------------------------------------
- A task that shadows a namespace.
-
-
- """
-
- Scenario: mirror Rake task 'my_namespace:in_a_namespace' with its description
- Given a full-featured Rakefile
- And a Capfile with:
- """
- namespace :ns do
- Cape do |cape|
- cape.mirror_rake_tasks :my_namespace
- end
- end
- """
- When I run `cap -e ns:my_namespace:in_a_namespace`
- Then the output should contain exactly:
- """
- ------------------------------------------------------------
- cap ns:my_namespace:in_a_namespace
- ------------------------------------------------------------
- My task in a namespace.
-
-
- """
-
- Scenario: mirror Rake task 'my_namespace:my_nested_namespace:in_a_nested_namespace' with its description
- Given a full-featured Rakefile
- And a Capfile with:
- """
- namespace :ns do
- Cape do |cape|
- cape.mirror_rake_tasks :my_namespace
- end
- end
- """
- When I run `cap -e ns:my_namespace:my_nested_namespace:in_a_nested_namespace`
- Then the output should contain exactly:
- """
- ------------------------------------------------------------
- cap ns:my_namespace:my_nested_namespace:in_a_nested_namespace
- ------------------------------------------------------------
- My task in a nested namespace.
-
-
- """
@@ -1,60 +0,0 @@
-Feature: The #mirror_rake_tasks DSL method, inside a Capistrano namespace, with an argument of a defined task
-
- In order to include Rake tasks with descriptions in my Capistrano recipes,
- As a developer using Cape,
- I want to use the Cape DSL.
-
- Scenario: mirror only the matching Rake task
- Given a full-featured Rakefile
- And a Capfile with:
- """
- namespace :ns do
- Cape do |cape|
- cape.mirror_rake_tasks 'with_period'
- end
- end
- """
- When I run `cap -vT`
- Then the output should contain:
- """
- cap ns:with_period # Ends with period.
- """
- And the output should not contain "cap ns:without_period"
-
- Scenario: mirror Rake task 'with_period' with its description
- Given a full-featured Rakefile
- And a Capfile with:
- """
- namespace :ns do
- Cape do |cape|
- cape.mirror_rake_tasks :with_period
- end
- end
- """
- When I run `cap -e ns:with_period`
- Then the output should contain exactly:
- """
- ------------------------------------------------------------
- cap ns:with_period
- ------------------------------------------------------------
- Ends with period.
-
-
- """
-
- Scenario: do not mirror Rake task 'without_period'
- Given a full-featured Rakefile
- And a Capfile with:
- """
- namespace :ns do
- Cape do |cape|
- cape.mirror_rake_tasks :with_period
- end
- end
- """
- When I run `cap -e ns:without_period`
- Then the output should contain exactly:
- """
- The task `ns:without_period' does not exist.
-
- """
@@ -1,35 +0,0 @@
-Feature: The #mirror_rake_tasks DSL method, inside a Capistrano namespace, with an undefined argument
-
- In order to include Rake tasks with descriptions in my Capistrano recipes,
- As a developer using Cape,
- I want to use the Cape DSL.
-
- Scenario: do not mirror any Rake tasks
- Given a full-featured Rakefile
- And a Capfile with:
- """
- namespace :ns do
- Cape do |cape|
- cape.mirror_rake_tasks 'this_does_not_exist'
- end
- end
- """
- When I run `cap -vT`
- Then the output should not contain "cap ns:with_period"
-
- Scenario: do not mirror Rake task 'with_period'
- Given a full-featured Rakefile
- And a Capfile with:
- """
- namespace :ns do
- Cape do |cape|
- cape.mirror_rake_tasks :this_does_not_exist
- end
- end
- """
- When I run `cap -e ns:with_period`
- Then the output should contain exactly:
- """
- The task `ns:with_period' does not exist.
-
- """
Oops, something went wrong.

0 comments on commit fee17ac

Please sign in to comment.