Permalink
Browse files

remove 1.8.7 regexp warnings

  • Loading branch information...
1 parent 9eb7063 commit a6432433493c54156c423529b582bbba8b3d2a7f @JonRowe JonRowe committed Feb 23, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 spec/rspec/rails/matchers/be_a_new_spec.rb
@@ -72,7 +72,7 @@ def new_record?; true; end
expect {
expect(record).to be_a_new(record.class).with(:zoo => 'zoo', :car => 'car')
}.to raise_error {|e|
- expect(e.message).to match(/attributes {.*} were not set on #{record.inspect}/)
+ expect(e.message).to match(/attributes \{.*\} were not set on #{Regexp.escape record.inspect}/)
expect(e.message).to match(/"zoo"=>"zoo"/)
expect(e.message).to match(/"car"=>"car"/)
}
@@ -120,7 +120,7 @@ def new_record?; false; end
expect {
expect(record).to be_a_new(String).with(:zoo => 'zoo', :car => 'car')
}.to raise_error {|e|
- expect(e.message).to match(/expected #{record.inspect} to be a new String and attributes {.*} were not set on #{record.inspect}/)
+ expect(e.message).to match(/expected #{Regexp.escape record.inspect} to be a new String and attributes \{.*\} were not set on #{Regexp.escape record.inspect}/)
expect(e.message).to match(/"zoo"=>"zoo"/)
expect(e.message).to match(/"car"=>"car"/)
}

0 comments on commit a643243

Please sign in to comment.