omnibus 5.4.0 → 5.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +2 -3
  3. data/CHANGELOG.md +21 -0
  4. data/Gemfile +8 -5
  5. data/README.md +3 -1
  6. data/Rakefile +20 -13
  7. data/appveyor.yml +4 -3
  8. data/bin/omnibus +3 -3
  9. data/features/commands/manifest.feature +19 -5
  10. data/features/step_definitions/generator_steps.rb +5 -6
  11. data/features/support/env.rb +4 -4
  12. data/lib/omnibus/build_version.rb +14 -14
  13. data/lib/omnibus/build_version_dsl.rb +3 -3
  14. data/lib/omnibus/builder.rb +50 -61
  15. data/lib/omnibus/changelog.rb +2 -2
  16. data/lib/omnibus/changelog_printer.rb +4 -4
  17. data/lib/omnibus/cleaner.rb +4 -4
  18. data/lib/omnibus/cli/base.rb +15 -15
  19. data/lib/omnibus/cli/cache.rb +13 -13
  20. data/lib/omnibus/cli/changelog.rb +8 -9
  21. data/lib/omnibus/cli/publish.rb +12 -13
  22. data/lib/omnibus/cli.rb +26 -27
  23. data/lib/omnibus/compressor.rb +6 -6
  24. data/lib/omnibus/compressors/base.rb +7 -2
  25. data/lib/omnibus/compressors/dmg.rb +12 -12
  26. data/lib/omnibus/compressors/null.rb +1 -1
  27. data/lib/omnibus/compressors/tgz.rb +8 -8
  28. data/lib/omnibus/config.rb +37 -26
  29. data/lib/omnibus/core_extensions/open_uri.rb +3 -3
  30. data/lib/omnibus/core_extensions.rb +1 -1
  31. data/lib/omnibus/digestable.rb +5 -4
  32. data/lib/omnibus/download_helpers.rb +7 -6
  33. data/lib/omnibus/exceptions.rb +29 -13
  34. data/lib/omnibus/fetcher.rb +0 -1
  35. data/lib/omnibus/fetchers/git_fetcher.rb +7 -7
  36. data/lib/omnibus/fetchers/net_fetcher.rb +19 -19
  37. data/lib/omnibus/fetchers/path_fetcher.rb +1 -1
  38. data/lib/omnibus/file_syncer.rb +3 -3
  39. data/lib/omnibus/generator.rb +60 -47
  40. data/lib/omnibus/git_cache.rb +33 -22
  41. data/lib/omnibus/git_repository.rb +5 -5
  42. data/lib/omnibus/health_check.rb +122 -119
  43. data/lib/omnibus/instrumentation.rb +1 -1
  44. data/lib/omnibus/licensing.rb +348 -60
  45. data/lib/omnibus/logger.rb +12 -9
  46. data/lib/omnibus/logging.rb +1 -1
  47. data/lib/omnibus/manifest.rb +4 -4
  48. data/lib/omnibus/manifest_diff.rb +6 -7
  49. data/lib/omnibus/manifest_entry.rb +1 -1
  50. data/lib/omnibus/metadata.rb +36 -36
  51. data/lib/omnibus/ohai.rb +6 -7
  52. data/lib/omnibus/package.rb +1 -1
  53. data/lib/omnibus/packager.rb +37 -28
  54. data/lib/omnibus/packagers/appx.rb +86 -0
  55. data/lib/omnibus/packagers/base.rb +21 -18
  56. data/lib/omnibus/packagers/bff.rb +22 -24
  57. data/lib/omnibus/packagers/deb.rb +20 -20
  58. data/lib/omnibus/packagers/ips.rb +18 -17
  59. data/lib/omnibus/packagers/makeself.rb +7 -7
  60. data/lib/omnibus/packagers/msi.rb +38 -193
  61. data/lib/omnibus/packagers/pkg.rb +16 -16
  62. data/lib/omnibus/packagers/rpm.rb +53 -54
  63. data/lib/omnibus/packagers/solaris.rb +14 -14
  64. data/lib/omnibus/packagers/windows_base.rb +192 -0
  65. data/lib/omnibus/project.rb +45 -43
  66. data/lib/omnibus/publisher.rb +3 -3
  67. data/lib/omnibus/publishers/artifactory_publisher.rb +39 -39
  68. data/lib/omnibus/publishers/s3_publisher.rb +7 -7
  69. data/lib/omnibus/reports.rb +10 -10
  70. data/lib/omnibus/s3_cache.rb +7 -7
  71. data/lib/omnibus/s3_helpers.rb +8 -7
  72. data/lib/omnibus/semantic_version.rb +1 -1
  73. data/lib/omnibus/software.rb +131 -81
  74. data/lib/omnibus/sugarable.rb +10 -10
  75. data/lib/omnibus/templating.rb +5 -5
  76. data/lib/omnibus/thread_pool.rb +1 -1
  77. data/lib/omnibus/util.rb +5 -5
  78. data/lib/omnibus/version.rb +1 -1
  79. data/lib/omnibus.rb +65 -65
  80. data/omnibus.gemspec +34 -32
  81. data/resources/appx/AppxManifest.xml.erb +18 -0
  82. data/resources/appx/assets/clear.png +0 -0
  83. data/spec/fixtures/licensing/license_scout/snoopy/ruby_bundler-bundler-audit-0.5.0-COPYING.txt +674 -0
  84. data/spec/fixtures/licensing/license_scout/snoopy/ruby_bundler-inifile-3.0.0-README.md +215 -0
  85. data/spec/fixtures/licensing/license_scout/snoopy/snoopy-dependency-licenses.json +24 -0
  86. data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-inifile-3.0.0-README.md +215 -0
  87. data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-mime-types-3.1-Licence.rdoc +25 -0
  88. data/spec/fixtures/licensing/license_scout/zlib/ruby_bundler-mini_portile2-2.1.0-LICENSE.txt +20 -0
  89. data/spec/fixtures/licensing/license_scout/zlib/zlib-dependency-licenses.json +32 -0
  90. data/spec/functional/builder_spec.rb +149 -150
  91. data/spec/functional/fetchers/git_fetcher_spec.rb +69 -71
  92. data/spec/functional/fetchers/net_fetcher_spec.rb +79 -79
  93. data/spec/functional/fetchers/path_fetcher_spec.rb +19 -20
  94. data/spec/functional/file_syncer_spec.rb +74 -74
  95. data/spec/functional/licensing_spec.rb +344 -35
  96. data/spec/functional/templating_spec.rb +17 -17
  97. data/spec/spec_helper.rb +20 -20
  98. data/spec/support/examples.rb +21 -15
  99. data/spec/support/file_helpers.rb +1 -1
  100. data/spec/support/git_helpers.rb +37 -37
  101. data/spec/support/matchers.rb +3 -3
  102. data/spec/support/ohai_helpers.rb +4 -4
  103. data/spec/support/path_helpers.rb +2 -2
  104. data/spec/support/shell_helpers.rb +2 -2
  105. data/spec/unit/build_version_dsl_spec.rb +5 -5
  106. data/spec/unit/build_version_spec.rb +63 -63
  107. data/spec/unit/builder_spec.rb +86 -70
  108. data/spec/unit/changelog_spec.rb +4 -4
  109. data/spec/unit/changelogprinter_spec.rb +130 -0
  110. data/spec/unit/cleanroom_spec.rb +11 -11
  111. data/spec/unit/compressor_spec.rb +16 -16
  112. data/spec/unit/compressors/base_spec.rb +6 -6
  113. data/spec/unit/compressors/dmg_spec.rb +76 -76
  114. data/spec/unit/compressors/null_spec.rb +4 -4
  115. data/spec/unit/compressors/tgz_spec.rb +20 -20
  116. data/spec/unit/config_spec.rb +44 -43
  117. data/spec/unit/digestable_spec.rb +13 -13
  118. data/spec/unit/fetcher_spec.rb +11 -12
  119. data/spec/unit/fetchers/git_fetcher_spec.rb +31 -31
  120. data/spec/unit/fetchers/net_fetcher_spec.rb +172 -173
  121. data/spec/unit/fetchers/path_fetcher_spec.rb +18 -18
  122. data/spec/unit/generator_spec.rb +38 -38
  123. data/spec/unit/git_cache_spec.rb +56 -54
  124. data/spec/unit/git_repository_spec.rb +2 -2
  125. data/spec/unit/health_check_spec.rb +40 -40
  126. data/spec/unit/library_spec.rb +35 -35
  127. data/spec/unit/manifest_diff_spec.rb +10 -11
  128. data/spec/unit/manifest_spec.rb +17 -17
  129. data/spec/unit/metadata_spec.rb +152 -152
  130. data/spec/unit/ohai_spec.rb +5 -5
  131. data/spec/unit/omnibus_spec.rb +31 -31
  132. data/spec/unit/package_spec.rb +20 -20
  133. data/spec/unit/packager_spec.rb +48 -42
  134. data/spec/unit/packagers/appx_spec.rb +165 -0
  135. data/spec/unit/packagers/base_spec.rb +34 -34
  136. data/spec/unit/packagers/bff_spec.rb +60 -60
  137. data/spec/unit/packagers/deb_spec.rb +71 -71
  138. data/spec/unit/packagers/ips_spec.rb +45 -45
  139. data/spec/unit/packagers/makeself_spec.rb +22 -22
  140. data/spec/unit/packagers/msi_spec.rb +141 -147
  141. data/spec/unit/packagers/pkg_spec.rb +59 -60
  142. data/spec/unit/packagers/rpm_spec.rb +125 -126
  143. data/spec/unit/packagers/solaris_spec.rb +52 -52
  144. data/spec/unit/project_spec.rb +137 -135
  145. data/spec/unit/publisher_spec.rb +70 -70
  146. data/spec/unit/publishers/artifactory_publisher_spec.rb +85 -85
  147. data/spec/unit/publishers/s3_publisher_spec.rb +36 -36
  148. data/spec/unit/s3_cacher_spec.rb +34 -34
  149. data/spec/unit/s3_helpers_spec.rb +6 -6
  150. data/spec/unit/semantic_version_spec.rb +2 -2
  151. data/spec/unit/software_spec.rb +346 -384
  152. data/spec/unit/sugarable_spec.rb +10 -10
  153. data/spec/unit/util_spec.rb +60 -60
  154. metadata +54 -6
  155. data/.rubocop.yml +0 -48
