Skip to content
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
View
40 features/dsl/mirror_rake_tasks/inside_capistrano_namespace.feature
@@ -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"
+ """
View
110 ...dsl/mirror_rake_tasks/inside_capistrano_namespace/with_defined_namespace_argument.feature
@@ -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.
-
-
- """
View
60 ...ures/dsl/mirror_rake_tasks/inside_capistrano_namespace/with_defined_task_argument.feature
@@ -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.
-
- """
View
35 features/dsl/mirror_rake_tasks/inside_capistrano_namespace/with_undefined_argument.feature
@@ -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.
-
- """
View
290 features/dsl/mirror_rake_tasks/inside_capistrano_namespace/without_arguments.feature
@@ -1,290 +0,0 @@
-Feature: The #mirror_rake_tasks DSL method, inside a Capistrano namespace, without arguments
-
- 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.
- """
- And the output should contain:
- """
- cap ns:without_period # Ends without period.
- """
- And the output should contain:
- """
- cap ns:long # My long task -- it has a ve...
- """
- And the output should contain:
- """
- cap ns:with_one_arg # My task with one argument.
- """
- 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.
- """
- And the output should contain:
- """
- cap ns:with_two_args # My task with two arguments.
- """
- And the output should contain:
- """
- cap ns:with_three_args # My task with three arguments.
- """
-
- 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
- end
- end
- """
- When I run `cap -e ns:with_period`
- Then the output should contain exactly:
- """
- ------------------------------------------------------------
- cap ns:with_period
- ------------------------------------------------------------
- Ends with period.
-
-
- """
-
- Scenario: mirror Rake task 'with_period' 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"
- """
-
- Scenario: mirror Rake task 'without_period' with its description
- 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 -e ns:without_period`
- Then the output should contain exactly:
- """
- ------------------------------------------------------------
- cap ns:without_period
- ------------------------------------------------------------
- Ends without period.
-
-
- """
-
- Scenario: mirror Rake task 'long' with its description
- 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 -e ns:long`
- Then the output should contain exactly:
- """
- ------------------------------------------------------------
- cap ns:long
- ------------------------------------------------------------
- My long task -- it has a very, very, very, very, very, very, very, very, very,
- very, very, very, very, very, very, very, very, very, very, very, very, very,
- very, very, very, very long description.
-
-
- """
-
- Scenario: mirror Rake task 'with_one_arg' with its description
- 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 -e ns:with_one_arg`
- Then the output should contain exactly:
- """
- ------------------------------------------------------------
- cap ns:with_one_arg
- ------------------------------------------------------------
- My task with one argument.
-
- Set environment variable THE_ARG if you want to pass a Rake task argument.
-
-
- """
-
- 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
- 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' 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:my_namespace`
- Then the output should contain:
- """
- * executing `ns:my_namespace'
- * 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 my_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
- 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
- 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.
-
-
- """
-
- Scenario: mirror Rake task 'with_two_args' with its description
- 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 -e ns:with_two_args`
- Then the output should contain exactly:
- """
- ------------------------------------------------------------
- cap ns:with_two_args
- ------------------------------------------------------------
- My task with two arguments.
-
- Set environment variables MY_ARG1 and MY_ARG2 if you want to pass Rake task
- arguments.
-
-
- """
-
- Scenario: mirror Rake task 'with_three_args' with its description
- 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 -e ns:with_three_args`
- Then the output should contain exactly:
- """
- ------------------------------------------------------------
- cap ns:with_three_args
- ------------------------------------------------------------
- My task with three arguments.
-
- Set environment variables AN_ARG1, AN_ARG2, and AN_ARG3 if you want to pass Rake
- task arguments.
-
-
- """
View
76 features/dsl/mirror_rake_tasks/with_defined_namespace_argument.feature
@@ -9,11 +9,14 @@ Feature: The #mirror_rake_tasks DSL method with an argument of a defined namespa
And a Capfile with:
"""
Cape do
- mirror_rake_tasks 'my_namespace'
+ mirror_rake_tasks :my_namespace
end
"""
When I run `cap -vT`
- Then the output should not contain "cap with_period"
+ Then the output should contain:
+ """
+ cap my_namespace # A task that shadows a names...
+ """
And the output should contain:
"""
cap my_namespace:in_a_namespace # My task in a namespace.
@@ -22,75 +25,42 @@ Feature: The #mirror_rake_tasks DSL method with an argument of a defined namespa
"""
cap my_namespace:my_nested_namespace:in_a_nested_namespace # My task in a nested namespace.
"""
+ And the output should not contain "cap with_period"
- Scenario: do not mirror Rake task 'with_period'
+ Scenario: mirror a Rake task that shadows the matching namespace with its implementation
Given a full-featured Rakefile
And a Capfile with:
"""
- Cape do
- mirror_rake_tasks :my_namespace
- end
- """
- When I run `cap -e with_period`
- Then the output should contain exactly:
- """
- The task `with_period' does not exist.
-
- """
+ set :current_path, '/path/to/current/deployed/application'
+ set :rails_env, 'production'
- Scenario: mirror Rake task 'my_namespace' with its description
- Given a full-featured Rakefile
- And a Capfile with:
- """
Cape do
- mirror_rake_tasks :my_namespace
+ mirror_rake_tasks 'my_namespace'
end
"""
- When I run `cap -e my_namespace`
- Then the output should contain exactly:
+ When I run `cap my_namespace`
+ Then the output should contain:
"""
- ------------------------------------------------------------
- cap my_namespace
- ------------------------------------------------------------
- A task that shadows a namespace.
-
-
+ * executing `my_namespace'
+ * 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 my_namespace"
+ `my_namespace' is only run for servers matching {}, but no servers matched
"""
- Scenario: mirror Rake task 'my_namespace:in_a_namespace' with its description
+ Scenario: mirror a Rake task in the matching namespace with its implementation
Given a full-featured Rakefile
And a Capfile with:
"""
- Cape do
- mirror_rake_tasks :my_namespace
- end
- """
- When I run `cap -e my_namespace:in_a_namespace`
- Then the output should contain exactly:
- """
- ------------------------------------------------------------
- cap my_namespace:in_a_namespace
- ------------------------------------------------------------
- My task in a namespace.
-
+ set :current_path, '/path/to/current/deployed/application'
+ set :rails_env, 'production'
- """
-
- 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:
- """
Cape do
mirror_rake_tasks :my_namespace
end
"""
- When I run `cap -e my_namespace:my_nested_namespace:in_a_nested_namespace`
- Then the output should contain exactly:
+ When I run `cap my_namespace:my_nested_namespace:in_a_nested_namespace`
+ Then the output should contain:
"""
- ------------------------------------------------------------
- cap my_namespace:my_nested_namespace:in_a_nested_namespace
- ------------------------------------------------------------
- My task in a nested namespace.
-
-
+ * executing `my_namespace:my_nested_namespace:in_a_nested_namespace'
+ * 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 my_namespace:my_nested_namespace:in_a_nested_namespace"
+ `my_namespace:my_nested_namespace:in_a_nested_namespace' is only run for servers matching {}, but no servers matched
"""
View
39 features/dsl/mirror_rake_tasks/with_defined_task_and_valid_options.feature
@@ -0,0 +1,39 @@
+Feature: The #mirror_rake_tasks DSL method with arguments of a defined task and valid options, and with environment variables
+
+ 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:
+ """
+ Cape do
+ mirror_rake_tasks :with_period, :roles => :app
+ end
+ """
+ When I run `cap -vT`
+ Then the output should contain:
+ """
+ cap with_period # Ends with period.
+ """
+ And the output should not contain "without_period"
+
+ Scenario: mirror the matching Rake task with its implementation
+ Given a full-featured Rakefile
+ And a Capfile with:
+ """
+ set :current_path, '/path/to/current/deployed/application'
+ set :rails_env, 'production'
+
+ Cape do
+ mirror_rake_tasks 'with_period', :roles => :app
+ end
+ """
+ When I run `cap with_period`
+ Then the output should contain:
+ """
+ * executing `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"
+ `with_period' is only run for servers matching {:roles=>:app}, but no servers matched
+ """
View
192 ...ake_tasks/with_defined_task_and_valid_options_arguments_and_environment_variables.feature
@@ -4,84 +4,32 @@ Feature: The #mirror_rake_tasks DSL method with arguments of a defined task and
As a developer using Cape,
I want to use the Cape DSL.
- Scenario: mirror all Rake tasks with the specified options
+ Scenario: mirror only the matching Rake task
Given a full-featured Rakefile
And a Capfile with:
"""
Cape do
- mirror_rake_tasks :roles => :app do |env|
+ mirror_rake_tasks :with_period, :roles => :app do |env|
env['RAILS_ENV'] = rails_env
end
end
"""
When I run `cap -vT`
Then the output should contain:
"""
- cap with_period # Ends with period.
- """
- And the output should contain:
- """
- cap without_period # Ends without period.
- """
- And the output should contain:
- """
- cap long # My long task -- it has a ve...
- """
- And the output should contain:
- """
- cap with_one_arg # My task with one argument.
- """
- And the output should contain:
- """
- cap my_namespace # A task that shadows a names...
- """
- And the output should contain:
- """
- cap my_namespace:in_a_namespace # My task in a namespace.
- """
- And the output should contain:
- """
- cap my_namespace:my_nested_namespace:in_a_nested_namespace # My task in a nested namespace.
- """
- And the output should contain:
- """
- cap with_two_args # My task with two arguments.
- """
- And the output should contain:
- """
- cap with_three_args # My task with three arguments.
+ cap with_period # Ends with period.
"""
+ And the output should not contain "without_period"
- Scenario: mirror Rake task 'with_period' with its description
- Given a full-featured Rakefile
- And a Capfile with:
- """
- Cape do
- mirror_rake_tasks :roles => :app do |env|
- env['RAILS_ENV'] = rails_env
- end
- end
- """
- When I run `cap -e with_period`
- Then the output should contain exactly:
- """
- ------------------------------------------------------------
- cap with_period
- ------------------------------------------------------------
- Ends with period.
-
-
- """
-
- Scenario: mirror Rake task 'with_period' with its implementation
+ Scenario: mirror the matching Rake task with its implementation
Given a full-featured Rakefile
And a Capfile with:
"""
set :current_path, '/path/to/current/deployed/application'
set :rails_env, 'production'
Cape do
- mirror_rake_tasks :roles => :app do |env|
+ mirror_rake_tasks 'with_period', :roles => :app do |env|
env['RAILS_ENV'] = rails_env
end
end
@@ -93,131 +41,3 @@ Feature: The #mirror_rake_tasks DSL method with arguments of a defined task and
* 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 RAILS_ENV=\"production\""
`with_period' is only run for servers matching {:roles=>:app}, but no servers matched
"""
-
- Scenario: mirror Rake task 'with_period' with its implementation, ignoring nil environment variable names
- Given a full-featured Rakefile
- And a Capfile with:
- """
- set :current_path, '/path/to/current/deployed/application'
- set :rails_env, 'production'
-
- Cape do
- mirror_rake_tasks :roles => :app do |env|
- env[nil] = 'foo'
- end
- end
- """
- When I run `cap with_period`
- Then the output should contain:
- """
- * executing `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"
- `with_period' is only run for servers matching {:roles=>:app}, but no servers matched
- """
-
- Scenario: mirror Rake task 'with_period' with its implementation, ignoring nil environment variable values
- Given a full-featured Rakefile
- And a Capfile with:
- """
- set :current_path, '/path/to/current/deployed/application'
- set :rails_env, 'production'
-
- Cape do
- mirror_rake_tasks :roles => :app do |env|
- env['FOO'] = nil
- end
- end
- """
- When I run `cap with_period`
- Then the output should contain:
- """
- * executing `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"
- `with_period' is only run for servers matching {:roles=>:app}, but no servers matched
- """
-
- Scenario: mirror Rake task 'with_one_arg' with its description
- Given a full-featured Rakefile
- And a Capfile with:
- """
- Cape do
- mirror_rake_tasks :roles => :app do |env|
- env['RAILS_ENV'] = rails_env
- end
- end
- """
- When I run `cap -e with_one_arg`
- Then the output should contain exactly:
- """
- ------------------------------------------------------------
- cap with_one_arg
- ------------------------------------------------------------
- My task with one argument.
-
- Set environment variable THE_ARG if you want to pass a Rake task argument.
-
-
- """
-
- Scenario: mirror Rake task 'my_namespace:in_a_namespace' with its description
- Given a full-featured Rakefile
- And a Capfile with:
- """
- Cape do
- mirror_rake_tasks :roles => :app do |env|
- env['RAILS_ENV'] = rails_env
- end
- end
- """
- When I run `cap -e my_namespace:in_a_namespace`
- Then the output should contain exactly:
- """
- ------------------------------------------------------------
- cap my_namespace:in_a_namespace
- ------------------------------------------------------------
- My task in a namespace.
-
-
- """
-
- Scenario: mirror Rake task 'with_three_args' with its implementation
- Given a full-featured Rakefile
- And a Capfile with:
- """
- set :current_path, '/path/to/current/deployed/application'
- set :rails_env, 'production'
-
- Cape do
- mirror_rake_tasks :roles => :app do |env|
- env['RAILS_ENV'] = rails_env
- end
- end
- """
- When I run `cap with_three_args AN_ARG1="a value for an_arg1" AN_ARG2="a value for an_arg2" AN_ARG3="a value for an_arg3"`
- Then the output should contain:
- """
- * executing `with_three_args'
- * 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_three_args[\"a value for an_arg1\",\"a value for an_arg2\",\"a value for an_arg3\"] RAILS_ENV=\"production\""
- `with_three_args' is only run for servers matching {:roles=>:app}, but no servers matched
- """
-
- Scenario: mirror Rake task 'with_three_args' with its implementation not enforcing arguments
- Given a full-featured Rakefile
- And a Capfile with:
- """
- set :current_path, '/path/to/current/deployed/application'
- set :rails_env, 'production'
-
- Cape do
- mirror_rake_tasks :roles => :app do |env|
- env['RAILS_ENV'] = rails_env
- end
- end
- """
- When I run `cap with_three_args AN_ARG2="a value for an_arg2"`
- Then the output should contain:
- """
- * executing `with_three_args'
- * 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_three_args[,\"a value for an_arg2\",] RAILS_ENV=\"production\""
- `with_three_args' is only run for servers matching {:roles=>:app}, but no servers matched
- """
View
37 features/dsl/mirror_rake_tasks/with_defined_task_argument.feature
@@ -9,46 +9,31 @@ Feature: The #mirror_rake_tasks DSL method with an argument of a defined task
And a Capfile with:
"""
Cape do
- mirror_rake_tasks 'with_period'
+ mirror_rake_tasks :with_period
end
"""
When I run `cap -vT`
Then the output should contain:
"""
cap with_period # Ends with period.
"""
- And the output should not contain "cap without_period"
+ And the output should not contain "without_period"
- Scenario: mirror Rake task 'with_period' with its description
+ Scenario: mirror the matching Rake task with its implementation
Given a full-featured Rakefile
And a Capfile with:
"""
- Cape do
- mirror_rake_tasks :with_period
- end
- """
- When I run `cap -e with_period`
- Then the output should contain exactly:
- """
- ------------------------------------------------------------
- cap with_period
- ------------------------------------------------------------
- Ends with period.
+ set :current_path, '/path/to/current/deployed/application'
+ set :rails_env, 'production'
-
- """
-
- Scenario: do not mirror Rake task 'without_period'
- Given a full-featured Rakefile
- And a Capfile with:
- """
Cape do
- mirror_rake_tasks :with_period
+ mirror_rake_tasks 'with_period'
end
"""
- When I run `cap -e without_period`
- Then the output should contain exactly:
+ When I run `cap with_period`
+ Then the output should contain:
"""
- The task `without_period' does not exist.
-
+ * executing `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"
+ `with_period' is only run for servers matching {}, but no servers matched
"""
View
43 features/dsl/mirror_rake_tasks/with_defined_task_argument_and_environment_variables.feature
@@ -0,0 +1,43 @@
+Feature: The #mirror_rake_tasks DSL method with an argument of a defined task, and with environment variables
+
+ 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:
+ """
+ Cape do
+ mirror_rake_tasks :with_period do |env|
+ env['RAILS_ENV'] = rails_env
+ end
+ end
+ """
+ When I run `cap -vT`
+ Then the output should contain:
+ """
+ cap with_period # Ends with period.
+ """
+ And the output should not contain "without_period"
+
+ Scenario: mirror the matching Rake task with its implementation
+ Given a full-featured Rakefile
+ And a Capfile with:
+ """
+ set :current_path, '/path/to/current/deployed/application'
+ set :rails_env, 'production'
+
+ Cape do
+ mirror_rake_tasks 'with_period' do |env|
+ env['RAILS_ENV'] = rails_env
+ end
+ end
+ """
+ When I run `cap with_period`
+ Then the output should contain:
+ """
+ * executing `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 RAILS_ENV=\"production\""
+ `with_period' is only run for servers matching {}, but no servers matched
+ """
View
29 features/dsl/mirror_rake_tasks/with_environment_variables.feature
@@ -0,0 +1,29 @@
+Feature: The #mirror_rake_tasks DSL method with environment variables
+
+ 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 a Rake task with its implementation
+ Given a full-featured Rakefile
+ And a Capfile with:
+ """
+ set :current_path, '/path/to/current/deployed/application'
+ set :rails_env, 'production'
+
+ Cape do
+ mirror_rake_tasks do |env|
+ env['RAILS_ENV'] = rails_env
+ env[nil] = 'foo'
+ env['FOO'] = nil
+ env['SOME_OTHER'] = 'var'
+ end
+ end
+ """
+ When I run `cap with_period`
+ Then the output should contain:
+ """
+ * executing `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 RAILS_ENV=\"production\" SOME_OTHER=\"var\""
+ `with_period' is only run for servers matching {}, but no servers matched
+ """
View
20 features/dsl/mirror_rake_tasks/with_undefined_argument.feature
@@ -9,23 +9,9 @@ Feature: The #mirror_rake_tasks DSL method with an undefined argument
And a Capfile with:
"""
Cape do
- mirror_rake_tasks 'this_does_not_exist'
- end
- """
- When I run `cap -vT`
- Then the output should not contain "cap with_period"
-
- Scenario: do not mirror Rake task 'with_period'
- Given a full-featured Rakefile
- And a Capfile with:
- """
- Cape do
mirror_rake_tasks :this_does_not_exist
end
"""
- When I run `cap -e with_period`
- Then the output should contain exactly:
- """
- The task `with_period' does not exist.
-
- """
+ When I run `cap -vT`
+ Then the output should not contain "cap this_does_not_exist"
+ And the output should not contain "cap with_period"
View
69 features/dsl/mirror_rake_tasks/with_valid_options_argument.feature
@@ -1,75 +1,10 @@
-Feature: The #mirror_rake_tasks DSL method with arguments of a defined task and valid options, and with environment variables
+Feature: The #mirror_rake_tasks DSL method with an argument of valid options
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 with the specified options
- Given a full-featured Rakefile
- And a Capfile with:
- """
- Cape do
- mirror_rake_tasks :roles => :app
- end
- """
- When I run `cap -vT`
- Then the output should contain:
- """
- cap with_period # Ends with period.
- """
- And the output should contain:
- """
- cap without_period # Ends without period.
- """
- And the output should contain:
- """
- cap long # My long task -- it has a ve...
- """
- And the output should contain:
- """
- cap with_one_arg # My task with one argument.
- """
- And the output should contain:
- """
- cap my_namespace # A task that shadows a names...
- """
- And the output should contain:
- """
- cap my_namespace:in_a_namespace # My task in a namespace.
- """
- And the output should contain:
- """
- cap my_namespace:my_nested_namespace:in_a_nested_namespace # My task in a nested namespace.
- """
- And the output should contain:
- """
- cap with_two_args # My task with two arguments.
- """
- And the output should contain:
- """
- cap with_three_args # My task with three arguments.
- """
-
- Scenario: mirror Rake task 'with_period' with its description
- Given a full-featured Rakefile
- And a Capfile with:
- """
- Cape do
- mirror_rake_tasks :roles => :app
- end
- """
- When I run `cap -e with_period`
- Then the output should contain exactly:
- """
- ------------------------------------------------------------
- cap with_period
- ------------------------------------------------------------
- Ends with period.
-
-
- """
-
- Scenario: mirror Rake task 'with_period' with its implementation
+ Scenario: mirror a Rake task with its implementation
Given a full-featured Rakefile
And a Capfile with:
"""
View
26 ...ures/dsl/mirror_rake_tasks/with_valid_options_arguments_and_environment_variables.feature
@@ -0,0 +1,26 @@
+Feature: The #mirror_rake_tasks DSL method with an argument of valid options, and with environment variables
+
+ 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 a Rake task with its implementation
+ Given a full-featured Rakefile
+ And a Capfile with:
+ """
+ set :current_path, '/path/to/current/deployed/application'
+ set :rails_env, 'production'
+
+ Cape do
+ mirror_rake_tasks :roles => :app do |env|
+ env['RAILS_ENV'] = rails_env
+ end
+ end
+ """
+ When I run `cap with_period`
+ Then the output should contain:
+ """
+ * executing `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 RAILS_ENV=\"production\""
+ `with_period' is only run for servers matching {:roles=>:app}, but no servers matched
+ """
View
7 features/dsl/mirror_rake_tasks/without_arguments.feature
@@ -84,6 +84,7 @@ Feature: The #mirror_rake_tasks DSL method without arguments
"""
* executing `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"
+ `with_period' is only run for servers matching {}, but no servers matched
"""
Scenario: mirror Rake task 'without_period' with its description
@@ -181,6 +182,7 @@ Feature: The #mirror_rake_tasks DSL method without arguments
"""
* executing `my_namespace'
* 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 my_namespace"
+ `my_namespace' is only run for servers matching {}, but no servers matched
"""
Scenario: mirror Rake task 'my_namespace:in_a_namespace' with its description
@@ -236,6 +238,7 @@ Feature: The #mirror_rake_tasks DSL method without arguments
"""
* executing `my_namespace:my_nested_namespace:in_a_nested_namespace'
* 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 my_namespace:my_nested_namespace:in_a_nested_namespace"
+ `my_namespace:my_nested_namespace:in_a_nested_namespace' is only run for servers matching {}, but no servers matched
"""
Scenario: mirror Rake task 'with_two_args' with its description
@@ -297,7 +300,7 @@ Feature: The #mirror_rake_tasks DSL method without arguments
"""
* executing `with_three_args'
* 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_three_args[\"a value for an_arg1\",\"a value for an_arg2\",\"a value for an_arg3\"]"
-
+ `with_three_args' is only run for servers matching {}, but no servers matched
"""
Scenario: mirror Rake task 'with_three_args' with its implementation not enforcing arguments
@@ -315,5 +318,5 @@ Feature: The #mirror_rake_tasks DSL method without arguments
"""
* executing `with_three_args'
* 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_three_args[,\"a value for an_arg2\",]"
-
+ `with_three_args' is only run for servers matching {}, but no servers matched
"""

0 comments on commit fee17ac

Please sign in to comment.
Something went wrong with that request. Please try again.