archrelease: copy trunk to community-any
[ArchLinux/community.git] / ruby-log4r / trunk / e64ed5143aae17fef85fe191c967765409061266.patch
blob916c010fc79fc9db969b3fafd8e622d89c937af7
1 commit e64ed5143aae17fef85fe191c967765409061266
2 Author: Vít Ondruch <vondruch@redhat.com>
3 Date: Tue Jan 9 13:56:33 2018 +0100
5 First parameter of assert is always what is expected.
7 The other parameter is object which is asserted.
9 diff --git a/tests/testformatter.rb b/tests/testformatter.rb
10 index 673c8dd..4ff70a1 100644
11 --- a/tests/testformatter.rb
12 +++ b/tests/testformatter.rb
13 @@ -12,7 +12,7 @@ class TestFormatter < TestCase
14 sf = SimpleFormatter.new
15 f = Logger.new('simple formatter')
16 event = LogEvent.new(0, f, nil, "some data")
17 - assert_match(sf.format(event), /simple formatter/)
18 + assert_match(/simple formatter/, sf.format(event))
19 end
20 def test_basic_formatter
21 b = BasicFormatter.new
22 @@ -20,12 +20,12 @@ class TestFormatter < TestCase
23 event = LogEvent.new(0, f, caller, "fake formatter")
24 event2 = LogEvent.new(0, f, nil, "fake formatter")
25 # this checks for tracing
26 - assert_match(b.format(event), /in/)
27 - assert_not_match(b.format(event2), /in/)
28 + assert_match(/in/, b.format(event))
29 + assert_not_match(/in/, b.format(event2))
30 e = ArgumentError.new("argerror")
31 e.set_backtrace ['backtrace']
32 event3 = LogEvent.new(0, f, nil, e)
33 - assert_match(b.format(event3), /ArgumentError/)
34 - assert_match(b.format(LogEvent.new(0,f,nil,[1,2,3])), /Array/)
35 + assert_match(/ArgumentError/, b.format(event3))
36 + assert_match(/Array/, b.format(LogEvent.new(0,f,nil,[1,2,3])))
37 end
38 end