@@ -1,131 +1,131 @@
1
- require 'spec_helper'
2
- require 'ohai'
1
+ require "spec_helper"
2
+ require "ohai"
3
3
 
4
4
  module Omnibus
5
5
  describe Project do
6
6
  subject do
7
7
  described_class.new.evaluate do
8
- name 'sample'
9
- friendly_name 'Sample Project'
10
- install_dir '/sample'
11
- maintainer 'Sample Devs'
12
- homepage 'http://example.com/'
8
+ name "sample"
9
+ friendly_name "Sample Project"
10
+ install_dir "/sample"
11
+ maintainer "Sample Devs"
12
+ homepage "http://example.com/"
13
13
 
14
- build_version '1.0'
14
+ build_version "1.0"
15
15
  build_iteration 1
16
16
 
17
- extra_package_file '/path/to/sample_dir'
18
- extra_package_file '/path/to/file.conf'
17
+ extra_package_file "/path/to/sample_dir"
18
+ extra_package_file "/path/to/file.conf"
19
19
 
20
- resources_path 'sample/project/resources'
20
+ resources_path "sample/project/resources"
21
21
  end
22
22
  end
23
23
 
24
- it_behaves_like 'a cleanroom setter', :name, %|name 'chef'|
25
- it_behaves_like 'a cleanroom setter', :friendly_name, %|friendly_name 'Chef'|
26
- it_behaves_like 'a cleanroom setter', :package_name, %|package_name 'chef.package'|
27
- it_behaves_like 'a cleanroom setter', :maintainer, %|maintainer 'Chef Software, Inc'|
28
- it_behaves_like 'a cleanroom setter', :homepage, %|homepage 'https://getchef.com'|
29
- it_behaves_like 'a cleanroom setter', :description, %|description 'Installs the thing'|
30
- it_behaves_like 'a cleanroom setter', :replace, %|replace 'old-chef'|
31
- it_behaves_like 'a cleanroom setter', :conflict, %|conflict 'puppet'|
32
- it_behaves_like 'a cleanroom setter', :build_version, %|build_version '1.2.3'|
33
- it_behaves_like 'a cleanroom setter', :build_iteration, %|build_iteration 1|
34
- it_behaves_like 'a cleanroom setter', :package_user, %|package_user 'chef'|
35
- it_behaves_like 'a cleanroom setter', :package_group, %|package_group 'chef'|
36
- it_behaves_like 'a cleanroom setter', :override, %|override :chefdk, source: 'foo.com'|
37
- it_behaves_like 'a cleanroom setter', :resources_path, %|resources_path '/path'|
38
- it_behaves_like 'a cleanroom setter', :package_scripts_path, %|package_scripts_path '/path/scripts'|
39
- it_behaves_like 'a cleanroom setter', :dependency, %|dependency 'libxslt-dev'|
40
- it_behaves_like 'a cleanroom setter', :runtime_dependency, %|runtime_dependency 'libxslt'|
41
- it_behaves_like 'a cleanroom setter', :exclude, %|exclude 'hamlet'|
42
- it_behaves_like 'a cleanroom setter', :config_file, %|config_file '/path/to/config.rb'|
43
- it_behaves_like 'a cleanroom setter', :extra_package_file, %|extra_package_file '/path/to/asset'|
44
- it_behaves_like 'a cleanroom setter', :text_manifest_path, %|text_manifest_path '/path/to/manifest.txt'|
45
- it_behaves_like 'a cleanroom setter', :json_manifest_path, %|json_manifest_path '/path/to/manifest.txt'|
46
- it_behaves_like 'a cleanroom setter', :build_git_revision, %|build_git_revision 'wombats'|
47
- it_behaves_like 'a cleanroom getter', :files_path
48
- it_behaves_like 'a cleanroom setter', :license, %|license 'Apache 2.0'|
49
- it_behaves_like 'a cleanroom setter', :license_file, %|license_file 'LICENSES/artistic.txt'|
50
- it_behaves_like 'a cleanroom setter', :license_file_path, %|license_file_path 'CHEF_LICENSE'|
24
+ it_behaves_like "a cleanroom setter", :name, %{name 'chef'}
25
+ it_behaves_like "a cleanroom setter", :friendly_name, %{friendly_name 'Chef'}
26
+ it_behaves_like "a cleanroom setter", :package_name, %{package_name 'chef.package'}
27
+ it_behaves_like "a cleanroom setter", :maintainer, %{maintainer 'Chef Software, Inc'}
28
+ it_behaves_like "a cleanroom setter", :homepage, %{homepage 'https://getchef.com'}
29
+ it_behaves_like "a cleanroom setter", :description, %{description 'Installs the thing'}
30
+ it_behaves_like "a cleanroom setter", :replace, %{replace 'old-chef'}
31
+ it_behaves_like "a cleanroom setter", :conflict, %{conflict 'puppet'}
32
+ it_behaves_like "a cleanroom setter", :build_version, %{build_version '1.2.3'}
33
+ it_behaves_like "a cleanroom setter", :build_iteration, %{build_iteration 1}
34
+ it_behaves_like "a cleanroom setter", :package_user, %{package_user 'chef'}
35
+ it_behaves_like "a cleanroom setter", :package_group, %{package_group 'chef'}
36
+ it_behaves_like "a cleanroom setter", :override, %{override :chefdk, source: 'foo.com'}
37
+ it_behaves_like "a cleanroom setter", :resources_path, %{resources_path '/path'}
38
+ it_behaves_like "a cleanroom setter", :package_scripts_path, %{package_scripts_path '/path/scripts'}
39
+ it_behaves_like "a cleanroom setter", :dependency, %{dependency 'libxslt-dev'}
40
+ it_behaves_like "a cleanroom setter", :runtime_dependency, %{runtime_dependency 'libxslt'}
41
+ it_behaves_like "a cleanroom setter", :exclude, %{exclude 'hamlet'}
42
+ it_behaves_like "a cleanroom setter", :config_file, %{config_file '/path/to/config.rb'}
43
+ it_behaves_like "a cleanroom setter", :extra_package_file, %{extra_package_file '/path/to/asset'}
44
+ it_behaves_like "a cleanroom setter", :text_manifest_path, %{text_manifest_path '/path/to/manifest.txt'}
45
+ it_behaves_like "a cleanroom setter", :json_manifest_path, %{json_manifest_path '/path/to/manifest.txt'}
46
+ it_behaves_like "a cleanroom setter", :build_git_revision, %{build_git_revision 'wombats'}
47
+ it_behaves_like "a cleanroom getter", :files_path
48
+ it_behaves_like "a cleanroom setter", :license, %{license 'Apache 2.0'}
49
+ it_behaves_like "a cleanroom setter", :license_file, %{license_file 'LICENSES/artistic.txt'}
50
+ it_behaves_like "a cleanroom setter", :license_file_path, %{license_file_path 'CHEF_LICENSE'}
51
51
 
