Skip to content

Commit 6737a8d

Browse files
committed
use appropriate regex modifier
was wondering why s wasn't working. silly ruby
1 parent 43ee029 commit 6737a8d

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

spec/classes/collectd_plugin_genericjmx_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@
2929
should contain_concat__fragment('collectd_plugin_genericjmx_conf_header').with({
3030
:order => '00',
3131
:target => config_filename,
32-
:content => /<Plugin "java">\s+LoadPlugin "org\.collectd\.java\.GenericJMX"\s+<Plugin "GenericJMX">/s
32+
:content => /<Plugin "java">.+LoadPlugin "org\.collectd\.java\.GenericJMX".+<Plugin "GenericJMX">/m
3333
})
3434
end
3535

3636
it do
3737
should contain_concat__fragment('collectd_plugin_genericjmx_conf_footer').with({
3838
:order => '99',
3939
:target => config_filename,
40-
:content => %r{</Plugin>\s+</Plugin>}s,
40+
:content => %r{</Plugin>.+</Plugin>}m,
4141
})
4242
end
4343

@@ -55,7 +55,7 @@
5555
context 'jvmarg parameter array' do
5656
let (:params) {{ :jvmarg => %w{ foo bar baz } }}
5757
it 'should have multiple jvmarg parameters' do
58-
should contain_concat__fragment('collectd_plugin_genericjmx_conf_header').with_content(/JVMArg "foo"\s*JVMArg "bar"\s*JVMArg "baz"/s)
58+
should contain_concat__fragment('collectd_plugin_genericjmx_conf_header').with_content(/JVMArg "foo".*JVMArg "bar".*JVMArg "baz"/m)
5959
end
6060
end
6161

@@ -65,7 +65,7 @@
6565
should contain_concat__fragment('collectd_plugin_genericjmx_conf_header').with_content(/JVMArg "bat"/)
6666
end
6767
it 'should have ONLY one jvmarg parameter' do
68-
should contain_concat__fragment('collectd_plugin_genericjmx_conf_header').without_content(/(.*JVMArg.*){2,}/s)
68+
should contain_concat__fragment('collectd_plugin_genericjmx_conf_header').without_content(/(.*JVMArg.*){2,}/m)
6969
end
7070
end
7171

spec/classes/collectd_plugin_java_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
}}
3232

3333
it 'will have multiple jvmarg parameters' do
34-
should contain_collectd__plugin('java').with_content(/JVMArg "foo"[\s\n]+JVMArg "bar"[\s\n]+JVMArg "baz"/)
34+
should contain_collectd__plugin('java').with_content(/JVMArg "foo".+JVMArg "bar".+JVMArg "baz"/m)
3535
end
3636
end
3737

@@ -45,7 +45,7 @@
4545
end
4646

4747
it 'will only have one JVMArg parameter' do
48-
should contain_collectd__plugin('java').without_content(/(.*JVMArg.*){2,}/)
48+
should contain_collectd__plugin('java').without_content(/(.*JVMArg.*){2,}/m)
4949
end
5050
end
5151

0 commit comments

Comments
 (0)