omnibus 3.1.1 → 3.2.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +71 -0
- data/Gemfile +0 -7
- data/README.md +108 -36
- data/Rakefile +1 -5
- data/docs/omnibus-build-cache.md +5 -5
- data/features/commands/_deprecated.feature +21 -3
- data/features/step_definitions/generator_steps.rb +7 -7
- data/lib/omnibus.rb +232 -171
- data/lib/omnibus/build_version.rb +2 -2
- data/lib/omnibus/builder.rb +38 -19
- data/lib/omnibus/cleaner.rb +5 -5
- data/lib/omnibus/cleanroom.rb +141 -0
- data/lib/omnibus/cli.rb +6 -9
- data/lib/omnibus/cli/base.rb +2 -1
- data/lib/omnibus/cli/cache.rb +15 -21
- data/lib/omnibus/cli/deprecated.rb +40 -4
- data/lib/omnibus/cli/publish.rb +61 -0
- data/lib/omnibus/config.rb +350 -189
- data/lib/omnibus/digestable.rb +131 -0
- data/lib/omnibus/exceptions.rb +163 -83
- data/lib/omnibus/fetcher.rb +1 -1
- data/lib/omnibus/fetchers/net_fetcher.rb +19 -13
- data/lib/omnibus/fetchers/path_fetcher.rb +8 -1
- data/lib/omnibus/fetchers/s3_cache_fetcher.rb +16 -7
- data/lib/omnibus/generator.rb +2 -2
- data/lib/omnibus/generator_files/Gemfile.erb +4 -1
- data/lib/omnibus/generator_files/README.md.erb +10 -0
- data/lib/omnibus/generator_files/{omnibus.rb.example.erb → omnibus.rb.erb} +20 -11
- data/lib/omnibus/generator_files/package_scripts/makeselfinst.erb +1 -1
- data/lib/omnibus/generator_files/project.rb.erb +2 -2
- data/lib/omnibus/generator_files/windows_msi/localization-en-us.wxl.erb +3 -3
- data/lib/omnibus/git_cache.rb +192 -0
- data/lib/omnibus/health_check.rb +171 -116
- data/lib/omnibus/library.rb +4 -2
- data/lib/omnibus/logger.rb +60 -1
- data/lib/omnibus/null_argumentable.rb +51 -0
- data/lib/omnibus/ohai.rb +29 -8
- data/lib/omnibus/package.rb +240 -0
- data/lib/omnibus/packagers/base.rb +21 -42
- data/lib/omnibus/packagers/mac_dmg.rb +5 -5
- data/lib/omnibus/packagers/mac_pkg.rb +20 -19
- data/lib/omnibus/packagers/windows_msi.rb +7 -7
- data/lib/omnibus/project.rb +969 -486
- data/lib/omnibus/publisher.rb +76 -0
- data/lib/omnibus/publishers/artifactory_publisher.rb +168 -0
- data/lib/omnibus/publishers/null_publisher.rb +23 -0
- data/lib/omnibus/publishers/s3_publisher.rb +99 -0
- data/lib/omnibus/s3_cache.rb +150 -63
- data/lib/omnibus/software.rb +749 -321
- data/lib/omnibus/{sugar.rb → sugarable.rb} +11 -6
- data/lib/omnibus/version.rb +1 -1
- data/omnibus.gemspec +8 -8
- data/spec/data/complicated/config/projects/angrychef.rb +1 -1
- data/spec/data/complicated/config/projects/chef-windows.rb +1 -1
- data/spec/data/complicated/config/projects/chef.rb +1 -1
- data/spec/data/complicated/config/projects/chefdk-windows.rb +1 -1
- data/spec/data/complicated/config/projects/chefdk.rb +1 -1
- data/spec/data/complicated/config/software/cacerts.rb +1 -1
- data/spec/data/complicated/config/software/chef-client-msi.rb +1 -1
- data/spec/data/complicated/config/software/libgcc.rb +1 -1
- data/spec/data/complicated/config/software/libiconv.rb +0 -11
- data/spec/data/complicated/config/software/libpng.rb +2 -2
- data/spec/data/complicated/config/software/openssl.rb +1 -1
- data/spec/data/complicated/config/software/ruby.rb +1 -1
- data/spec/data/complicated/config/software/runit.rb +4 -4
- data/spec/data/projects/chefdk.rb +1 -1
- data/spec/data/projects/sample.rb +1 -1
- data/spec/data/software/erchef.rb +3 -1
- data/spec/functional/packagers/mac_spec.rb +25 -24
- data/spec/functional/packagers/windows_spec.rb +21 -20
- data/spec/spec_helper.rb +43 -4
- data/spec/unit/build_version_spec.rb +14 -16
- data/spec/unit/cleanroom_spec.rb +63 -0
- data/spec/unit/config_spec.rb +36 -30
- data/spec/unit/digestable_spec.rb +38 -0
- data/spec/unit/fetchers/net_fetcher_spec.rb +98 -87
- data/spec/unit/{install_path_cache_spec.rb → git_cache_spec.rb} +67 -56
- data/spec/unit/health_check_spec.rb +73 -0
- data/spec/unit/library_spec.rb +166 -159
- data/spec/unit/ohai_spec.rb +19 -0
- data/spec/unit/omnibus_spec.rb +43 -41
- data/spec/unit/package_spec.rb +178 -0
- data/spec/unit/packagers/base_spec.rb +17 -47
- data/spec/unit/packagers/mac_pkg_spec.rb +104 -126
- data/spec/unit/project_spec.rb +176 -25
- data/spec/unit/publisher_spec.rb +49 -0
- data/spec/unit/publishers/artifactory_publisher_spec.rb +80 -0
- data/spec/unit/publishers/s3_publisher_spec.rb +120 -0
- data/spec/unit/s3_cacher_spec.rb +84 -19
- data/spec/unit/software_spec.rb +397 -170
- data/spec/unit/sugarable_spec.rb +43 -0
- metadata +62 -50
- data/Guardfile +0 -10
- data/lib/omnibus/artifact.rb +0 -165
- data/lib/omnibus/cli/release.rb +0 -40
- data/lib/omnibus/generator_files/Vagrantfile.erb +0 -75
- data/lib/omnibus/install_path_cache.rb +0 -105
- data/lib/omnibus/overrides.rb +0 -88
- data/lib/omnibus/package_release.rb +0 -154
- data/lib/omnibus/software_s3_urls.rb +0 -50
- data/spec/unit/artifact_spec.rb +0 -91
- data/spec/unit/overrides_spec.rb +0 -102
- data/spec/unit/package_release_spec.rb +0 -180
- data/spec/unit/sugar_spec.rb +0 -17
@@ -29,8 +29,17 @@ require 'chef/sugar/shell'
|
|
29
29
|
require 'chef/sugar/vagrant'
|
30
30
|
|
31
31
|
module Omnibus
|
32
|
-
|
33
|
-
|
32
|
+
module Sugarable
|
33
|
+
def self.included(base)
|
34
|
+
base.send(:include, Chef::Sugar::DSL)
|
35
|
+
|
36
|
+
if base < Cleanroom
|
37
|
+
# Make all the "sugars" available in the cleanroom (DSL)
|
38
|
+
Chef::Sugar::DSL.instance_methods.each do |instance_method|
|
39
|
+
base.send(:expose, instance_method)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
34
43
|
|
35
44
|
# This method is used by Chef Sugar to easily add the DSL. By mimicing
|
36
45
|
# Chef's +node+ object, we can easily include the existing DSL into
|
@@ -41,7 +50,3 @@ module Omnibus
|
|
41
50
|
end
|
42
51
|
end
|
43
52
|
end
|
44
|
-
|
45
|
-
# Include everything in Omnibus
|
46
|
-
Omnibus::Project.send(:include, Chef::Sugar::DSL)
|
47
|
-
Omnibus::Software.send(:include, Chef::Sugar::DSL)
|
data/lib/omnibus/version.rb
CHANGED
data/omnibus.gemspec
CHANGED
@@ -22,17 +22,17 @@ Gem::Specification.new do |gem|
|
|
22
22
|
gem.require_paths = ['lib']
|
23
23
|
|
24
24
|
gem.add_dependency 'chef-sugar', '~> 1.2'
|
25
|
-
gem.add_dependency 'mixlib-shellout', '~> 1.
|
26
|
-
gem.add_dependency '
|
27
|
-
gem.add_dependency '
|
28
|
-
gem.add_dependency 'fpm', '~> 1.0.0'
|
25
|
+
gem.add_dependency 'mixlib-shellout', '~> 1.4'
|
26
|
+
gem.add_dependency 'ohai', '~> 7.2.0.rc'
|
27
|
+
gem.add_dependency 'fpm', '~> 0.4'
|
29
28
|
gem.add_dependency 'uber-s3'
|
30
29
|
gem.add_dependency 'thor', '~> 0.18'
|
31
30
|
|
32
|
-
gem.add_development_dependency '
|
33
|
-
gem.add_development_dependency '
|
34
|
-
gem.add_development_dependency '
|
35
|
-
gem.add_development_dependency '
|
31
|
+
gem.add_development_dependency 'artifactory', '~> 1.2'
|
32
|
+
gem.add_development_dependency 'aruba', '~> 0.5'
|
33
|
+
gem.add_development_dependency 'fauxhai', '~> 2.1'
|
34
|
+
gem.add_development_dependency 'rspec', '~> 2.14'
|
35
|
+
gem.add_development_dependency 'rspec-its'
|
36
36
|
gem.add_development_dependency 'rake'
|
37
37
|
|
38
38
|
gem.add_development_dependency 'bundler'
|
@@ -22,7 +22,7 @@ homepage "http://www.opscode.com"
|
|
22
22
|
# NOTE: Ruby DevKit fundamentally CANNOT be installed into "Program Files"
|
23
23
|
# Native gems will use gcc which will barf on files with spaces,
|
24
24
|
# which is only fixable if everyone in the world fixes their Makefiles
|
25
|
-
|
25
|
+
install_dir "c:\\opscode\\chef"
|
26
26
|
build_version '1.0.0'
|
27
27
|
build_iteration 4
|
28
28
|
package_name "chef-client"
|
@@ -22,7 +22,7 @@ homepage "http://www.opscode.com"
|
|
22
22
|
# NOTE: Ruby DevKit fundamentally CANNOT be installed into "Program Files"
|
23
23
|
# Native gems will use gcc which will barf on files with spaces,
|
24
24
|
# which is only fixable if everyone in the world fixes their Makefiles
|
25
|
-
|
25
|
+
install_dir "c:\\opscode\\chefdk"
|
26
26
|
build_version '1.0.0'
|
27
27
|
build_iteration 1
|
28
28
|
|
@@ -34,7 +34,7 @@ build do
|
|
34
34
|
# fix worked. Rather than trying to fix this now, we're filing a bug and copying the cacert.pem
|
35
35
|
# directly from the cache instead.
|
36
36
|
|
37
|
-
FileUtils.cp(File.expand_path("cacert.pem",
|
37
|
+
FileUtils.cp(File.expand_path("cacert.pem", Config.cache_dir),
|
38
38
|
File.expand_path("embedded/ssl/certs/cacert.pem", install_dir))
|
39
39
|
end
|
40
40
|
|
@@ -18,7 +18,7 @@
|
|
18
18
|
name "libgcc"
|
19
19
|
description "On UNIX systems where we bootstrap a compiler, copy the libgcc"
|
20
20
|
|
21
|
-
if (platform == "solaris2" &&
|
21
|
+
if (platform == "solaris2" && Config.solaris_compiler == "gcc")
|
22
22
|
build do
|
23
23
|
if File.exists?("/opt/csw/lib/libgcc_s.so.1")
|
24
24
|
command "cp /opt/csw/lib/libgcc_s.so.1 #{install_dir}/embedded/lib/"
|
@@ -48,18 +48,7 @@ if platform == "solaris2"
|
|
48
48
|
env.merge!({"LDFLAGS" => "-R#{install_dir}/embedded/lib -L#{install_dir}/embedded/lib -I#{install_dir}/embedded/include -static-libgcc", "LD_OPTIONS" => "-R#{install_dir}/embedded/lib"})
|
49
49
|
end
|
50
50
|
|
51
|
-
def glibc_dropped_gets?
|
52
|
-
return false unless Ohai["os"] == "linux"
|
53
|
-
|
54
|
-
output = `/usr/bin/env getconf GNU_LIBC_VERSION`
|
55
|
-
|
56
|
-
return false unless output =~ /^glibc/
|
57
|
-
|
58
|
-
output.sub(/glibc /, "").to_f >= 2.16
|
59
|
-
end
|
60
|
-
|
61
51
|
build do
|
62
|
-
patch :source => 'libiconv-1.14_srclib_stdio.in.h-remove-gets-declarations.patch' if glibc_dropped_gets?
|
63
52
|
command "./configure --prefix=#{install_dir}/embedded", :env => env
|
64
53
|
command "make -j #{max_build_jobs}", :env => env
|
65
54
|
command "make -j #{max_build_jobs} install-lib libdir=#{install_dir}/embedded/lib includedir=#{install_dir}/embedded/include", :env => env
|
@@ -16,12 +16,12 @@
|
|
16
16
|
#
|
17
17
|
|
18
18
|
name "libpng"
|
19
|
-
default_version "1.5.
|
19
|
+
default_version "1.5.18"
|
20
20
|
|
21
21
|
dependency "zlib"
|
22
22
|
|
23
23
|
source :url => "ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng15/libpng-#{version}.tar.gz",
|
24
|
-
:md5 => "
|
24
|
+
:md5 => "5266905cef49d1224437465ad4d67fd9"
|
25
25
|
|
26
26
|
relative_path "libpng-#{version}"
|
27
27
|
|
@@ -105,7 +105,7 @@ build do
|
|
105
105
|
"-R#{install_dir}/embedded/lib",
|
106
106
|
"-static-libgcc"].join(" ")
|
107
107
|
when "solaris2"
|
108
|
-
if
|
108
|
+
if Config.solaris_compiler == "gcc"
|
109
109
|
if architecture == "sparc"
|
110
110
|
["/bin/sh ./Configure",
|
111
111
|
"solaris-sparcv9-gcc",
|
@@ -25,7 +25,7 @@ dependency "openssl"
|
|
25
25
|
dependency "libyaml"
|
26
26
|
dependency "libiconv"
|
27
27
|
dependency "gdbm"
|
28
|
-
dependency "libgcc" if (platform == "solaris2" and
|
28
|
+
dependency "libgcc" if (platform == "solaris2" and Config.solaris_compiler == "gcc")
|
29
29
|
|
30
30
|
version "1.9.3-p484" do
|
31
31
|
source md5: '8ac0dee72fe12d75c8b2d0ef5d0c2968'
|
@@ -27,7 +27,7 @@ working_dir = "#{project_dir}/runit-2.1.1"
|
|
27
27
|
|
28
28
|
build do
|
29
29
|
# put runit where we want it, not where they tell us to
|
30
|
-
command 'sed -i -e "s/^char\ \*varservice\ \=\"\/service\/\";$/char\ \*varservice\ \=\"' + project.
|
30
|
+
command 'sed -i -e "s/^char\ \*varservice\ \=\"\/service\/\";$/char\ \*varservice\ \=\"' + project.install_dir.gsub("/", "\\/") + '\/service\/\";/" src/sv.c', :cwd => working_dir
|
31
31
|
# TODO: the following is not idempotent
|
32
32
|
command "sed -i -e s:-static:: src/Makefile", :cwd => working_dir
|
33
33
|
|
@@ -50,7 +50,7 @@ build do
|
|
50
50
|
end
|
51
51
|
|
52
52
|
block do
|
53
|
-
|
53
|
+
install_dir = self.project.install_dir
|
54
54
|
open("#{install_dir}/embedded/bin/runsvdir-start", "w") do |file|
|
55
55
|
file.print <<-EOH
|
56
56
|
#!/bin/bash
|
@@ -71,7 +71,7 @@ build do
|
|
71
71
|
# limitations under the License.
|
72
72
|
#
|
73
73
|
|
74
|
-
PATH=#{
|
74
|
+
PATH=#{install_dir}/bin:#{install_dir}/embedded/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin
|
75
75
|
|
76
76
|
# enforce our own ulimits
|
77
77
|
|
@@ -98,7 +98,7 @@ echo "1000000" > /proc/sys/fs/file-max
|
|
98
98
|
umask 022
|
99
99
|
|
100
100
|
exec env - PATH=$PATH \
|
101
|
-
runsvdir -P #{
|
101
|
+
runsvdir -P #{install_dir}/service 'log: ...........................................................................................................................................................................................................................................................................................................................................................................................................'
|
102
102
|
EOH
|
103
103
|
end
|
104
104
|
end
|
@@ -6,39 +6,40 @@ module Omnibus
|
|
6
6
|
let(:version) { '12.4.0' }
|
7
7
|
|
8
8
|
let(:project) do
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
9
|
+
allow(IO).to receive(:read)
|
10
|
+
.with('/project.rb')
|
11
|
+
.and_return <<-EOH.gsub(/^ {10}/, '')
|
12
|
+
name '#{name}'
|
13
|
+
maintainer 'Chef'
|
14
|
+
homepage 'https://getchef.com'
|
15
|
+
build_version '#{version}'
|
16
|
+
install_dir '#{tmp_path}/opt/#{name}'
|
17
|
+
mac_pkg_identifier 'test.pkg.#{name}'
|
18
|
+
EOH
|
19
|
+
|
20
|
+
Project.load('/project.rb')
|
17
21
|
end
|
18
22
|
|
19
23
|
let(:mac_packager) { Packager::MacPkg.new(project) }
|
20
24
|
|
21
25
|
before do
|
22
|
-
# Reset stale configuration
|
23
|
-
Omnibus.config.reset!
|
24
|
-
|
25
26
|
# Tell things to install into the cache directory
|
26
27
|
root = "#{tmp_path}/var/omnibus"
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
28
|
+
Config.cache_dir "#{root}/cache"
|
29
|
+
Config.git_cache_dir "#{root}/cache/git_cache"
|
30
|
+
Config.source_dir "#{root}/src"
|
31
|
+
Config.build_dir "#{root}/build"
|
32
|
+
Config.package_dir "#{root}/pkg"
|
33
|
+
Config.package_tmp "#{root}/pkg-tmp"
|
33
34
|
|
34
35
|
# Enable DMG create
|
35
|
-
|
36
|
+
Config.build_dmg true
|
36
37
|
|
37
38
|
# Point at our sample project fixture
|
38
|
-
|
39
|
+
Config.project_root "#{fixtures_path}/sample"
|
39
40
|
|
40
41
|
# Create the target directory
|
41
|
-
FileUtils.mkdir_p(project.
|
42
|
+
FileUtils.mkdir_p(project.install_dir)
|
42
43
|
end
|
43
44
|
|
44
45
|
it 'builds a pkg and a dmg' do
|
@@ -47,11 +48,11 @@ module Omnibus
|
|
47
48
|
|
48
49
|
# There is a tiny bit of hard-coding here, but I don't see a better
|
49
50
|
# solution for generating the package name
|
50
|
-
pkg = "#{
|
51
|
-
dmg = "#{
|
51
|
+
pkg = "#{Config.package_dir}/#{name}-#{version}-1.pkg"
|
52
|
+
dmg = "#{Config.package_dir}/#{name}-#{version}-1.dmg"
|
52
53
|
|
53
|
-
expect(File.exist?(pkg)).to
|
54
|
-
expect(File.exist?(dmg)).to
|
54
|
+
expect(File.exist?(pkg)).to be_truthy
|
55
|
+
expect(File.exist?(dmg)).to be_truthy
|
55
56
|
end
|
56
57
|
end
|
57
58
|
end
|
@@ -23,38 +23,39 @@ module Omnibus
|
|
23
23
|
let(:version) { '12.4.0' }
|
24
24
|
|
25
25
|
let(:project) do
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
26
|
+
allow(IO).to receive(:read)
|
27
|
+
.with('/project.rb')
|
28
|
+
.and_return <<-EOH.gsub(/^ {10}/, '')
|
29
|
+
name '#{name}'
|
30
|
+
maintainer 'Chef'
|
31
|
+
homepage 'https://getchef.com'
|
32
|
+
build_version '#{version}'
|
33
|
+
install_dir '#{tmp_path}\\opt\\#{name}'
|
34
|
+
EOH
|
35
|
+
|
36
|
+
Project.load('/project.rb')
|
33
37
|
end
|
34
38
|
|
35
39
|
let(:windows_packager) { Packager::WindowsMsi.new(project) }
|
36
40
|
|
37
41
|
before do
|
38
|
-
# Reset stale configuration
|
39
|
-
Omnibus.config.reset!
|
40
|
-
|
41
42
|
# Tell things to install into the cache directory
|
42
43
|
root = "#{tmp_path}/var/omnibus"
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
44
|
+
Config.cache_dir "#{root}/cache"
|
45
|
+
Config.git_cache_dir "#{root}/cache/git_cache"
|
46
|
+
Config.source_dir "#{root}/src"
|
47
|
+
Config.build_dir "#{root}/build"
|
48
|
+
Config.package_dir "#{root}/pkg"
|
49
|
+
Config.package_tmp "#{root}/pkg-tmp"
|
49
50
|
|
50
51
|
# Point at our sample project fixture
|
51
|
-
|
52
|
+
Config.project_root "#{fixtures_path}/sample"
|
52
53
|
|
53
54
|
# Create the target directory
|
54
|
-
FileUtils.mkdir_p(project.
|
55
|
+
FileUtils.mkdir_p(project.install_dir)
|
55
56
|
|
56
57
|
# Create a file to be included in the MSI
|
57
|
-
FileUtils.touch(File.join(project.
|
58
|
+
FileUtils.touch(File.join(project.install_dir, 'golden_file'))
|
58
59
|
end
|
59
60
|
|
60
61
|
it 'builds a pkg and a dmg' do
|
@@ -63,7 +64,7 @@ module Omnibus
|
|
63
64
|
|
64
65
|
# There is a tiny bit of hard-coding here, but I don't see a better
|
65
66
|
# solution for generating the package name
|
66
|
-
expect(File.exist?("#{
|
67
|
+
expect(File.exist?("#{Config.package_dir}/#{name}-#{version}-1.windows.msi")).to be_truthy
|
67
68
|
end
|
68
69
|
end
|
69
70
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
require 'rspec/its'
|
3
|
+
|
1
4
|
require 'omnibus'
|
2
5
|
require 'fauxhai'
|
3
6
|
|
@@ -49,11 +52,11 @@ module Omnibus
|
|
49
52
|
#
|
50
53
|
# @param [Hash] data
|
51
54
|
#
|
52
|
-
def stub_ohai(
|
53
|
-
|
54
|
-
system.data = Mash.new(data)
|
55
|
+
def stub_ohai(options = {}, &block)
|
56
|
+
require 'ohai' unless defined?(Mash)
|
55
57
|
|
56
|
-
|
58
|
+
ohai = Mash.from_hash(Fauxhai.mock(options, &block).data)
|
59
|
+
Ohai.stub(:ohai).and_return(ohai)
|
57
60
|
end
|
58
61
|
|
59
62
|
#
|
@@ -109,9 +112,20 @@ RSpec.configure do |config|
|
|
109
112
|
# Suppress logging
|
110
113
|
Omnibus.logger.level = :unknown
|
111
114
|
|
115
|
+
# Reset config
|
116
|
+
Omnibus.reset!
|
117
|
+
|
112
118
|
# Clear the tmp_path on each run
|
113
119
|
FileUtils.rm_rf(tmp_path)
|
114
120
|
FileUtils.mkdir_p(tmp_path)
|
121
|
+
|
122
|
+
# Don't run Ohai - tests can still override this
|
123
|
+
stub_ohai(platform: 'ubuntu', version: '12.04')
|
124
|
+
end
|
125
|
+
|
126
|
+
config.after(:each) do
|
127
|
+
# Reset config
|
128
|
+
Omnibus.reset!
|
115
129
|
end
|
116
130
|
|
117
131
|
# Force the expect syntax
|
@@ -122,3 +136,28 @@ RSpec.configure do |config|
|
|
122
136
|
# Run specs in a random order
|
123
137
|
config.order = 'random'
|
124
138
|
end
|
139
|
+
|
140
|
+
#
|
141
|
+
# Shard example group for asserting a DSL method
|
142
|
+
#
|
143
|
+
# @example
|
144
|
+
# it_behaves_like 'a cleanroom setter', :name, 'chef'
|
145
|
+
#
|
146
|
+
RSpec.shared_examples 'a cleanroom setter' do |id, value|
|
147
|
+
it "for `#{id}'" do
|
148
|
+
expect { subject.evaluate("#{id}(#{value.inspect})") }
|
149
|
+
.to_not raise_error
|
150
|
+
end
|
151
|
+
end
|
152
|
+
|
153
|
+
#
|
154
|
+
# Shard example group for asserting a DSL method
|
155
|
+
#
|
156
|
+
# @example
|
157
|
+
# it_behaves_like 'a cleanroom getter', :name
|
158
|
+
#
|
159
|
+
RSpec.shared_examples 'a cleanroom getter' do |id|
|
160
|
+
it "for `#{id}'" do
|
161
|
+
expect { subject.evaluate("#{id}") }.to_not raise_error
|
162
|
+
end
|
163
|
+
end
|