Permalink
Browse files

Use assert_match instead of String#include? so we can get helpful err…

…or messages on failure

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6668 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 4cbbebb commit e64236882919a6696ff64a4e3e736955b4d09753 @NZKoz NZKoz committed May 6, 2007
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/test/xml_serialization_test.rb
@@ -146,6 +146,8 @@ def test_passing_hash_shouldnt_reuse_builder
def test_include_uses_association_name
xml = authors(:david).to_xml :include=>:hello_posts, :indent=>0
- assert(xml.include?(%(<hello_posts><post>)) || xml.include?(%(</post></hello-posts>)))
+ assert_match %r{<hello-posts>}, xml
+ assert_match %r{<post>}, xml
+ assert_match %r{<sti-post>}, xml
end
end

0 comments on commit e642368

Please sign in to comment.