Skip to content

Commit

Permalink
use appropriate regex modifier
Browse files Browse the repository at this point in the history
was wondering why s wasn't working. silly ruby
  • Loading branch information
kitchen committed Jan 19, 2015
1 parent 43ee029 commit 6737a8d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions spec/classes/collectd_plugin_genericjmx_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@
should contain_concat__fragment('collectd_plugin_genericjmx_conf_header').with({
:order => '00',
:target => config_filename,
:content => /<Plugin "java">\s+LoadPlugin "org\.collectd\.java\.GenericJMX"\s+<Plugin "GenericJMX">/s
:content => /<Plugin "java">.+LoadPlugin "org\.collectd\.java\.GenericJMX".+<Plugin "GenericJMX">/m
})
end

it do
should contain_concat__fragment('collectd_plugin_genericjmx_conf_footer').with({
:order => '99',
:target => config_filename,
:content => %r{</Plugin>\s+</Plugin>}s,
:content => %r{</Plugin>.+</Plugin>}m,
})
end

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

Expand All @@ -65,7 +65,7 @@
should contain_concat__fragment('collectd_plugin_genericjmx_conf_header').with_content(/JVMArg "bat"/)
end
it 'should have ONLY one jvmarg parameter' do
should contain_concat__fragment('collectd_plugin_genericjmx_conf_header').without_content(/(.*JVMArg.*){2,}/s)
should contain_concat__fragment('collectd_plugin_genericjmx_conf_header').without_content(/(.*JVMArg.*){2,}/m)
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/classes/collectd_plugin_java_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
}}

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

Expand All @@ -45,7 +45,7 @@
end

it 'will only have one JVMArg parameter' do
should contain_collectd__plugin('java').without_content(/(.*JVMArg.*){2,}/)
should contain_collectd__plugin('java').without_content(/(.*JVMArg.*){2,}/m)
end
end

Expand Down

0 comments on commit 6737a8d

Please sign in to comment.