Skip to content

Commit 40cd127

Browse files
committed
tests for tag matcher
1 parent fee068a commit 40cd127

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

spec/fixtures/manifests/site.pp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,15 @@
4848
path => "cert ${clientcert}"
4949
}
5050
}
51+
52+
node 'tags_testing' {
53+
tag 'keyword_tag'
54+
include sysctl::common
55+
file { '/tmp/a':
56+
ensure => present
57+
}
58+
file { '/tmp/b':
59+
ensure => present,
60+
tag => 'metaparam_tag'
61+
}
62+
}

spec/hosts/tags_testing_spec.rb

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
require 'spec_helper'
2+
3+
describe 'tags_testing' do
4+
it { should compile }
5+
it { should contain_class('sysctl::common')
6+
.tagged('sysctl')
7+
.tagged('keyword_tag')
8+
.not_tagged('no_such_tag')
9+
}
10+
it { should contain_file('/tmp/a')
11+
.tagged('keyword_tag')
12+
.not_tagged('not_even_this')
13+
.not_tagged('metaparam_tag')
14+
}
15+
it { should contain_file('/tmp/b')
16+
.with_ensure('present')
17+
.tagged(['keyword_tag', 'metaparam_tag'])
18+
}
19+
end

0 commit comments

Comments
 (0)