beaker 2.12.0 → 2.13.0

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDViYzc2MGNjNDgxMjczMmE4MmQ2NzY3NTNhOWI5ZWU1NGYxNjA4Zg==
4
+ YzExY2M1YzU1ODQ1NmZmODdjYjUzYjg3OGRlYjg2NzE2ZGRiNDAwOQ==
5
5
  data.tar.gz: !binary |-
6
- MmExY2UzMTI0ZDA2MzkzYzgwOGNhZTVmZDVhNWIxMDFlOWI0OGM5Mw==
6
+ ZWQ2ZWFlNDFkY2EyZmQxZjkyZjRmOWVmM2U4YTI2YjBlN2Y2MjhiZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDY5MjdhMGYwMWRmN2FiZGY4Y2YxYzAyNmNmYjYwOGYzZmZkN2YzYWJkY2Uy
10
- YjQ3MmY2NjE1ODgyZTEyNzkxOWI4ZWRjOTk2MTFjODI0YWQzMDBkOTMwNzI5
11
- ZWI4NGFjMTE5YjdjZTdmY2NjY2U5MTM1MGQ1OGRiNTU2ZGYxZTY=
9
+ M2ZkMDlkNzRiOThjNWFjNDUxYjQyNzc5NTRiNmJlYzFmYTdjYzQ4MTdiMzQw
10
+ OTYzMTFmZDEyYjIzNmI4NzYyYmQyZWUyMDE5YTVjMGU1NTQ5MGZmYTcwMDc3
11
+ MjdiN2Y4ZWM0Y2JiYTdhYzkwYTc0YWZkZmZmNmJiZjNlOGExMDQ=
12
12
  data.tar.gz: !binary |-
13
- NjBmYzBhZDcyMzA3NDdjMzUwZDVjYmFlMTEwMjllZDFhNWViMzI0NWFlNjBh
14
- NDQwYTc5NGJjNGRlY2RhNzZiMThkOTU3MmU0ZmEwMmNiMTJlZDMwNzEwZmEx
15
- MmE0MTE5ZmVhYTc5ZDFhZWY0NDJiNjE5ZDY1NTQ0MzEyMzcxZGM=
13
+ NDU5MmFmMGVjZGI4YzQ0ZDUyYzJiMDEzMTFmOTRiNzU3YTNjM2FiNjRiYjVi
14
+ ZGQyNWI5YmE0YTZmMzM3NTVlMzdlZmQ3YTRlNDk3ZWE1MDRmZjY2ZGQ5YTdm
15
+ MDM1ZmYzNmNhNDI2NjAzNDc5ODE2N2Q3MDZmN2ZlNjI0MTM3M2Q=
data/HISTORY.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # default - History
2
2
  ## Tags
