-
Notifications
You must be signed in to change notification settings - Fork 5
/
with_defined_namespace_argument.feature
110 lines (97 loc) · 3.23 KB
/
with_defined_namespace_argument.feature
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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.
"""