52
- describe 'basics' do
53
- it 'returns a name' do
54
- expect(subject.name).to eq('sample')
52
+ describe "basics" do
53
+ it "returns a name" do
54
+ expect(subject.name).to eq("sample")
55
55
  end
56
56
 
57
- it 'returns an install_dir' do
58
- expect(subject.install_dir).to eq('/sample')
57
+ it "returns an install_dir" do
58
+ expect(subject.install_dir).to eq("/sample")
59
59
  end
60
60
 
61
- it 'returns a maintainer' do
62
- expect(subject.maintainer).to eq('Sample Devs')
61
+ it "returns a maintainer" do
62
+ expect(subject.maintainer).to eq("Sample Devs")
63
63
  end
64
64
 
65
- it 'returns a homepage' do
66
- expect(subject.homepage).to eq('http://example.com/')
65
+ it "returns a homepage" do
66
+ expect(subject.homepage).to eq("http://example.com/")
67
67
  end
68
68
 
69
- it 'returns a build version' do
70
- expect(subject.build_version).to eq('1.0')
69
+ it "returns a build version" do
70
+ expect(subject.build_version).to eq("1.0")
71
71
  end
72
72
 
73
- it 'returns a build iteration' do
73
+ it "returns a build iteration" do
74
74
  expect(subject.build_iteration).to eq(1)
