cape 1.7.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -1
- data/.rspec +1 -1
- data/.travis.yml +6 -2
- data/Appraisals +11 -0
- data/Gemfile +4 -4
- data/Guardfile +10 -4
- data/History.markdown +6 -0
- data/README.markdown +32 -17
- data/Rakefile +33 -13
- data/cape.gemspec +6 -2
- data/features/dsl/each_rake_task/unqualified.feature +0 -6
- data/features/dsl/each_rake_task/with_defined_namespace.feature +1 -1
- data/features/dsl/each_rake_task/with_defined_task.feature +4 -4
- data/features/dsl/each_rake_task/with_undefined_task_or_namespace.feature +2 -2
- data/features/dsl/mirror_rake_tasks/inside_capistrano_namespace.feature +3 -4
- data/features/dsl/mirror_rake_tasks/unqualified.feature +89 -32
- data/features/dsl/mirror_rake_tasks/with_cd.feature +18 -12
- data/features/dsl/mirror_rake_tasks/with_cd_and_environment_variables.feature +6 -4
- data/features/dsl/mirror_rake_tasks/with_defined_namespace.feature +7 -3
- data/features/dsl/mirror_rake_tasks/with_defined_task.feature +10 -8
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_cd.feature +10 -8
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_cd_and_environment_variables.feature +10 -8
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_environment_variables.feature +21 -17
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_rename.feature +4 -2
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_rename_and_cd.feature +4 -2
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_rename_and_cd_and_environment_variables.feature +4 -2
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_rename_and_environment_variables.feature +4 -2
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_rename_and_valid_options.feature +4 -2
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_rename_and_valid_options_and_cd.feature +4 -2
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_rename_and_valid_options_and_cd_and_environment_variables.feature +4 -2
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_rename_and_valid_options_and_environment_variables.feature +4 -2
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_valid_options.feature +22 -18
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_valid_options_and_cd.feature +10 -8
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_valid_options_and_cd_and_environment_variables.feature +10 -8
- data/features/dsl/mirror_rake_tasks/with_defined_task_and_valid_options_and_environment_variables.feature +22 -18
- data/features/dsl/mirror_rake_tasks/with_environment_variables.feature +14 -10
- data/features/dsl/mirror_rake_tasks/with_rename.feature +3 -1
- data/features/dsl/mirror_rake_tasks/with_rename_and_cd.feature +3 -1
- data/features/dsl/mirror_rake_tasks/with_rename_and_cd_and_environment_variables.feature +3 -1
- data/features/dsl/mirror_rake_tasks/with_rename_and_environment_variables.feature +3 -1
- data/features/dsl/mirror_rake_tasks/with_rename_and_valid_options.feature +3 -1
- data/features/dsl/mirror_rake_tasks/with_rename_and_valid_options_and_cd.feature +3 -1
- data/features/dsl/mirror_rake_tasks/with_rename_and_valid_options_and_cd_and_environment_variables.feature +3 -1
- data/features/dsl/mirror_rake_tasks/with_rename_and_valid_options_and_environment_variables.feature +3 -1
- data/features/dsl/mirror_rake_tasks/with_undefined_task_or_namespace.feature +2 -2
- data/features/dsl/mirror_rake_tasks/with_valid_options.feature +12 -8
- data/features/dsl/mirror_rake_tasks/with_valid_options_and_cd.feature +6 -4
- data/features/dsl/mirror_rake_tasks/with_valid_options_and_cd_and_environment_variables.feature +6 -4
- data/features/dsl/mirror_rake_tasks/with_valid_options_and_environment_variables.feature +14 -10
- data/features/dsl/rake_executable.feature +1 -6
- data/features/step_definitions.rb +0 -12
- data/gemfiles/capistrano_v2.x.gemfile +7 -0
- data/gemfiles/capistrano_v2.x.gemfile.lock +66 -0
- data/gemfiles/rake_v0.9.3.gemfile +7 -0
- data/gemfiles/rake_v0.9.3.gemfile.lock +66 -0
- data/gemfiles/rake_v10.x.gemfile +7 -0
- data/gemfiles/rake_v10.x.gemfile.lock +66 -0
- data/lib/cape/capistrano.rb +39 -29
- data/lib/cape/version.rb +1 -1
- data/lib/cape/xterm.rb +1 -1
- data/spec/cape/capistrano_spec.rb +13 -3
- data/spec/cape/core_ext/hash_spec.rb +5 -5
- data/spec/cape/core_ext/symbol_spec.rb +10 -8
- data/spec/cape/deprecation/base_sharedspec.rb +6 -2
- data/spec/cape/deprecation/capistrano_deprecated_define_rake_wrapper_spec.rb +123 -101
- data/spec/cape/deprecation/dsl_deprecated_mirror_rake_tasks_spec.rb +119 -97
- data/spec/cape/dsl_deprecated_spec.rb +128 -134
- data/spec/cape/dsl_spec.rb +56 -63
- data/spec/cape/hash_list_spec.rb +40 -20
- data/spec/cape/rake_spec.rb +59 -51
- data/spec/cape/recipe_definition_spec.rb +44 -32
- data/spec/cape/util_spec.rb +18 -18
- data/spec/cape/version_spec.rb +1 -1
- data/spec/cape/xterm_spec.rb +33 -33
- data/spec/cape_spec.rb +9 -7
- data/spec/spec_helper.rb +5 -1
- metadata +100 -86
data/lib/cape/version.rb
CHANGED
data/lib/cape/xterm.rb
CHANGED
@@ -3,13 +3,23 @@ require 'cape/capistrano'
|
|
3
3
|
require 'cape/rake'
|
4
4
|
|
5
5
|
describe Cape::Capistrano do
|
6
|
+
subject(:capistrano) { capistrano_class.new }
|
7
|
+
|
8
|
+
let(:capistrano_class) { described_class }
|
9
|
+
|
6
10
|
describe 'without specified attributes' do
|
7
|
-
|
11
|
+
describe '#rake' do
|
12
|
+
specify { expect(capistrano.rake).to eq(Cape::Rake.new) }
|
13
|
+
end
|
8
14
|
end
|
9
15
|
|
10
16
|
describe 'with specified attributes' do
|
11
|
-
subject {
|
17
|
+
subject(:capistrano) {
|
18
|
+
capistrano_class.new :rake => 'the specified value of #rake'
|
19
|
+
}
|
12
20
|
|
13
|
-
|
21
|
+
describe '#rake' do
|
22
|
+
specify { expect(capistrano.rake).to eq('the specified value of #rake') }
|
23
|
+
end
|
14
24
|
end
|
15
25
|
end
|
@@ -2,12 +2,12 @@ require 'spec_helper'
|
|
2
2
|
require 'cape/core_ext/hash'
|
3
3
|
|
4
4
|
describe Hash do
|
5
|
-
subject { {:foo => 'bar', :baz => 'qux', :quux => 'corge'} }
|
5
|
+
subject(:hash) { {:foo => 'bar', :baz => 'qux', :quux => 'corge'} }
|
6
6
|
|
7
|
-
describe '
|
8
|
-
it '
|
9
|
-
|
10
|
-
:quux => 'corge'
|
7
|
+
describe '#slice with keys that are present and those that are not' do
|
8
|
+
it 'returns the expected subset hash' do
|
9
|
+
expect(hash.slice(:baz, :fizzle, :quux)).to eq(:baz => 'qux',
|
10
|
+
:quux => 'corge')
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -2,15 +2,17 @@ require 'spec_helper'
|
|
2
2
|
require 'cape/core_ext/symbol'
|
3
3
|
|
4
4
|
describe Symbol do
|
5
|
-
|
6
|
-
|
7
|
-
|
5
|
+
describe '#<=>' do
|
6
|
+
describe 'with a lower symbol' do
|
7
|
+
specify { expect(:foo <=> :bar).to eq(1) }
|
8
|
+
end
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
10
|
+
describe 'with a higher symbol' do
|
11
|
+
specify { expect(:baz <=> :qux).to eq(-1) }
|
12
|
+
end
|
12
13
|
|
13
|
-
|
14
|
-
|
14
|
+
describe 'with itself' do
|
15
|
+
specify { expect(:quux <=> :quux).to eq(0) }
|
16
|
+
end
|
15
17
|
end
|
16
18
|
end
|
@@ -3,7 +3,9 @@ require 'cape/deprecation/base'
|
|
3
3
|
|
4
4
|
shared_examples_for "a #{Cape::Deprecation::Base.name}" do
|
5
5
|
describe '-- without specified attributes --' do
|
6
|
-
|
6
|
+
describe '#stream' do
|
7
|
+
specify { expect(subject.stream).to eq($stderr) }
|
8
|
+
end
|
7
9
|
end
|
8
10
|
|
9
11
|
describe '-- with a different #stream --' do
|
@@ -13,6 +15,8 @@ shared_examples_for "a #{Cape::Deprecation::Base.name}" do
|
|
13
15
|
|
14
16
|
let(:different_stream) { StringIO.new }
|
15
17
|
|
16
|
-
|
18
|
+
describe '#stream' do
|
19
|
+
specify { expect(subject.stream).to eq(different_stream) }
|
20
|
+
end
|
17
21
|
end
|
18
22
|
end
|
@@ -4,154 +4,176 @@ require 'cape/deprecation/base_sharedspec'
|
|
4
4
|
require 'cape/xterm'
|
5
5
|
|
6
6
|
describe Cape::Deprecation::CapistranoDeprecatedDefineRakeWrapper do
|
7
|
-
|
7
|
+
subject(:capistrano_deprecated_define_rake_wrapper) {
|
8
|
+
capistrano_deprecated_define_rake_wrapper_class.new
|
9
|
+
}
|
10
|
+
|
11
|
+
let(:capistrano_deprecated_define_rake_wrapper_class) { described_class }
|
12
|
+
|
13
|
+
it_behaves_like "a #{Cape::Deprecation::Base.name}"
|
8
14
|
|
9
15
|
let(:deprecation_preamble) {
|
10
16
|
Cape::XTerm.bold_and_foreground_red('*** DEPRECATED:') + ' '
|
11
17
|
}
|
12
18
|
|
13
19
|
describe '-- without specified attributes --' do
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
20
|
+
describe '#formatted_message' do
|
21
|
+
specify {
|
22
|
+
expect(capistrano_deprecated_define_rake_wrapper.formatted_message).to eq(deprecation_preamble +
|
23
|
+
Cape::XTerm.bold('`define_rake_wrapper`. ' +
|
24
|
+
'Use this instead: `define_rake_wrapper`'))
|
25
|
+
}
|
26
|
+
end
|
19
27
|
end
|
20
28
|
|
21
29
|
describe '-- with #task' do
|
22
30
|
before :each do
|
23
|
-
|
31
|
+
capistrano_deprecated_define_rake_wrapper.task = {:name => :foo}
|
24
32
|
end
|
25
33
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
34
|
+
describe '#formatted_message' do
|
35
|
+
specify {
|
36
|
+
expect(capistrano_deprecated_define_rake_wrapper.formatted_message).to eq(deprecation_preamble +
|
37
|
+
Cape::XTerm.bold('`define_rake_wrapper {:name=>:foo}`. ' +
|
38
|
+
'Use this instead: ' +
|
39
|
+
'`define_rake_wrapper {:name=>:foo}`'))
|
40
|
+
}
|
41
|
+
end
|
32
42
|
|
33
43
|
describe 'and with #named_arguments' do
|
34
44
|
before :each do
|
35
|
-
|
45
|
+
capistrano_deprecated_define_rake_wrapper.named_arguments = {:bar => :baz}
|
36
46
|
end
|
37
47
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
48
|
+
describe '#formatted_message' do
|
49
|
+
specify {
|
50
|
+
expect(capistrano_deprecated_define_rake_wrapper.formatted_message).to eq(deprecation_preamble +
|
51
|
+
Cape::XTerm.bold('`' +
|
52
|
+
'define_rake_wrapper {:name=>:foo}, ' +
|
53
|
+
':bar => :baz' +
|
54
|
+
'`. ' +
|
55
|
+
'Use this instead: ' +
|
56
|
+
'`' +
|
57
|
+
'define_rake_wrapper({:name=>:foo}) { |recipes| ' +
|
58
|
+
'recipes.options[:bar] = :baz ' +
|
59
|
+
'}' +
|
60
|
+
'`'))
|
61
|
+
}
|
62
|
+
end
|
51
63
|
|
52
64
|
describe 'and with #env --' do
|
53
65
|
before :each do
|
54
|
-
|
66
|
+
capistrano_deprecated_define_rake_wrapper.env['QUX'] = 'quux'
|
55
67
|
end
|
56
68
|
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
69
|
+
describe '#formatted_message' do
|
70
|
+
specify {
|
71
|
+
expect(capistrano_deprecated_define_rake_wrapper.formatted_message).to eq(deprecation_preamble +
|
72
|
+
Cape::XTerm.bold('`' +
|
73
|
+
'define_rake_wrapper({:name=>:foo}, ' +
|
74
|
+
':bar => :baz) { |env| ' +
|
75
|
+
'env["QUX"] = "quux" ' +
|
76
|
+
'}' +
|
77
|
+
'`. ' +
|
78
|
+
'Use this instead: ' +
|
79
|
+
'`' +
|
80
|
+
'define_rake_wrapper({:name=>:foo}) { |recipes| ' +
|
81
|
+
'recipes.options[:bar] = :baz; ' +
|
82
|
+
'recipes.env["QUX"] = "quux" ' +
|
83
|
+
'}' +
|
84
|
+
'`'))
|
85
|
+
}
|
86
|
+
end
|
73
87
|
end
|
74
88
|
end
|
75
89
|
|
76
90
|
describe 'and with #env --' do
|
77
91
|
before :each do
|
78
|
-
|
92
|
+
capistrano_deprecated_define_rake_wrapper.env['BAR'] = 'baz'
|
79
93
|
end
|
80
94
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
+
describe '#formatted_message' do
|
96
|
+
specify {
|
97
|
+
expect(capistrano_deprecated_define_rake_wrapper.formatted_message).to eq(deprecation_preamble +
|
98
|
+
Cape::XTerm.bold('`' +
|
99
|
+
'define_rake_wrapper({:name=>:foo}) { |env| ' +
|
100
|
+
'env["BAR"] = "baz" ' +
|
101
|
+
'}' +
|
102
|
+
'`. ' +
|
103
|
+
'Use this instead: ' +
|
104
|
+
'`' +
|
105
|
+
'define_rake_wrapper({:name=>:foo}) { |recipes| ' +
|
106
|
+
'recipes.env["BAR"] = "baz" ' +
|
107
|
+
'}' +
|
108
|
+
'`'))
|
109
|
+
}
|
110
|
+
end
|
95
111
|
end
|
96
112
|
end
|
97
113
|
|
98
114
|
describe '-- with #named_arguments' do
|
99
115
|
before :each do
|
100
|
-
|
116
|
+
capistrano_deprecated_define_rake_wrapper.named_arguments = {:foo => :bar}
|
101
117
|
end
|
102
118
|
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
119
|
+
describe '#formatted_message' do
|
120
|
+
specify {
|
121
|
+
expect(capistrano_deprecated_define_rake_wrapper.formatted_message).to eq(deprecation_preamble +
|
122
|
+
Cape::XTerm.bold('`define_rake_wrapper :foo => :bar`. ' +
|
123
|
+
'Use this instead: ' +
|
124
|
+
'`' +
|
125
|
+
'define_rake_wrapper { |recipes| ' +
|
126
|
+
'recipes.options[:foo] = :bar ' +
|
127
|
+
'}' +
|
128
|
+
'`'))
|
129
|
+
}
|
130
|
+
end
|
113
131
|
|
114
132
|
describe 'and with #env --' do
|
115
133
|
before :each do
|
116
|
-
|
134
|
+
capistrano_deprecated_define_rake_wrapper.env['BAZ'] = 'qux'
|
117
135
|
end
|
118
136
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
137
|
+
describe '#formatted_message' do
|
138
|
+
specify {
|
139
|
+
expect(capistrano_deprecated_define_rake_wrapper.formatted_message).to eq(deprecation_preamble +
|
140
|
+
Cape::XTerm.bold('`' +
|
141
|
+
'define_rake_wrapper(:foo => :bar) { |env| ' +
|
142
|
+
'env["BAZ"] = "qux" ' +
|
143
|
+
'}' +
|
144
|
+
'`. ' +
|
145
|
+
'Use this instead: ' +
|
146
|
+
'`' +
|
147
|
+
'define_rake_wrapper { |recipes| ' +
|
148
|
+
'recipes.options[:foo] = :bar; ' +
|
149
|
+
'recipes.env["BAZ"] = "qux" ' +
|
150
|
+
'}' +
|
151
|
+
'`'))
|
152
|
+
}
|
153
|
+
end
|
134
154
|
end
|
135
155
|
end
|
136
156
|
|
137
157
|
describe '-- with #env --' do
|
138
158
|
before :each do
|
139
|
-
|
159
|
+
capistrano_deprecated_define_rake_wrapper.env['FOO'] = 'bar'
|
140
160
|
end
|
141
161
|
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
162
|
+
describe '#formatted_message' do
|
163
|
+
specify {
|
164
|
+
expect(capistrano_deprecated_define_rake_wrapper.formatted_message).to eq(deprecation_preamble +
|
165
|
+
Cape::XTerm.bold('`' +
|
166
|
+
'define_rake_wrapper { |env| ' +
|
167
|
+
'env["FOO"] = "bar" ' +
|
168
|
+
'}' +
|
169
|
+
'`. ' +
|
170
|
+
'Use this instead: ' +
|
171
|
+
'`' +
|
172
|
+
'define_rake_wrapper { |recipes| ' +
|
173
|
+
'recipes.env["FOO"] = "bar" ' +
|
174
|
+
'}' +
|
175
|
+
'`'))
|
176
|
+
}
|
177
|
+
end
|
156
178
|
end
|
157
179
|
end
|
@@ -4,150 +4,172 @@ require 'cape/deprecation/base_sharedspec'
|
|
4
4
|
require 'cape/xterm'
|
5
5
|
|
6
6
|
describe Cape::Deprecation::DSLDeprecatedMirrorRakeTasks do
|
7
|
-
|
7
|
+
subject(:dsl_deprecated_mirror_rake_tasks) {
|
8
|
+
dsl_deprecated_mirror_rake_tasks_class.new
|
9
|
+
}
|
10
|
+
|
11
|
+
let(:dsl_deprecated_mirror_rake_tasks_class) { described_class }
|
12
|
+
|
13
|
+
it_behaves_like "a #{Cape::Deprecation::Base.name}"
|
8
14
|
|
9
15
|
let(:deprecation_preamble) {
|
10
16
|
Cape::XTerm.bold_and_foreground_red('*** DEPRECATED:') + ' '
|
11
17
|
}
|
12
18
|
|
13
19
|
describe '-- without specified attributes --' do
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
20
|
+
describe '#formatted_message' do
|
21
|
+
specify {
|
22
|
+
expect(dsl_deprecated_mirror_rake_tasks.formatted_message).to eq(deprecation_preamble +
|
23
|
+
Cape::XTerm.bold('`mirror_rake_tasks`. ' +
|
24
|
+
'Use this instead: `mirror_rake_tasks`'))
|
25
|
+
}
|
26
|
+
end
|
19
27
|
end
|
20
28
|
|
21
29
|
describe '-- with #task_expression' do
|
22
30
|
before :each do
|
23
|
-
|
31
|
+
dsl_deprecated_mirror_rake_tasks.task_expression = :foo
|
24
32
|
end
|
25
33
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
34
|
+
describe '#formatted_message' do
|
35
|
+
specify {
|
36
|
+
expect(dsl_deprecated_mirror_rake_tasks.formatted_message).to eq(deprecation_preamble +
|
37
|
+
Cape::XTerm.bold('`mirror_rake_tasks :foo`. ' +
|
38
|
+
'Use this instead: `mirror_rake_tasks :foo`'))
|
39
|
+
}
|
40
|
+
end
|
31
41
|
|
32
42
|
describe 'and with #options' do
|
33
43
|
before :each do
|
34
|
-
|
44
|
+
dsl_deprecated_mirror_rake_tasks.options = {:bar => :baz}
|
35
45
|
end
|
36
46
|
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
+
describe '#formatted_message' do
|
48
|
+
specify {
|
49
|
+
expect(dsl_deprecated_mirror_rake_tasks.formatted_message).to eq(deprecation_preamble +
|
50
|
+
Cape::XTerm.bold('`mirror_rake_tasks :foo, :bar => :baz`. ' +
|
51
|
+
'Use this instead: ' +
|
52
|
+
'`' +
|
53
|
+
'mirror_rake_tasks(:foo) { |recipes| ' +
|
54
|
+
'recipes.options[:bar] = :baz ' +
|
55
|
+
'}' +
|
56
|
+
'`'))
|
57
|
+
}
|
58
|
+
end
|
47
59
|
|
48
60
|
describe 'and with #env --' do
|
49
61
|
before :each do
|
50
|
-
|
62
|
+
dsl_deprecated_mirror_rake_tasks.env['QUX'] = 'quux'
|
51
63
|
end
|
52
64
|
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
65
|
+
describe '#formatted_message' do
|
66
|
+
specify {
|
67
|
+
expect(dsl_deprecated_mirror_rake_tasks.formatted_message).to eq(deprecation_preamble +
|
68
|
+
Cape::XTerm.bold('`' +
|
69
|
+
'mirror_rake_tasks(:foo, ' +
|
70
|
+
':bar => :baz) { |env| ' +
|
71
|
+
'env["QUX"] = "quux" ' +
|
72
|
+
'}' +
|
73
|
+
'`. ' +
|
74
|
+
'Use this instead: ' +
|
75
|
+
'`' +
|
76
|
+
'mirror_rake_tasks(:foo) { |recipes| ' +
|
77
|
+
'recipes.options[:bar] = :baz; ' +
|
78
|
+
'recipes.env["QUX"] = "quux" ' +
|
79
|
+
'}' +
|
80
|
+
'`'))
|
81
|
+
}
|
82
|
+
end
|
69
83
|
end
|
70
84
|
end
|
71
85
|
|
72
86
|
describe 'and with #env --' do
|
73
87
|
before :each do
|
74
|
-
|
88
|
+
dsl_deprecated_mirror_rake_tasks.env['BAR'] = 'baz'
|
75
89
|
end
|
76
90
|
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
+
describe '#formatted_message' do
|
92
|
+
specify {
|
93
|
+
expect(dsl_deprecated_mirror_rake_tasks.formatted_message).to eq(deprecation_preamble +
|
94
|
+
Cape::XTerm.bold('`' +
|
95
|
+
'mirror_rake_tasks(:foo) { |env| ' +
|
96
|
+
'env["BAR"] = "baz" ' +
|
97
|
+
'}' +
|
98
|
+
'`. ' +
|
99
|
+
'Use this instead: ' +
|
100
|
+
'`' +
|
101
|
+
'mirror_rake_tasks(:foo) { |recipes| ' +
|
102
|
+
'recipes.env["BAR"] = "baz" ' +
|
103
|
+
'}' +
|
104
|
+
'`'))
|
105
|
+
}
|
106
|
+
end
|
91
107
|
end
|
92
108
|
end
|
93
109
|
|
94
110
|
describe '-- with #options' do
|
95
111
|
before :each do
|
96
|
-
|
112
|
+
dsl_deprecated_mirror_rake_tasks.options = {:foo => :bar}
|
97
113
|
end
|
98
114
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
115
|
+
describe '#formatted_message' do
|
116
|
+
specify {
|
117
|
+
expect(dsl_deprecated_mirror_rake_tasks.formatted_message).to eq(deprecation_preamble +
|
118
|
+
Cape::XTerm.bold('`mirror_rake_tasks :foo => :bar`. ' +
|
119
|
+
'Use this instead: ' +
|
120
|
+
'`' +
|
121
|
+
'mirror_rake_tasks { |recipes| ' +
|
122
|
+
'recipes.options[:foo] = :bar ' +
|
123
|
+
'}' +
|
124
|
+
'`'))
|
125
|
+
}
|
126
|
+
end
|
109
127
|
|
110
128
|
describe 'and with #env --' do
|
111
129
|
before :each do
|
112
|
-
|
130
|
+
dsl_deprecated_mirror_rake_tasks.env['BAZ'] = 'qux'
|
113
131
|
end
|
114
132
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
133
|
+
describe '#formatted_message' do
|
134
|
+
specify {
|
135
|
+
expect(dsl_deprecated_mirror_rake_tasks.formatted_message).to eq(deprecation_preamble +
|
136
|
+
Cape::XTerm.bold('`' +
|
137
|
+
'mirror_rake_tasks(:foo => :bar) { |env| ' +
|
138
|
+
'env["BAZ"] = "qux" ' +
|
139
|
+
'}' +
|
140
|
+
'`. ' +
|
141
|
+
'Use this instead: ' +
|
142
|
+
'`' +
|
143
|
+
'mirror_rake_tasks { |recipes| ' +
|
144
|
+
'recipes.options[:foo] = :bar; ' +
|
145
|
+
'recipes.env["BAZ"] = "qux" ' +
|
146
|
+
'}' +
|
147
|
+
'`'))
|
148
|
+
}
|
149
|
+
end
|
130
150
|
end
|
131
151
|
end
|
132
152
|
|
133
153
|
describe '-- with #env --' do
|
134
154
|
before :each do
|
135
|
-
|
155
|
+
dsl_deprecated_mirror_rake_tasks.env['FOO'] = 'bar'
|
136
156
|
end
|
137
157
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
158
|
+
describe '#formatted_message' do
|
159
|
+
specify {
|
160
|
+
expect(dsl_deprecated_mirror_rake_tasks.formatted_message).to eq(deprecation_preamble +
|
161
|
+
Cape::XTerm.bold('`' +
|
162
|
+
'mirror_rake_tasks { |env| ' +
|
163
|
+
'env["FOO"] = "bar" ' +
|
164
|
+
'}' +
|
165
|
+
'`. ' +
|
166
|
+
'Use this instead: ' +
|
167
|
+
'`' +
|
168
|
+
'mirror_rake_tasks { |recipes| ' +
|
169
|
+
'recipes.env["FOO"] = "bar" ' +
|
170
|
+
'}' +
|
171
|
+
'`'))
|
172
|
+
}
|
173
|
+
end
|
152
174
|
end
|
153
175
|
end
|