@@ -49,83 +49,42 @@ class { 'elasticsearch': }
4949 end
5050
5151 describe 'collector ordering' do
52- describe 'when present' do
53- let ( :pre_condition ) do
54- <<-EOS
55- class { 'elasticsearch': }
56- elasticsearch::template { 'foo': content => {"foo" => "bar"} }
57- elasticsearch::role { 'test_role':
58- privileges => {
59- 'cluster' => 'monitor',
60- 'indices' => {
61- '*' => 'all',
62- },
52+ let ( :pre_condition ) do
53+ <<-EOS
54+ class { 'elasticsearch': }
55+ elasticsearch::template { 'foo': content => {"foo" => "bar"} }
56+ elasticsearch::role { 'test_role':
57+ privileges => {
58+ 'cluster' => 'monitor',
59+ 'indices' => {
60+ '*' => 'all',
6361 },
64- }
65- EOS
66- end
67-
68- let ( :params ) do
69- {
70- password : 'foobar' ,
71- roles : %w[ monitor user ]
62+ },
7263 }
73- end
74-
75- it { is_expected . to contain_elasticsearch__role ( 'test_role' ) }
76- it { is_expected . to contain_elasticsearch_role ( 'test_role' ) }
77- it { is_expected . to contain_elasticsearch_role_mapping ( 'test_role' ) }
64+ EOS
65+ end
7866
79- it {
80- expect ( subject ) . to contain_elasticsearch__user ( 'elastic' ) .
81- that_comes_before ( [
82- 'Elasticsearch::Template[foo]'
83- ] ) . that_requires ( [
84- 'Elasticsearch::Role[test_role]'
85- ] )
67+ let ( :params ) do
68+ {
69+ password : 'foobar' ,
70+ roles : %w[ monitor user ]
8671 }
87-
88- include_examples 'class' , :systemd
8972 end
9073
91- describe 'when absent' do
92- let ( :pre_condition ) do
93- <<-EOS
94- class { 'elasticsearch': }
95- elasticsearch::template { 'foo': content => {"foo" => "bar"} }
96- elasticsearch::role { 'test_role':
97- privileges => {
98- 'cluster' => 'monitor',
99- 'indices' => {
100- '*' => 'all',
101- },
102- },
103- }
104- EOS
105- end
106-
107- let ( :params ) do
108- {
109- password : 'foobar' ,
110- roles : %w[ monitor user ]
111- }
112- end
74+ it { is_expected . to contain_elasticsearch__role ( 'test_role' ) }
75+ it { is_expected . to contain_elasticsearch_role ( 'test_role' ) }
76+ it { is_expected . to contain_elasticsearch_role_mapping ( 'test_role' ) }
11377
114- it { is_expected . to contain_elasticsearch__role ( 'test_role' ) }
115- it { is_expected . to contain_elasticsearch_role ( 'test_role' ) }
116- it { is_expected . to contain_elasticsearch_role_mapping ( 'test_role' ) }
78+ it {
79+ expect ( subject ) . to contain_elasticsearch__user ( 'elastic' ) .
80+ that_comes_before ( [
81+ 'Elasticsearch::Template[foo]'
82+ ] ) . that_requires ( [
83+ 'Elasticsearch::Role[test_role]'
84+ ] )
85+ }
11786
118- it {
119- expect ( subject ) . to contain_elasticsearch__user ( 'elastic' ) .
120- that_comes_before ( [
121- 'Elasticsearch::Template[foo]'
122- ] ) . that_requires ( [
123- 'Elasticsearch::Role[test_role]'
124- ] )
125- }
126-
127- include_examples 'class' , :systemd
128- end
87+ include_examples 'class' , :systemd
12988 end
13089 end
13190 end
0 commit comments