Skip to content
This repository was archived by the owner on Jun 11, 2019. It is now read-only.

Commit 94d29ed

Browse files
author
Martin Alfke
committed
rspec for puppet 4
1 parent 8f3d9e0 commit 94d29ed

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

.travis.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,25 @@ language: ruby
22
rvm:
33
- 1.8.7
44
- 1.9.3
5+
- 2.1.4
56
script:
6-
- "bundle exec rake spec SPEC_OPTS='--format documentation'"
7+
- "bundle exec rake lint spec SPEC_OPTS='--format documentation'"
78
env:
89
- PUPPET_VERSION="~> 2.7.0"
910
- PUPPET_VERSION="~> 3.0.0"
1011
- PUPPET_VERSION="~> 3.1.0"
1112
- PUPPET_VERSION="~> 3.2.0"
1213
- PUPPET_VERSION="~> 3.3.0"
1314
- PUPPET_VERSION="~> 3.4.0"
15+
- PUPPET_VERSION="~> 4.2"
1416

17+
matrix:
18+
exclude:
19+
- rvm: 1,8.7
20+
env: PUPPET_VERSION="~> 4.2"
21+
- rvm: 2.1.4
22+
env: PUPPET_VERSION="~> 2.7.0"
23+
sudo: false
1524
gemfile: .gemfile
1625
notifications:
1726
email:

spec/classes/git_spec.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@
3232
describe 'Test customizations - template' do
3333
let(:params) { {:template => "git/spec.erb" , :options => { 'opt_a' => 'value_a' } } }
3434
it 'should generate a valid template' do
35-
content = catalogue.resource('file', 'git.conf').send(:parameters)[:content]
36-
content.should match "fqdn: rspec.example42.com"
35+
should contain_file('git.conf').with_content(/fqdn: rspec.example42.com/)
3736
end
3837
it 'should generate a template that uses custom options' do
39-
content = catalogue.resource('file', 'git.conf').send(:parameters)[:content]
40-
content.should match "value_a"
38+
should contain_file('git.conf').with_content(/value_a/)
4139
end
4240
end
4341

templates/spec.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
<%= scope.to_hash.reject { |k,v| !( k.is_a?(String) && v.is_a?(String) ) }.to_yaml %>
55

66
# Custom Options
7-
<%= options['opt_a'] %>
8-
<%= options['opt_b'] %>
7+
<%= @options['opt_a'] %>
8+
<%= @options['opt_b'] %>

0 commit comments

Comments
 (0)