Skip to content

Commit

Permalink
tests for tag matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
kjetilho committed Jul 6, 2017
1 parent fee068a commit 40cd127
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/fixtures/manifests/site.pp
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,15 @@
path => "cert ${clientcert}"
}
}

node 'tags_testing' {
tag 'keyword_tag'
include sysctl::common
file { '/tmp/a':
ensure => present
}
file { '/tmp/b':
ensure => present,
tag => 'metaparam_tag'
}
}
19 changes: 19 additions & 0 deletions spec/hosts/tags_testing_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require 'spec_helper'

describe 'tags_testing' do
it { should compile }
it { should contain_class('sysctl::common')
.tagged('sysctl')
.tagged('keyword_tag')
.not_tagged('no_such_tag')
}
it { should contain_file('/tmp/a')
.tagged('keyword_tag')
.not_tagged('not_even_this')
.not_tagged('metaparam_tag')
}
it { should contain_file('/tmp/b')
.with_ensure('present')
.tagged(['keyword_tag', 'metaparam_tag'])
}
end

0 comments on commit 40cd127

Please sign in to comment.