75
75
  end
76
76
 
77
- it 'returns an array of files and dirs' do
78
- expect(subject.extra_package_files).to eq(['/path/to/sample_dir', '/path/to/file.conf'])
77
+ it "returns an array of files and dirs" do
78
+ expect(subject.extra_package_files).to eq(["/path/to/sample_dir", "/path/to/file.conf"])
79
79
  end
80
80
 
81
- it 'returns a friendly_name' do
82
- expect(subject.friendly_name).to eq('Sample Project')
81
+ it "returns a friendly_name" do
82
+ expect(subject.friendly_name).to eq("Sample Project")
83
83
  end
84
84
 
85
- it 'returns a resources_path' do
86
- expect(subject.resources_path).to include('sample/project/resources')
85
+ it "returns a resources_path" do
86
+ expect(subject.resources_path).to include("sample/project/resources")
87
87
  end
88
88
  end
89
89
 
90
90
  describe '#install_dir' do
91
- it 'removes duplicate slashes' do
92
- subject.install_dir('///opt//chef')
93
- expect(subject.install_dir).to eq('/opt/chef')
91
+ it "removes duplicate slashes" do
92
+ subject.install_dir("///opt//chef")
93
+ expect(subject.install_dir).to eq("/opt/chef")
94
94
  end
95
95
 
