Skip to content

Commit 1e04a06

Browse files
committed
Progress on tests/ based rspec system but not yet done
1 parent d82efa0 commit 1e04a06

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

spec/spec_helper_system.rb.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ RSpec.configure do |c|
3232
puppet_install
3333

3434
# Copy this module into the module path of the test node
35-
puppet_module_install(:source => proj_root, :module_name => 'redis')
35+
puppet_module_install(:source => proj_root, :module_name => '<%= metadata.name %>')
3636
shell('puppet module install puppetlabs/stdlib')
3737

3838
file = Tempfile.new('foo')

spec/system/basic_spec.rb.erb

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
require 'spec_helper_system'
22

3-
describe 'basic tests' do
4-
it 'class should work without errors' do
5-
pp = <<-EOS
6-
class { '<%= metadata.name %>': }
7-
EOS
3+
describe 'install:' do
4+
after :all do
5+
# Cleanup after tests have ran
6+
puppet_apply("class { '<%= metadata.name %>': ensure => absent }") do |r|
7+
r.exit_code.should_not == 1
8+
end
9+
end
10+
11+
it 'test <%= metadata.name %>' do
12+
pp = fixture_read('modules/<%= metadata.name %>/tests/init.pp')
813

914
puppet_apply(pp) do |r|
10-
r.exit_code.should == 2
15+
r.exit_code.should_not == 1
16+
end
17+
18+
puppet_apply(pp) do |r|
19+
r.exit_code.should be_zero
1120
end
1221
end
22+
1323
end

0 commit comments

Comments
 (0)