summaryrefslogtreecommitdiffstats
path: root/acceptance
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-06-07 16:09:21 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-06-07 16:09:21 -0700
commitb4e9791df5c01183ff037a346361ed3667e67552 (patch)
tree48859c1ccf73ce288974a18ceed636f8cf87e5ac /acceptance
parent5c89129859bf7d9cb2533a6438cb9db0a8fee2be (diff)
downloadpuppet-b4e9791df5c01183ff037a346361ed3667e67552.tar.gz
puppet-b4e9791df5c01183ff037a346361ed3667e67552.tar.xz
puppet-b4e9791df5c01183ff037a346361ed3667e67552.zip
maint: handle incoherent Test::Unit assertions.
So, it turns out that the 1.8.7 Test::Unit assertions are a bit quirky. If we use 'assert_match' it will turn a String into a regular expression by passing it through Regexp.quote automatically. If you use 'assert_no_match', though, it will not do that. It will just complain that it isn't a Regexp and blow up. So, we manually quote outside the assertion in both cases, and things should just work.
Diffstat (limited to 'acceptance')
-rw-r--r--acceptance/tests/ticket_7728_don't_log_whits_on_failure.rb6
1 files changed, 3 insertions, 3 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 51220d4d4..0d4dd6b5d 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
@@ -14,7 +14,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('notice: /Stage[main]/Foo/Notify[after]: Dependency Exec[test] has failures: true', stdout, "the after dependency must be reported")
- assert_no_match('Class[Foo]', stdout, 'the class should not be mentioned')
- assert_no_match('Stage[Main]', stdout, 'the class should not be mentioned')
+ 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')
end