96
- it 'converts Windows slashes to Ruby ones' do
96
+ it "converts Windows slashes to Ruby ones" do
97
97
  subject.install_dir('C:\\chef\\chefdk')
98
- expect(subject.install_dir).to eq('C:/chef/chefdk')
98
+ expect(subject.install_dir).to eq("C:/chef/chefdk")
99
99
  end
100
100
 
101
- it 'removes trailing slashes' do
102
- subject.install_dir('/opt/chef//')
103
- expect(subject.install_dir).to eq('/opt/chef')
101
+ it "removes trailing slashes" do
102
+ subject.install_dir("/opt/chef//")
103
+ expect(subject.install_dir).to eq("/opt/chef")
104
104
  end
105
105
 
106
- it 'is a DSL method' do
106
+ it "is a DSL method" do
107
107
  expect(subject).to have_exposed_method(:install_dir)
108
108
  end
109
109
  end
110
110
 
111
111
  describe '#default_root' do
112
- context 'on Windows' do
113
- before { stub_ohai(platform: 'windows', version: '2012') }
112
+ context "on Windows" do
113
+ before { stub_ohai(platform: "windows", version: "2012") }
114
114
 
115
- it 'returns C:/' do
116
- expect(subject.default_root).to eq('C:')
115
+ it "returns C:/" do
116
+ expect(subject.default_root).to eq("C:")
117
117
  end
118
118
  end
119
119
 
120
- context 'on non-Windows' do
121
- before { stub_ohai(platform: 'ubuntu', version: '12.04') }
120
+ context "on non-Windows" do
121
+ before { stub_ohai(platform: "ubuntu", version: "12.04") }
122
122
 
123
- it 'returns /opt' do
124
- expect(subject.default_root).to eq('/opt')
123
+ it "returns /opt" do
124
+ expect(subject.default_root).to eq("/opt")
125
125
  end
126
126
  end
127
127
 
128
- it 'is a DSL method' do
128
+ it "is a DSL method" do
129
129
  expect(subject).to have_exposed_method(:default_root)
130
130
  end
131
131
  end
