rake-funnel 0.3.2.pre → 0.4.0.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rspec +2 -2
- data/Gemfile +4 -0
- data/README.md +2 -2
- data/lib/rake/funnel/ambiguous_file_error.rb +31 -29
- data/lib/rake/funnel/execution_error.rb +28 -26
- data/lib/rake/funnel/extensions/case/camel_case.rb +24 -19
- data/lib/rake/funnel/extensions/case/pascal_case.rb +24 -19
- data/lib/rake/funnel/extensions/case.rb +3 -3
- data/lib/rake/funnel/extensions/common_path.rb +60 -52
- data/lib/rake/funnel/extensions/disable_colors.rb +33 -27
- data/lib/rake/funnel/extensions/rexml.rb +27 -23
- data/lib/rake/funnel/extensions/shell.rb +92 -56
- data/lib/rake/funnel/extensions/windows_path.rb +15 -11
- data/lib/rake/funnel/framework.rb +11 -16
- data/lib/rake/funnel/integration/progress_report.rb +72 -70
- data/lib/rake/funnel/integration/sync_output.rb +12 -8
- data/lib/rake/funnel/integration/teamcity/nunit_plugin.rb +61 -55
- data/lib/rake/funnel/integration/teamcity/progress_report.rb +39 -33
- data/lib/rake/funnel/integration/teamcity/service_messages.rb +46 -40
- data/lib/rake/funnel/integration/teamcity/teamcity.rb +19 -15
- data/lib/rake/funnel/integration/teamcity.rb +3 -5
- data/lib/rake/funnel/support/argument_mapper/key_value_pair.rb +16 -10
- data/lib/rake/funnel/support/argument_mapper/styles/default.rb +39 -31
- data/lib/rake/funnel/support/argument_mapper/styles/msbuild.rb +41 -33
- data/lib/rake/funnel/support/argument_mapper/styles/msdeploy.rb +55 -47
- data/lib/rake/funnel/support/argument_mapper/styles/nunit.rb +41 -33
- data/lib/rake/funnel/support/argument_mapper/styles.rb +3 -5
- data/lib/rake/funnel/support/argument_mapper/switch.rb +16 -10
- data/lib/rake/funnel/support/argument_mapper/value.rb +16 -10
- data/lib/rake/funnel/support/assembly_version/from_version_files.rb +39 -35
- data/lib/rake/funnel/support/assembly_version/languages/cs +5 -5
- data/lib/rake/funnel/support/assembly_version/languages/fs +12 -12
- data/lib/rake/funnel/support/assembly_version/languages/vb +5 -5
- data/lib/rake/funnel/support/assembly_version_writer.rb +56 -52
- data/lib/rake/funnel/support/binary_version_reader.rb +37 -32
- data/lib/rake/funnel/support/copier.rb +31 -27
- data/lib/rake/funnel/support/environments/loader.rb +46 -40
- data/lib/rake/funnel/support/environments.rb +3 -3
- data/lib/rake/funnel/support/internal/finder.rb +55 -51
- data/lib/rake/funnel/support/internal/instantiate_symbol.rb +38 -34
- data/lib/rake/funnel/support/mapper.rb +57 -53
- data/lib/rake/funnel/support/mono.rb +21 -17
- data/lib/rake/funnel/support/msbuild/build_tool.rb +30 -24
- data/lib/rake/funnel/support/msbuild.rb +3 -3
- data/lib/rake/funnel/support/msdeploy/registry_patch.rb +90 -84
- data/lib/rake/funnel/support/msdeploy.rb +3 -3
- data/lib/rake/funnel/support/patch.rb +41 -37
- data/lib/rake/funnel/support/specs_remover.rb +66 -62
- data/lib/rake/funnel/support/template_engine.rb +30 -26
- data/lib/rake/funnel/support/timing/report.rb +95 -89
- data/lib/rake/funnel/support/timing/statistics.rb +32 -26
- data/lib/rake/funnel/support/timing.rb +3 -3
- data/lib/rake/funnel/support/version_info.rb +103 -72
- data/lib/rake/funnel/support/which.rb +19 -15
- data/lib/rake/funnel/support/zipper.rb +53 -49
- data/lib/rake/funnel/tasks/assembly_version.rb +44 -40
- data/lib/rake/funnel/tasks/bin_path.rb +45 -41
- data/lib/rake/funnel/tasks/copy.rb +43 -39
- data/lib/rake/funnel/tasks/environments.rb +89 -89
- data/lib/rake/funnel/tasks/msbuild.rb +55 -51
- data/lib/rake/funnel/tasks/msdeploy.rb +54 -50
- data/lib/rake/funnel/tasks/nunit.rb +52 -48
- data/lib/rake/funnel/tasks/paket.rb +51 -47
- data/lib/rake/funnel/tasks/quick_template.rb +53 -49
- data/lib/rake/funnel/tasks/side_by_side_specs.rb +41 -37
- data/lib/rake/funnel/tasks/timing.rb +108 -104
- data/lib/rake/funnel/tasks/zip.rb +46 -42
- data/lib/rake/funnel/version.rb +1 -1
- data/lib/rake/funnel.rb +7 -7
- data/rake-funnel.gemspec +12 -3
- data/spec/rake/funnel/execution_error_spec.rb +67 -67
- data/spec/rake/funnel/extensions/case/camel_case_spec.rb +17 -17
- data/spec/rake/funnel/extensions/case/pascal_case_spec.rb +17 -17
- data/spec/rake/funnel/extensions/common_path_spec.rb +56 -56
- data/spec/rake/funnel/extensions/disable_colors_spec.rb +33 -33
- data/spec/rake/funnel/extensions/rexml_spec.rb +20 -20
- data/spec/rake/funnel/extensions/shell_spec.rb +237 -237
- data/spec/rake/funnel/extensions/windows_path_spec.rb +5 -5
- data/spec/rake/funnel/integration/progress_report_spec.rb +149 -149
- data/spec/rake/funnel/integration/sync_output_spec.rb +16 -16
- data/spec/rake/funnel/integration/teamcity/nunit_plugin_spec.rb +110 -110
- data/spec/rake/funnel/integration/teamcity/progress_report_spec.rb +174 -174
- data/spec/rake/funnel/integration/teamcity/service_messages_spec.rb +136 -136
- data/spec/rake/funnel/integration/teamcity/teamcity_spec.rb +34 -34
- data/spec/rake/funnel/support/argument_mapper/styles/msdeploy_spec.rb +222 -222
- data/spec/rake/funnel/support/argument_mapper/styles/nunit_spec.rb +25 -25
- data/spec/rake/funnel/support/argument_mapper/styles/styles_spec.rb +214 -214
- data/spec/rake/funnel/support/assembly_version/from_version_files_spec.rb +66 -61
- data/spec/rake/funnel/support/assembly_version_writer_spec.rb +140 -140
- data/spec/rake/funnel/support/binary_version_reader_spec.rb +29 -29
- data/spec/rake/funnel/support/copier_spec.rb +58 -58
- data/spec/rake/funnel/support/environments/loader_spec.rb +143 -143
- data/spec/rake/funnel/support/internal/finder_spec.rb +229 -229
- data/spec/rake/funnel/support/internal/instantiate_symbol_spec.rb +182 -183
- data/spec/rake/funnel/support/mapper_spec.rb +87 -87
- data/spec/rake/funnel/support/mono_spec.rb +57 -57
- data/spec/rake/funnel/support/msbuild/build_tool_spec.rb +21 -21
- data/spec/rake/funnel/support/msdeploy/registry_patch_spec.rb +139 -139
- data/spec/rake/funnel/support/patch_spec.rb +108 -108
- data/spec/rake/funnel/support/specs_remover/Sample.csproj +28 -28
- data/spec/rake/funnel/support/specs_remover_spec.rb +116 -116
- data/spec/rake/funnel/support/template_engine_spec.rb +65 -65
- data/spec/rake/funnel/support/timing/report_spec.rb +129 -129
- data/spec/rake/funnel/support/version_info_spec.rb +333 -228
- data/spec/rake/funnel/support/which_spec.rb +65 -65
- data/spec/rake/funnel/support/zipper_spec.rb +77 -77
- data/spec/rake/funnel/tasks/assembly_version_spec.rb +45 -45
- data/spec/rake/funnel/tasks/bin_path_spec.rb +52 -52
- data/spec/rake/funnel/tasks/copy_spec.rb +44 -44
- data/spec/rake/funnel/tasks/environments_spec.rb +249 -247
- data/spec/rake/funnel/tasks/msbuild_spec.rb +91 -91
- data/spec/rake/funnel/tasks/msdeploy_spec.rb +220 -220
- data/spec/rake/funnel/tasks/nunit_spec.rb +74 -74
- data/spec/rake/funnel/tasks/paket_spec.rb +140 -142
- data/spec/rake/funnel/tasks/quick_template_spec.rb +62 -62
- data/spec/rake/funnel/tasks/side_by_side_specs_spec.rb +58 -58
- data/spec/rake/funnel/tasks/timing_spec.rb +133 -133
- data/spec/rake/funnel/tasks/zip_spec.rb +50 -50
- data/spec/spec_helper.rb +43 -33
- metadata +2 -3
- data/lib/rake/funnel/support/side_by_side_specs.rb +0 -3
@@ -1,143 +1,143 @@
|
|
1
|
-
describe Rake::Funnel::Support::Environments::Loader do
|
2
|
-
let(:store) {
|
3
|
-
double(Configatron::Store).as_null_object
|
4
|
-
}
|
5
|
-
|
6
|
-
let(:customizer) { nil }
|
7
|
-
|
8
|
-
let(:config) {
|
9
|
-
{
|
10
|
-
name: 'environment name',
|
11
|
-
config_files: config_files.keys.map(&:to_s)
|
12
|
-
}
|
13
|
-
}
|
14
|
-
|
15
|
-
before {
|
16
|
-
config_files.each do |file, content|
|
17
|
-
allow(File).to receive(:read).with(file.to_s).and_return(content)
|
18
|
-
end
|
19
|
-
|
20
|
-
allow(Rake).to receive(:rake_output_message)
|
21
|
-
}
|
22
|
-
|
23
|
-
describe 'loading configuration' do
|
24
|
-
let(:config_files) {
|
25
|
-
{
|
26
|
-
one: 'one: 23',
|
27
|
-
two: 'two: 42'
|
28
|
-
}
|
29
|
-
}
|
30
|
-
|
31
|
-
before {
|
32
|
-
described_class.load_configuration(config, store, customizer)
|
33
|
-
}
|
34
|
-
|
35
|
-
it 'should reinitialize the configatron store' do
|
36
|
-
expect(store).to have_received(:unlock!)
|
37
|
-
expect(store).to have_received(:reset!)
|
38
|
-
end
|
39
|
-
|
40
|
-
it 'should save the env to store' do
|
41
|
-
expect(store).to have_received(:env=).with(config[:name])
|
42
|
-
end
|
43
|
-
|
44
|
-
it 'should load all config files' do
|
45
|
-
config[:config_files].each do |file|
|
46
|
-
expect(File).to have_received(:read).with(file)
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
it "should add each config file's values to the store" do
|
51
|
-
expect(store).to have_received(:configure_from_hash).with({ 'one' => 23 })
|
52
|
-
expect(store).to have_received(:configure_from_hash).with({ 'two' => 42 })
|
53
|
-
end
|
54
|
-
|
55
|
-
it 'should lock the store' do
|
56
|
-
expect(store).to have_received(:lock!)
|
57
|
-
end
|
58
|
-
|
59
|
-
describe 'customization' do
|
60
|
-
let(:customizer) { double(Proc).as_null_object }
|
61
|
-
|
62
|
-
it 'should run the customizer' do
|
63
|
-
expect(customizer).to have_received(:call).with(store)
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
context 'config file with overriding values' do
|
68
|
-
let(:config_files) {
|
69
|
-
{
|
70
|
-
one: 'foo: bar',
|
71
|
-
two: 'foo: baz'
|
72
|
-
}
|
73
|
-
}
|
74
|
-
|
75
|
-
let(:store) {
|
76
|
-
Configatron::RootStore.new
|
77
|
-
}
|
78
|
-
|
79
|
-
it 'should merge config values' do
|
80
|
-
expect(store.foo).to eq('baz')
|
81
|
-
end
|
82
|
-
end
|
83
|
-
|
84
|
-
context 'env also defined in config file' do
|
85
|
-
let(:config_files) {
|
86
|
-
{
|
87
|
-
with_env: 'env: foo'
|
88
|
-
}
|
89
|
-
}
|
90
|
-
|
91
|
-
let(:store) {
|
92
|
-
Configatron::RootStore.new
|
93
|
-
}
|
94
|
-
|
95
|
-
it 'should override env from config' do
|
96
|
-
expect(store.env).to eq('foo')
|
97
|
-
end
|
98
|
-
end
|
99
|
-
|
100
|
-
context 'empty config file' do
|
101
|
-
let(:config_files) {
|
102
|
-
{
|
103
|
-
empty: ''
|
104
|
-
}
|
105
|
-
}
|
106
|
-
|
107
|
-
it 'should configure with empty hash' do
|
108
|
-
expect(store).to have_received(:configure_from_hash).with({})
|
109
|
-
end
|
110
|
-
end
|
111
|
-
end
|
112
|
-
|
113
|
-
describe 'config file with ERb' do
|
114
|
-
context 'ERb success' do
|
115
|
-
let(:config_files) {
|
116
|
-
{
|
117
|
-
with_erb: 'foo: <%= 40 + 2 %>'
|
118
|
-
}
|
119
|
-
}
|
120
|
-
|
121
|
-
before {
|
122
|
-
described_class.load_configuration(config, store)
|
123
|
-
}
|
124
|
-
|
125
|
-
it 'should evaluate ERb' do
|
126
|
-
expect(store).to have_received(:configure_from_hash).with({ 'foo' => 42 })
|
127
|
-
end
|
128
|
-
end
|
129
|
-
|
130
|
-
context 'ERb failure' do
|
131
|
-
let(:config_files) {
|
132
|
-
{
|
133
|
-
with_erb: 'bogus: <%= 42 + "a" %>'
|
134
|
-
}
|
135
|
-
}
|
136
|
-
|
137
|
-
it 'should report file name' do
|
138
|
-
expect { described_class.load_configuration(config, store) }
|
139
|
-
.to raise_error { |ex| expect(ex.backtrace.join("\n")).to match(/with_erb/) }
|
140
|
-
end
|
141
|
-
end
|
142
|
-
end
|
143
|
-
end
|
1
|
+
describe Rake::Funnel::Support::Environments::Loader do
|
2
|
+
let(:store) {
|
3
|
+
double(Configatron::Store).as_null_object
|
4
|
+
}
|
5
|
+
|
6
|
+
let(:customizer) { nil }
|
7
|
+
|
8
|
+
let(:config) {
|
9
|
+
{
|
10
|
+
name: 'environment name',
|
11
|
+
config_files: config_files.keys.map(&:to_s)
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
before {
|
16
|
+
config_files.each do |file, content|
|
17
|
+
allow(File).to receive(:read).with(file.to_s).and_return(content)
|
18
|
+
end
|
19
|
+
|
20
|
+
allow(Rake).to receive(:rake_output_message)
|
21
|
+
}
|
22
|
+
|
23
|
+
describe 'loading configuration' do
|
24
|
+
let(:config_files) {
|
25
|
+
{
|
26
|
+
one: 'one: 23',
|
27
|
+
two: 'two: 42'
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
before {
|
32
|
+
described_class.load_configuration(config, store, customizer)
|
33
|
+
}
|
34
|
+
|
35
|
+
it 'should reinitialize the configatron store' do
|
36
|
+
expect(store).to have_received(:unlock!)
|
37
|
+
expect(store).to have_received(:reset!)
|
38
|
+
end
|
39
|
+
|
40
|
+
it 'should save the env to store' do
|
41
|
+
expect(store).to have_received(:env=).with(config[:name])
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'should load all config files' do
|
45
|
+
config[:config_files].each do |file|
|
46
|
+
expect(File).to have_received(:read).with(file)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
it "should add each config file's values to the store" do
|
51
|
+
expect(store).to have_received(:configure_from_hash).with({ 'one' => 23 })
|
52
|
+
expect(store).to have_received(:configure_from_hash).with({ 'two' => 42 })
|
53
|
+
end
|
54
|
+
|
55
|
+
it 'should lock the store' do
|
56
|
+
expect(store).to have_received(:lock!)
|
57
|
+
end
|
58
|
+
|
59
|
+
describe 'customization' do
|
60
|
+
let(:customizer) { double(Proc).as_null_object }
|
61
|
+
|
62
|
+
it 'should run the customizer' do
|
63
|
+
expect(customizer).to have_received(:call).with(store)
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
context 'config file with overriding values' do
|
68
|
+
let(:config_files) {
|
69
|
+
{
|
70
|
+
one: 'foo: bar',
|
71
|
+
two: 'foo: baz'
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
let(:store) {
|
76
|
+
Configatron::RootStore.new
|
77
|
+
}
|
78
|
+
|
79
|
+
it 'should merge config values' do
|
80
|
+
expect(store.foo).to eq('baz')
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
context 'env also defined in config file' do
|
85
|
+
let(:config_files) {
|
86
|
+
{
|
87
|
+
with_env: 'env: foo'
|
88
|
+
}
|
89
|
+
}
|
90
|
+
|
91
|
+
let(:store) {
|
92
|
+
Configatron::RootStore.new
|
93
|
+
}
|
94
|
+
|
95
|
+
it 'should override env from config' do
|
96
|
+
expect(store.env).to eq('foo')
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
100
|
+
context 'empty config file' do
|
101
|
+
let(:config_files) {
|
102
|
+
{
|
103
|
+
empty: ''
|
104
|
+
}
|
105
|
+
}
|
106
|
+
|
107
|
+
it 'should configure with empty hash' do
|
108
|
+
expect(store).to have_received(:configure_from_hash).with({})
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
describe 'config file with ERb' do
|
114
|
+
context 'ERb success' do
|
115
|
+
let(:config_files) {
|
116
|
+
{
|
117
|
+
with_erb: 'foo: <%= 40 + 2 %>'
|
118
|
+
}
|
119
|
+
}
|
120
|
+
|
121
|
+
before {
|
122
|
+
described_class.load_configuration(config, store)
|
123
|
+
}
|
124
|
+
|
125
|
+
it 'should evaluate ERb' do
|
126
|
+
expect(store).to have_received(:configure_from_hash).with({ 'foo' => 42 })
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
context 'ERb failure' do
|
131
|
+
let(:config_files) {
|
132
|
+
{
|
133
|
+
with_erb: 'bogus: <%= 42 + "a" %>'
|
134
|
+
}
|
135
|
+
}
|
136
|
+
|
137
|
+
it 'should report file name' do
|
138
|
+
expect { described_class.load_configuration(config, store) }
|
139
|
+
.to raise_error { |ex| expect(ex.backtrace.join("\n")).to match(/with_erb/) }
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|