[前][次][番号順一覧][スレッド一覧]

ruby-changes:37742

From: nobu <ko1@a...>
Date: Tue, 3 Mar 2015 17:19:47 +0900 (JST)
Subject: [ruby-changes:37742] nobu:r49823 (trunk): envutil.rb: improve by assert_pattern_list

nobu	2015-03-03 17:19:39 +0900 (Tue, 03 Mar 2015)

  New Revision: 49823

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49823

  Log:
    envutil.rb: improve by assert_pattern_list
    
    * test/lib/envutil.rb (assert_in_out_err): improve to match by
      assert_pattern_list if expected result is other than Regexp or
      String list.

  Modified files:
    trunk/test/lib/envutil.rb
Index: test/lib/envutil.rb
===================================================================
--- test/lib/envutil.rb	(revision 49822)
+++ test/lib/envutil.rb	(revision 49823)
@@ -344,8 +344,10 @@ module Test https://github.com/ruby/ruby/blob/trunk/test/lib/envutil.rb#L344
             begin
               if exp.is_a?(Regexp)
                 assert_match(exp, act, message)
-              else
+              elsif exp.all? {|e| String === e}
                 assert_equal(exp, act.lines.map {|l| l.chomp }, message)
+              else
+                assert_pattern_list(exp, act, message)
               end
             rescue MiniTest::Assertion => e
               errs << e.message

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]