@@ -147,26 +147,26 @@ module Omnibus
147
147
 
148
148
  describe '#license' do
149
149
  it "sets the default to Unspecified" do
150
- expect(subject.license).to eq ('Unspecified')
150
+ expect(subject.license).to eq ("Unspecified")
151
151
  end
152
152
  end
153
153
 
154
154
  describe '#license_file_path' do
155
155
  it "sets the default to LICENSE" do
156
- expect(subject.license_file_path).to eq ('/sample/LICENSE')
156
+ expect(subject.license_file_path).to eq ("/sample/LICENSE")
157
157
  end
158
158
  end
159
159
 
160
160
  describe '#dirty!' do
161
161
  let(:software) { double(Omnibus::Software) }
162
162
 
163
- it 'dirties the cache' do
163
+ it "dirties the cache" do
164
164
  subject.instance_variable_set(:@culprit, nil)
165
165
  subject.dirty!(software)
166
166
  expect(subject).to be_dirty
167
167
  end
168
168
 
169
- it 'sets the culprit' do
169
+ it "sets the culprit" do
170
170
  subject.instance_variable_set(:@culprit, nil)
171
171
  subject.dirty!(software)
172
172
  expect(subject.culprit).to be(software)
@@ -174,30 +174,30 @@ module Omnibus
174
174
  end
175
175
 
176
176
  describe '#dirty?' do
177
- it 'returns true by default' do
177
+ it "returns true by default" do
178
178
  subject.instance_variable_set(:@culprit, nil)
179
179
  expect(subject).to_not be_dirty
180
180
  end
181
181
 
182
- it 'returns true when the cache is dirty' do
182
+ it "returns true when the cache is dirty" do
183
183
  subject.instance_variable_set(:@culprit, true)
184
184
  expect(subject).to be_dirty
185
185
  end
186
186
 
187
- it 'returns false when the cache is not dirty' do
187
+ it "returns false when the cache is not dirty" do
188
188
  subject.instance_variable_set(:@culprit, false)
189
189
  expect(subject).to_not be_dirty
190
190
  end
191
191
  end
192
192
 
193
193
  describe '#<=>' do
194
- let(:chefdk) { described_class.new.tap { |p| p.name('chefdk') } }
195
- let(:chef) { described_class.new.tap { |p| p.name('chef') } }
196
- let(:ruby) { described_class.new.tap { |p| p.name('ruby') } }
194
+ let(:chefdk) { described_class.new.tap { |p| p.name("chefdk") } }
195
+ let(:chef) { described_class.new.tap { |p| p.name("chef") } }
196
+ let(:ruby) { described_class.new.tap { |p| p.name("ruby") } }
197
197
 
198
- it 'compares projects by name' do
198
+ it "compares projects by name" do
199
199
  list = [chefdk, chef, ruby]
200
- expect(list.sort.map(&:name)).to eq(%w(chef chefdk ruby))
200
+ expect(list.sort.map(&:name)).to eq(%w{chef chefdk ruby})
201
201
  end
202
202
  end
203
203
 
@@ -206,38 +206,38 @@ module Omnibus
206
206
 
207
207
  before { stub_ohai(fauxhai_options) }
208
208
 
209
- context 'when on RHEL' do
210
- let(:fauxhai_options) { { platform: 'redhat', version: '6.4' } }
211
- it 'returns a RHEL iteration' do
209
+ context "when on RHEL" do
210
+ let(:fauxhai_options) { { platform: "redhat", version: "6.4" } }
211
+ it "returns a RHEL iteration" do
212
212
  expect(subject.build_iteration).to eq(1)
213
213
  end
214
214
  end
215
215
 
216
- context 'when on Debian' do
217
- let(:fauxhai_options) { { platform: 'debian', version: '7.2' } }
218
- it 'returns a Debian iteration' do
216
+ context "when on Debian" do
217
+ let(:fauxhai_options) { { platform: "debian", version: "7.2" } }
218
+ it "returns a Debian iteration" do
219
219
  expect(subject.build_iteration).to eq(1)
220
220
  end
221
221
  end
222
222
 
223
- context 'when on FreeBSD' do
224
- let(:fauxhai_options) { { platform: 'freebsd', version: '9.1' } }
225
- it 'returns a FreeBSD iteration' do
223
+ context "when on FreeBSD" do
224
+ let(:fauxhai_options) { { platform: "freebsd", version: "9.1" } }
225
+ it "returns a FreeBSD iteration" do
226
226
  expect(subject.build_iteration).to eq(1)