3
- * [LATEST - 20 May, 2015 (88efb0d6)](#LATEST)
3
+ * [LATEST - 29 May, 2015 (c801d4c8)](#LATEST)
4
+ * [2.12.0 - 20 May, 2015 (62845ce9)](#2.12.0)
4
5
  * [2.11.0 - 6 May, 2015 (b775cc73)](#2.11.0)
5
6
  * [2.10.0 - 22 Apr, 2015 (c4f37479)](#2.10.0)
6
7
  * [2.9.0 - 9 Apr, 2015 (b161d325)](#2.9.0)
@@ -80,7 +81,105 @@
80
81
  * [pe1.2 - 6 Sep, 2011 (ba3dadd2)](#pe1.2)
81
82
 
82
83
  ## Details
83
- ### <a name = "LATEST">LATEST - 20 May, 2015 (88efb0d6)
84
+ ### <a name = "LATEST">LATEST - 29 May, 2015 (c801d4c8)
85
+
86
+ * (GEM) update beaker version to 2.13.0 (c801d4c8)
87
+
88
+ * Merge pull request #824 from anodelman/remove-rake-task (32d49e16)
89
+
90
+
91
+ ```
92
+ Merge pull request #824 from anodelman/remove-rake-task
93
+
94
+ (BKR-239) Remove dependency on puppet-dashboard rake tasks...
95
+ ```
96
+ * (BKR-239) Remove dependency on puppet-dashboard rake tasks... (a334fe40)
97
+
98
+
99
+ ```
100
+ (BKR-239) Remove dependency on puppet-dashboard rake tasks...
101
+
102
+ ... for shallow gravy.
103
+
104
+ - do that
105
+ ```
106
+ * Merge pull request #817 from justinstoller/maint/master/hocon-update (ddc7d948)
107
+
108
+
109
+ ```
110
+ Merge pull request #817 from justinstoller/maint/master/hocon-update
111
+
112
+ (maint) Relax constraint on hocon
113
+ ```
114
+ * Merge pull request #820 from anodelman/fix-accessors (aeedd651)
115
+
116
+
117
+ ```
118
+ Merge pull request #820 from anodelman/fix-accessors
119
+
120
+ (BKR-283)/(BKR-262) missing @metadata/@logger accessors for beaker-rspec
121
+ ```
122
+ * Merge pull request #819 from spjmurray/virtualbox_volumes (85bbc4dd)
123
+
124
+
125
+ ```
126
+ Merge pull request #819 from spjmurray/virtualbox_volumes
127
+
128
+ (BKR-281) VirtualBox: Add support for storage arrays
129
+ ```
130
+ * (BKR-283)/(BKR-262) missing @metadata/@logger accessors for beaker-rspec (d230c2cc)
131
+
132
+
133
+ ```
134
+ (BKR-283)/(BKR-262) missing @metadata/@logger accessors for beaker-rspec
135
+
136
+ - beaker-rspec needs access to @metadata, broken with beaker 2.12.0
137
+ - Beaker-rspec missing @logger accessor
138
+
139
+ Added both logger and metadata accessors so that beaker-rspec can be
140
+ repaired to work with latest beaker releases.
141
+ ```
142
+ * (BKR-287) Relax constraint on hocon (f8f44deb)
143
+
144
+
145
+ ```
146
+ (BKR-287) Relax constraint on hocon
147
+
148
+ Prior to this we were using the hocon gem and pinning to a z release.
149
+
150
+ This commit relaxes the version dependency to pull in an pre-1.0 hocon
151
+ release.
152
+
153
+ This is necessary for testing the hocon module itself.
154
+ ```
155
+ * (BKR-281) VirtualBox: Add support for storage arrays (3b0b2443)
156
+
157
+
158
+ ```
159
+ (BKR-281) VirtualBox: Add support for storage arrays
160
+
161
+ Extends the Vagrant VirtualBox hypervisor to allow per host definitions
162
+ of storage volumes, for testing things like ceph and other storage
163
+ technologies.
164
+
165
+ An example nodeset provisions the VM with 3 attached storage volumes
166
+ available as sdb, sdc, sdd (on linux systems) at at SCSI addresses
167
+ 2:0:0:0, 3:0:0:0, 4:0:0:0. Sizes are specified in MB.
168
+
169
+ HOSTS:
170
+ osd0:
171
+ hypervisor: vagrant
172
+ volumes:
173
+ osd0_0:
174
+ size: 10000
175
+ osd0_1:
176
+ size: 10000
177
+ journal:
178
+ size: 1000
179
+ ```
180
+ ### <a name = "2.12.0">2.12.0 - 20 May, 2015 (62845ce9)
181
+
182
+ * (HISTORY) update beaker history for gem release 2.12.0 (62845ce9)
84
183
 
85
184
  * (GEM) update beaker version to 2.12.0 (88efb0d6)
86
185
 
data/beaker.gemspec CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |s|
33
33
  # Run time dependencies
34
34
  s.add_runtime_dependency 'minitest', '~> 5.4'
35
35
  s.add_runtime_dependency 'json', '~> 1.8'
36
- s.add_runtime_dependency 'hocon', '~> 0.0.4'
36
+ s.add_runtime_dependency 'hocon', '~> 0.1'
37
37
  s.add_runtime_dependency 'net-ssh', '~> 2.9'
38
38
  s.add_runtime_dependency 'net-scp', '~> 1.2'
39
39
  s.add_runtime_dependency 'inifile', '~> 2.0'
@@ -18,6 +18,7 @@ module Beaker
18
18
  # * the module {Beaker::DSL::Roles} that provides access to the various hosts implementing
19
19
  # {Beaker::Host}'s interface to act upon
20
20
  # * the module {Beaker::DSL::Wrappers} the provides convenience methods for {Beaker::DSL::Command} creation
21
+ # * a method *metadata* that yields a hash
21
22
  #
22
23
  #
23
24
  module Helpers
@@ -10,7 +10,7 @@ module Beaker
10
10
  #
11
11
  # @return [String] Test name, or nil if it hasn't been set
12
12
  def current_test_name()
13
- @metadata[:case] && @metadata[:case][:name] ? @metadata[:case][:name] : nil
13
+ metadata[:case] && metadata[:case][:name] ? metadata[:case][:name] : nil
14
14
  end
15
15
 
16
16
  # Gets the currently executing test's filename, which is set from the
@@ -22,7 +22,7 @@ module Beaker
22
22
  #
23
23
  # @return [String] Test filename, or nil if it hasn't been set
24
24
  def current_test_filename()
25
- @metadata[:case] && @metadata[:case][:file_name] ? @metadata[:case][:file_name] : nil
25
+ metadata[:case] && metadata[:case][:file_name] ? metadata[:case][:file_name] : nil
26
26
  end
27
27
 
28
28
  # Gets the currently executing test's currently executing step name.
@@ -30,7 +30,7 @@ module Beaker
30
30
  #
31
31
  # @return [String] Step name, or nil if it hasn't been set
32
32
  def current_step_name()
33
- @metadata[:step] && @metadata[:step][:name] ? @metadata[:step][:name] : nil
33
+ metadata[:step] && metadata[:step][:name] ? metadata[:step][:name] : nil
34
34
  end
35
35
 
36
36
  # Sets the currently executing test's name.
@@ -40,8 +40,8 @@ module Beaker
40
40
  # @return nil
41
41
  # @api private
42
42
  def set_current_test_name(name)
43
- @metadata[:case] ||= {}
44
- @metadata[:case][:name] = name
43
+ metadata[:case] ||= {}
44
+ metadata[:case][:name] = name
45
45
  end
46
46
 
47
47
  # Sets the currently executing test's filename.
@@ -51,8 +51,8 @@ module Beaker
51
51
  # @return nil
52
52
  # @api private
53
53
  def set_current_test_filename(filename)
54
- @metadata[:case] ||= {}
55
- @metadata[:case][:file_name] = filename
54
+ metadata[:case] ||= {}
55
+ metadata[:case][:file_name] = filename
56
56
  end
57
57
 
58
58
  # Sets the currently executing step's name.
@@ -62,11 +62,11 @@ module Beaker
62
62
  # @return nil
63
63
  # @api private
64
64
  def set_current_step_name(name)
65
- @metadata[:step] ||= {}
66
- @metadata[:step][:name] = name
65
+ metadata[:step] ||= {}
66
+ metadata[:step][:name] = name
67
67
  end
68
68
 
69
69
  end
70
70
  end
71
71
  end
72
- end
72
+ end
@@ -390,12 +390,15 @@ module Beaker
390
390
  wait_for_host_in_dashboard(host)
391
391
  end
392
392
 
393
- if pre30master
394
- task = 'nodegroup:add_all_nodes group=default'
395
- else
396
- task = 'defaultgroup:ensure_default_group'
393
+ # only appropriate for pre-3.9 builds
394
+ if version_is_less(master[:pe_ver], '3.99')
395
+ if pre30master
396
+ task = 'nodegroup:add_all_nodes group=default'
397
+ else
398
+ task = 'defaultgroup:ensure_default_group'
399
+ end
400
+ on dashboard, "/opt/puppet/bin/rake -sf /opt/puppet/share/puppet-dashboard/Rakefile #{task} RAILS_ENV=production"
397
401
  end
398
- on dashboard, "/opt/puppet/bin/rake -sf /opt/puppet/share/puppet-dashboard/Rakefile #{task} RAILS_ENV=production"
399
402
 
400
403
  # Now that all hosts are in the dashbaord, run puppet one more
401
404
  # time to configure mcollective
@@ -602,9 +602,9 @@ module Beaker
602
602
  fedora_prefix, version, repo, arch ]
603
603
 
604
604
  unless link_exists?( link )
605
- @logger.debug("couldn't find link at '#{repo}', falling back to next option...")
605
+ logger.debug("couldn't find link at '#{repo}', falling back to next option...")
606
606
  else
607
- @logger.debug("found link at '#{repo}'")
607
+ logger.debug("found link at '#{repo}'")
608
608
  break
609
609
  end
610
610
  end
@@ -646,16 +646,16 @@ module Beaker
646
646
  repo_path = "/root/#{package_name}/#{codename}/#{repo}"
647
647
  repo_check = on(host, "[[ -d #{repo_path} ]]", :acceptable_exit_codes => [0,1])
648
648
  if repo_check.exit_code == 0
649
- @logger.debug("found repo at '#{repo_path}'")
649
+ logger.debug("found repo at '#{repo_path}'")
650
650
  repo_name = repo
651
651
  break
652
652
  else
653
- @logger.debug("couldn't find repo at '#{repo_path}', falling back to next option...")
653
+ logger.debug("couldn't find repo at '#{repo_path}', falling back to next option...")
654
654
  end
655
655
  end
656
656
  if repo_name.nil?
657
657
  repo_name = 'main'
658
- @logger.debug("using default repo '#{repo_name}'")
658
+ logger.debug("using default repo '#{repo_name}'")
659
659
  end
660
660
 
661
661
  search = "deb\\s\\+http:\\/\\/#{hostname}.*$"
@@ -5,11 +5,53 @@ class Beaker::VagrantVirtualbox < Beaker::Vagrant
5
5
  super
6
6
  end
7
7
 
8
+ # Generate a VM customization string
9
+ def self.vb_customize(command, args)
10
+ " vb.customize ['#{command}', #{args.map{|a| "'#{a.to_s}'"}.join(", ")}]\n"
11
+ end
12
+
13
+ # Generate a VM customization string for the current VM
14
+ def self.vb_customize_vm(command, args)
15
+ " vb.customize ['#{command}', :id, #{args.map{|a| "'#{a.to_s}'"}.join(", ")}]\n"
16
+ end
17
+
8
18
  def self.provider_vfile_section(host, options)
9
19
  provider_section = ""
10
20
  provider_section << " v.vm.provider :virtualbox do |vb|\n"
11
21
  provider_section << " vb.customize ['modifyvm', :id, '--memory', '#{options['vagrant_memsize'] ||= '1024'}']\n"
12
22
  provider_section << " vb.vbguest.auto_update = false" if options[:vbguest_plugin] == 'disable'
23
+
24
+ # Guest volume support
25
+ # - Creates a new AHCI controller with the requisite number of ports,
26
+ # the default controller is limited in its number of supported ports (2).
27
+ # The AHCI emulation is generic enough for acceptance testing, and
28
+ # presents the devices as SCSI devices in /sys/class/scsi_disk.
29
+ # - Creates the defined volumes in beaker's temporary folder and attaches
30
+ # them to the controller in order starting at port 0. This presents disks
31
+ # as 2:0:0:0, 3:0:0:0 ... much like you'd see on commercial storage boxes
32
+ if host['volumes']
33
+ provider_section << self.vb_customize_vm('storagectl', [
34
+ '--name', 'SATA Controller',
35
+ '--add', 'sata',
36
+ '--controller', 'IntelAHCI',
37
+ '--portcount', host['volumes'].length
38
+ ])
39
+ host['volumes'].keys.each_with_index do |volume, index|
40
+ volume_path = "#{host.name}-#{volume}.vdi"
41
+ provider_section << self.vb_customize('createhd', [
42
+ '--filename', volume_path,
43
+ '--size', host['volumes'][volume]['size'],
44
+ ])
45
+ provider_section << self.vb_customize_vm('storageattach', [
46
+ '--storagectl', 'SATA Controller',
47
+ '--port', index,
48
+ '--device', 0,
49
+ '--type', 'hdd',
50
+ '--medium', volume_path,
51
+ ])
52
+ end
53
+ end
54
+
13
55
  if host['disk_path']
14
56
  unless File.exist?(host['disk_path'])
15
57
  host['disk_path'] = File.join(host['disk_path'], "#{host.name}.vmdk")
@@ -33,6 +33,10 @@ module Beaker
33
33
  # an instance of {Beaker::Logger}.
34
34
  attr_accessor :logger
35
35
 
36
+ # Necessary for many methods in {Beaker::DSL::Helpers}. Assumed to be
37
+ # a hash.
38
+ attr_accessor :metadata
39
+
36
40
  #The full log for this test
37
41
  attr_accessor :sublog
38
42
 
@@ -1,5 +1,5 @@
1
1
  module Beaker
2
2
  module Version
3
- STRING = '2.12.0'
3
+ STRING = '2.13.0'
4
4
  end
5
5
  end
@@ -17,61 +17,61 @@ describe ClassMixedWithDSLHelpers do
17
17
 
18
18
  describe '#current_test_name' do
19
19
  it 'returns nil if the case is undefined' do
20
- subject.instance_variable_set( :@metadata, metadata )
20
+ allow(subject).to receive(:metadata).and_return(metadata)
21
21
  expect( subject.current_test_name ).to be_nil
22
22
  end
23
23
 
24
24
  it 'returns nil if the name is undefined' do
25
25
  @metadata = { :case => {} }
26
- subject.instance_variable_set( :@metadata, metadata )
26
+ allow(subject).to receive(:metadata).and_return(metadata)
27
27
  expect( subject.current_test_name ).to be_nil
28
28
  end
29
29
 
30
30
  it 'returns the set value' do
31
31
  name = 'holyGrail_testName'
32
32
  @metadata = { :case => { :name => name } }
33
- subject.instance_variable_set( :@metadata, metadata )
33
+ allow(subject).to receive(:metadata).and_return(metadata)
34
34
  expect( subject.current_test_name ).to be === name
35
35
  end
36
36
  end
37
37
 
38
38
  describe '#current_test_filename' do
39
39
  it 'returns nil if the case is undefined' do
40
- subject.instance_variable_set( :@metadata, metadata )
40
+ allow(subject).to receive(:metadata).and_return(metadata)
41
41
  expect( subject.current_test_filename ).to be_nil
42
42
  end
43
43
 
44
44
  it 'returns nil if the name is undefined' do
45
45
  @metadata = { :case => {} }
46
- subject.instance_variable_set( :@metadata, metadata )
46
+ allow(subject).to receive(:metadata).and_return(metadata)
47
47
  expect( subject.current_test_filename ).to be_nil
48
48
  end
49
49
 
50
50
  it 'returns the set value' do
51
51
  name = 'holyGrail_testFilename'
52
52
  @metadata = { :case => { :file_name => name } }
53
- subject.instance_variable_set( :@metadata, metadata )
53
+ allow(subject).to receive(:metadata).and_return(metadata)
54
54
  expect( subject.current_test_filename ).to be === name
55
55
  end
56
56
  end
57
57
 
58
58
  describe '#current_step_name' do
59
59
  it 'returns nil if the step is undefined' do
60
- subject.instance_variable_set( :@metadata, metadata )
60
+ allow(subject).to receive(:metadata).and_return(metadata)
61
61
  expect( subject.current_step_name ).to be_nil
62
62
  end
63
63
 
64
64
  it 'returns nil if the name is undefined' do
65
65
  @metadata = { :step => {} }
66
- subject.instance_variable_set( :@metadata, metadata )
66
+ allow(subject).to receive(:metadata).and_return(metadata)
67
67
  expect( subject.current_step_name ).to be_nil
68
68
  end
69
69
 
70
70
  it 'returns the set value' do
71
71
  name = 'holyGrail_stepName'
72
72
  @metadata = { :step => { :name => name } }
73
- subject.instance_variable_set( :@metadata, metadata )
73
+ allow(subject).to receive(:metadata).and_return(metadata)
74
74
  expect( subject.current_step_name ).to be === name
75
75
  end
76
76
  end
77
- end
77
+ end
@@ -328,6 +328,7 @@ describe ClassMixedWithDSLInstallUtils do
328
328
  expect( subject ).to receive( :on ).with( hosts[2], /puppet agent -t/, :acceptable_exit_codes => [0,2] ).once
329
329
  expect( subject ).to receive( :on ).with( hosts[3], /puppet agent -t/, :acceptable_exit_codes => [0,2] ).once
330
330
  #run rake task on dashboard
331
+
331
332
  expect( subject ).to receive( :on ).with( hosts[0], /\/opt\/puppet\/bin\/rake -sf \/opt\/puppet\/share\/puppet-dashboard\/Rakefile .* RAILS_ENV=production/ ).once
332
333
  #wait for all hosts to appear in the dashboard
333
334
  #run puppet agent now that installation is complete
@@ -14,6 +14,7 @@ class ClassMixedWithDSLInstallUtils
14
14
  end
15
15
 
16
16
  describe ClassMixedWithDSLInstallUtils do
17
+ let(:metadata) { @metadata ||= {} }
17
18
  let(:presets) { Beaker::Options::Presets.new }
18
19
  let(:opts) { presets.presets.merge(presets.env_vars) }
19
20
  let(:basic_hosts) { make_hosts( { :pe_ver => '3.0',
@@ -82,6 +83,7 @@ describe ClassMixedWithDSLInstallUtils do
82
83
  cmd = 'cd /path/to/repo/name && git describe || true'
83
84
  logger = double.as_null_object
84
85
 
86
+ allow( subject ).to receive( :metadata ).and_return( metadata )
85
87
  expect( subject ).to receive( :logger ).and_return( logger )
86
88
  expect( subject ).to receive( :on ).with( host, cmd ).and_yield
87
89
  expect( subject ).to receive( :stdout ).and_return( '2' )
@@ -130,6 +132,7 @@ describe ClassMixedWithDSLInstallUtils do
130
132
  host = { 'platform' => 'debian' }
131
133
  logger = double.as_null_object
132
134
 
135
+ allow( subject ).to receive( :metadata ).and_return( metadata )
133
136
  expect( subject ).to receive( :logger ).exactly( 3 ).times.and_return( logger )
134
137
  expect( subject ).to receive( :on ).exactly( 4 ).times
135
138
 
@@ -147,6 +150,7 @@ describe ClassMixedWithDSLInstallUtils do
147
150
  cmd = "test -d #{path}/#{repo[:name]} || git clone --branch #{repo[:rev]} --depth #{repo[:depth]} #{repo[:path]} #{path}/#{repo[:name]}"
148
151
  host = { 'platform' => 'debian' }
149
152
  logger = double.as_null_object
153
+ allow( subject ).to receive( :metadata ).and_return( metadata )
150
154
  expect( subject ).to receive( :logger ).exactly( 3 ).times.and_return( logger )
151
155
  expect( subject ).to receive( :on ).with( host,"test -d #{path} || mkdir -p #{path}").exactly( 1 ).times
152
156
  # this is the the command we want to test
@@ -169,6 +173,7 @@ describe ClassMixedWithDSLInstallUtils do
169
173
  cmd = "test -d #{path}/#{repo[:name]} || git clone --branch #{repo[:depth_branch]} --depth #{repo[:depth]} #{repo[:path]} #{path}/#{repo[:name]}"
170
174
  host = { 'platform' => 'debian' }
171
175
  logger = double.as_null_object
176
+ allow( subject ).to receive( :metadata ).and_return( metadata )
172
177
  expect( subject ).to receive( :logger ).exactly( 3 ).times.and_return( logger )
173
178
  expect( subject ).to receive( :on ).with( host,"test -d #{path} || mkdir -p #{path}").exactly( 1 ).times
174
179
  # this is the the command we want to test
@@ -7,14 +7,20 @@ end
7
7
 
8
8
  describe ClassMixedWithDSLStructure do
9
9
  include Beaker::DSL::Assertions
10
- let(:logger) { double }
10
+
11
+ let (:logger) { double }
12
+ let (:metadata) { @metadata ||= {} }
13
+
14
+ before :each do
15
+ allow( subject ).to receive(:metadata).and_return(metadata)
16
+ end
17
+
11
18
  describe '#step' do
12
19
  it 'requires a name' do
13
20
  expect { subject.step do; end }.to raise_error ArgumentError
14
21
  end
15
22
 
16
23
  it 'notifies the logger' do
17
- subject.instance_variable_set(:@metadata, {})
18
24
  allow( subject ).to receive( :set_current_step_name )
19
25
  expect( subject ).to receive( :logger ).and_return( logger )
20
26
  expect( logger ).to receive( :notify )
@@ -22,7 +28,6 @@ describe ClassMixedWithDSLStructure do
22
28
  end
23
29
 
24
30
  it 'yields if a block is given' do
25
- subject.instance_variable_set(:@metadata, {})
26
31
  expect( subject ).to receive( :logger ).and_return( logger )
27
32
  allow( subject ).to receive( :set_current_step_name )
28
33
  expect( logger ).to receive( :notify )
@@ -33,29 +38,27 @@ describe ClassMixedWithDSLStructure do
33
38
  end
34
39
 
35
40
  it 'sets the metadata' do
36
- subject.instance_variable_set(:@metadata, {})
37
41
  allow( subject ).to receive( :logger ).and_return( logger )
38
42
  allow( logger ).to receive( :notify )
39
43
  step_name = 'pierceBrosnanTests'
40
44
  subject.step step_name
41
- expect( subject.instance_variable_get(:@metadata)[:step][:name] ).to be === step_name
45
+ expect( metadata[:step][:name] ).to be === step_name
42
46
  end
43
47
  end
44
48
 
45
49
  describe '#test_name' do
50
+
46
51
  it 'requires a name' do
47
52
  expect { subject.test_name do; end }.to raise_error ArgumentError
48
53
  end
49
54
 
50
55
  it 'notifies the logger' do
51
- subject.instance_variable_set(:@metadata, {})
52
56
  expect( subject ).to receive( :logger ).and_return( logger )
53
57
  expect( logger ).to receive( :notify )
54
58
  subject.test_name 'blah'
55
59
  end
56
60
 
57
61
  it 'yields if a block is given' do
58
- subject.instance_variable_set(:@metadata, {})
59
62
  expect( subject ).to receive( :logger ).and_return( logger )
60
63
  expect( logger ).to receive( :notify )
61
64
  expect( subject ).to receive( :foo )
@@ -65,12 +68,11 @@ describe ClassMixedWithDSLStructure do
65
68
  end
66
69
 
67
70
  it 'sets the metadata' do
68
- subject.instance_variable_set(:@metadata, {})
69
71
  allow( subject ).to receive( :logger ).and_return( logger )
70
72
  allow( logger ).to receive( :notify )
71
73
  test_name = '15-05-08\'s weather is beautiful'
72
74
  subject.test_name test_name
73
- expect( subject.instance_variable_get(:@metadata)[:case][:name] ).to be === test_name
75
+ expect( metadata[:case][:name] ).to be === test_name
74
76
  end
75
77
  end
76
78
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.12.0
4
+ version: 2.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-20 00:00:00.000000000 Z
11
+ date: 2015-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -170,14 +170,14 @@ dependencies:
170
170
  requirements:
171
171
  - - ~>
172
172
  - !ruby/object:Gem::Version
173
- version: 0.0.4
173
+ version: '0.1'
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - ~>
179
179
  - !ruby/object:Gem::Version
180
- version: 0.0.4
180
+ version: '0.1'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: net-ssh
183
183
  requirement: !ruby/object:Gem::Requirement