cape 1.7.0 → 1.8.0

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