227
227
  end
228
228
  end
229
229
 
230
- context 'when on Windows' do
231
- before { stub_ohai(platform: 'windows', version: '2008R2') }
232
- before { stub_const('File::ALT_SEPARATOR', '\\') }
233
- it 'returns a Windows iteration' do
230
+ context "when on Windows" do
231
+ before { stub_ohai(platform: "windows", version: "2008R2") }
232
+ before { stub_const("File::ALT_SEPARATOR", '\\') }
233
+ it "returns a Windows iteration" do
234
234
  expect(subject.build_iteration).to eq(1)
235
235
  end
236
236
  end
237
237
 
238
- context 'when on OS X' do
239
- let(:fauxhai_options) { { platform: 'mac_os_x', version: '10.8.2' } }
240
- it 'returns a generic iteration' do
238
+ context "when on OS X" do
239
+ let(:fauxhai_options) { { platform: "mac_os_x", version: "10.8.2" } }
240
+ it "returns a generic iteration" do
241
241
  expect(subject.build_iteration).to eq(1)
242
242
  end
243
243
  end
@@ -247,61 +247,63 @@ module Omnibus
247
247
  before { subject.overrides.clear }
248
248
 
249
249
  it 'sets all the things through #overrides' do
250
- subject.override(:thing, version: '6.6.6')
250
+ subject.override(:thing, version: "6.6.6")
251
251
  expect(subject.override(:zlib)).to be_nil
252
252
  end
253
253
 
254
254
  it 'retrieves the things set through #overrides' do
255
- subject.override(:thing, version: '6.6.6')
256
- expect(subject.override(:thing)[:version]).to eq('6.6.6')
255
+ subject.override(:thing, version: "6.6.6")
256
+ expect(subject.override(:thing)[:version]).to eq("6.6.6")
257
257
  end
258
258
 
259
259
  it 'symbolizes #overrides' do
260
- subject.override('thing', version: '6.6.6')
261
- [:thing, 'thing'].each do |thing|
260
+ subject.override("thing", version: "6.6.6")
261
+ [:thing, "thing"].each do |thing|
262
262
  expect(subject.override(thing)).not_to be_nil
263
263
  end
264
- expect(subject.override(:thing)[:version]).to eq('6.6.6')
264
+ expect(subject.override(:thing)[:version]).to eq("6.6.6")
265
265
  end
266
266
  end
267
267
 
268
268
  describe '#ohai' do
269
- before { stub_ohai(platform: 'ubuntu', version: '12.04') }
269
+ before { stub_ohai(platform: "ubuntu", version: "12.04") }
270
270
 
271
- it 'is a DSL method' do
271
+ it "is a DSL method" do
272
272
  expect(subject).to have_exposed_method(:ohai)
273
273
  end
274
274
 
275
- it 'delegates to the Ohai class' do
275
+ it "delegates to the Ohai class" do
276
276
  expect(subject.ohai).to be(Ohai)
277
277
  end
278
278
  end
279
279
 
280
- describe '#packager' do
281
- it 'returns a packager object' do
282
- expect(subject.packager).to be_a(Packager::Base)
280
+ describe '#packagers_for_system' do
281
+ it "returns array of packager objects" do
282
+ subject.packagers_for_system.each do |packager|
283
+ expect(packager).to be_a(Packager::Base)
284
+ end
283
285
  end
284
286
 
285
287
  it 'calls Packager#for_current_system' do
286
288
  expect(Packager).to receive(:for_current_system)
287
289
  .and_call_original
288
- subject.packager
290
+ subject.packagers_for_system
289
291
  end
290
292
  end
291
293
 
292
294
  describe '#package' do
293
- it 'raises an exception when a block is not given' do
295
+ it "raises an exception when a block is not given" do
294
296
  expect { subject.package(:foo) }.to raise_error(InvalidValue)
295
297
  end
296
298
 
297
- it 'adds the block to the list' do
299
+ it "adds the block to the list" do
298
300
  block = Proc.new {}
299
301
  subject.package(:foo, &block)
300
302
 
301
303
  expect(subject.packagers[:foo]).to include(block)
302
304
  end
303
305
 
304
- it 'allows for multiple invocations, keeping order' do
306
+ it "allows for multiple invocations, keeping order" do
305
307
  block_1, block_2 = Proc.new {}, Proc.new {}
306
308
  subject.package(:foo, &block_1)
