ruby 1.9 compat fix for spec/defines/swift_storage_server_spec.rb

Apparently the way 1.9 does string interpolation breaks the regexp:

ruby 1.8:

    [10008][rubiojr.blueleaf] irb
    irb(main):001:0> "#{['foo']}"
    => "foo"
    irb(main):002:0>

ruby 1.9:

    [10007][rubiojr.blueleaf] irb
    1.9.3p194 :001 > "#{['foo']}"
     => "[\"foo\"]"
    1.9.3p194 :002 >
This commit is contained in:
Sergio Rubio 2012-09-24 20:43:07 +02:00
parent b1192564ea
commit 9f176a2df9

@ -72,7 +72,9 @@ describe 'swift::storage::server' do
describe "when #{k} is set" do
let :params do req_params.merge({k => v}) end
it { should contain_file(fragment_file) \
.with_content(/^#{k.to_s}\s*=\s*#{v}\s*$/)
.with_content(
/^#{k.to_s}\s*=\s*#{v.is_a?(Array) ? v.join(' ') : v}\s*$/
)
}
end
end