From 90d2cf0a7b2f3fc0d16f07abb11e204dc1ed0028 Mon Sep 17 00:00:00 2001 From: Daniel Pittman Date: Tue, 7 Jun 2011 17:16:35 -0700 Subject: maint: more work on regexp matching in Test::Unit assertions. --- acceptance/tests/ticket_7728_don't_log_whits_on_failure.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/acceptance/tests/ticket_7728_don't_log_whits_on_failure.rb b/acceptance/tests/ticket_7728_don't_log_whits_on_failure.rb index 0941c030c..eaa95ff55 100644 --- a/acceptance/tests/ticket_7728_don't_log_whits_on_failure.rb +++ b/acceptance/tests/ticket_7728_don't_log_whits_on_failure.rb @@ -12,9 +12,7 @@ manifest = %Q{ } apply_manifest_on(agents, manifest) do - # Note: using strings in the match, because I want them regexp-escaped, - # and the assertion code will do that automatically. --daniel 2011-06-07 - assert_match(Regexp.quote('notice: /Stage[main]/Foo/Notify[after]: Dependency Exec[test] has failures: true'), stdout, "the after dependency must be reported") - assert_no_match(Regexp.quote('Class[Foo]'), stdout, 'the class should not be mentioned') - assert_no_match(Regexp.quote('Stage[Main]'), stdout, 'the class should not be mentioned') + assert_match(Regexp.new(Regexp.quote('notice: /Stage[main]/Foo/Notify[after]: Dependency Exec[test] has failures: true')), stdout, "the after dependency must be reported") + assert_no_match(Regexp.new(Regexp.quote('Class[Foo]')), stdout, 'the class should not be mentioned') + assert_no_match(Regexp.new(Regexp.quote('Stage[Main]')), stdout, 'the class should not be mentioned') end -- cgit