307
309
  subject.package(:foo, &block_2)
@@ -311,18 +313,18 @@ module Omnibus
311
313
  end
312
314
 
313
315
  describe '#packagers' do
314
- it 'returns a Hash' do
316
+ it "returns a Hash" do
315
317
  expect(subject.packagers).to be_a(Hash)
316
318
  end
317
319
 
318
- it 'has a default Hash value of an empty array' do
320
+ it "has a default Hash value of an empty array" do
319
321
  expect(subject.packagers[:foo]).to be_a(Array)
320
322
  expect(subject.packagers[:bar]).to_not be(subject.packagers[:foo])
321
323
  end
322
324
  end
323
325
 
324
326
  describe '#compressor' do
325
- it 'returns a compressor object' do
327
+ it "returns a compressor object" do
326
328
  expect(subject.compressor).to be_a(Compressor::Base)
327
329
  end
328
330
 
@@ -333,7 +335,7 @@ module Omnibus
333
335
  subject.compressor
334
336
  end
335
337
 
336
- it 'passes in the current compressors' do
338
+ it "passes in the current compressors" do
337
339
  subject.compress(:dmg)
338
340
  subject.compress(:tgz)
339
341
 
@@ -346,23 +348,23 @@ module Omnibus
346
348
  end
347
349
 
348
350
  describe '#compress' do
349
- it 'does not raises an exception when a block is not given' do
351
+ it "does not raises an exception when a block is not given" do
350
352
  expect { subject.compress(:foo) }.to_not raise_error
351
353
  end
352
354
 
353
- it 'adds the compressor to the list' do
355
+ it "adds the compressor to the list" do
354
356
  subject.compress(:foo)
355
357
  expect(subject.compressors).to include(:foo)
356
358
  end
357
359
 
358
- it 'adds the block to the list' do
360
+ it "adds the block to the list" do
359
361
  block = Proc.new {}
360
362
  subject.compress(:foo, &block)
361
363
 
362
364
  expect(subject.compressors[:foo]).to include(block)
363
365
  end
364
366
 
365
- it 'allows for multiple invocations, keeping order' do
367
+ it "allows for multiple invocations, keeping order" do
366
368
  block_1, block_2 = Proc.new {}, Proc.new {}
367
369
  subject.compress(:foo, &block_1)
368
370
  subject.compress(:foo, &block_2)
@@ -372,19 +374,19 @@ module Omnibus
372
374
  end
373
375
 
374
376
  describe '#compressors' do
375
- it 'returns a Hash' do
377
+ it "returns a Hash" do
376
378
  expect(subject.compressors).to be_a(Hash)
377
379
  end
378
380
 
379
- it 'has a default Hash value of an empty array' do
381
+ it "has a default Hash value of an empty array" do
380
382
  expect(subject.compressors[:foo]).to be_a(Array)
381
383
  expect(subject.compressors[:bar]).to_not be(subject.compressors[:foo])
382
384
  end
383
385
  end
384
386
 
385
387
  describe '#shasum' do
386
- context 'when a filepath is given' do
387
- let(:path) { '/project.rb' }
388
+ context "when a filepath is given" do
389
+ let(:path) { "/project.rb" }
388
390
  let(:file) { double(File) }
389
391
 
390
392
  before do
@@ -398,16 +400,16 @@ module Omnibus
398
400
  .and_return(file)
399
401
  end
400
402
 
401
- it 'returns the correct shasum' do
402
- expect(subject.shasum).to eq('2cb8bdd11c766caa11a37607e84ffb51af3ae3da16931988f12f7fc9de98d68e')
403
+ it "returns the correct shasum" do
404
+ expect(subject.shasum).to eq("2cb8bdd11c766caa11a37607e84ffb51af3ae3da16931988f12f7fc9de98d68e")
403
405
  end
404
406
  end
405
407
 
406
- context 'when a filepath is not given' do
408
+ context "when a filepath is not given" do
407
409
  before { subject.send(:remove_instance_variable, :@filepath) }
408
410
 
409
- it 'returns the correct shasum' do
410
- expect(subject.shasum).to eq('3cc6bd98da4d643b79c71be2c93761a458b442e2931f7d421636f526d0c1e8bf')
411
+ it "returns the correct shasum" do
412
+ expect(subject.shasum).to eq("3cc6bd98da4d643b79c71be2c93761a458b442e2931f7d421636f526d0c1e8bf")
411
413
  end
412
414
  end
413
415
  end