[test-unit-commit:00176] test-unit/test-unit [master] [test] check_fails -> check_fail.

null+test-unit @ clear-code.com null+test-unit @ clear-code.com
2012年 1月 5日 (木) 08:47:04 EST


Kouhei Sutou	2012-01-05 22:47:04 +0900 (Thu, 05 Jan 2012)

  New Revision: 8bd2085ce4a92b1790a3ae8a8e655fc75147fc69

  Log:
    [test] check_fails -> check_fail.

  Modified files:
    test/test-assertions.rb

  Modified: test/test-assertions.rb (+134 -134)
===================================================================
--- test/test-assertions.rb    2012-01-05 22:46:41 +0900 (8265ed6)
+++ test/test-assertions.rb    2012-01-05 22:47:04 +0900 (38ae226)
@@ -83,13 +83,13 @@ module Test
                          &proc)
       end
 
-      def check_fails(expected_message, options={}, &proc)
+      def check_fail(expected_message, options={}, &proc)
         check_assertions(true,
                          options.merge(:expected_message => expected_message),
                          &proc)
       end
 
-      def check_fails_exception(expected_message, options={}, &proc)
+      def check_fail_exception(expected_message, options={}, &proc)
         normalizer = lambda do |actual_message|
           actual_message.gsub(/(^[^:]+:\d+:.*\n?)+\z/, "")
         end
@@ -137,10 +137,10 @@ module Test
         check_nothing_fails {
           assert_block("successful assert_block") {true}
         }
-        check_fails("assert_block failed.") {
+        check_fail("assert_block failed.") {
           assert_block {false}
         }
-        check_fails("failed assert_block") {
+        check_fail("failed assert_block") {
           assert_block("failed assert_block") {false}
         }
       end
@@ -163,7 +163,7 @@ diff:
 + string2
 ?       ^
 EOM
-        check_fails(message) {
+        check_fail(message) {
           assert_equal("string1", "string2")
         }
 
@@ -178,7 +178,7 @@ diff:
 + string2
 ?       ^
 EOM
-        check_fails(message) {
+        check_fail(message) {
           assert_equal("string1", "string2", "failed assert_equal")
         }
 
@@ -191,7 +191,7 @@ diff:
 ? -      -
 + 111111
 EOM
-        check_fails(message) do
+        check_fail(message) do
           assert_equal("111111", 111111)
         end
       end
@@ -232,7 +232,7 @@ folded diff:
 ?  ^^^^^^^^^
   898123456789
 EOM
-        check_fails(message) do
+        check_fail(message) do
           assert_equal(expected, actual)
         end
       end
@@ -242,7 +242,7 @@ EOM
 <1> expected but was
 <2>.
 EOM
-        check_fails(message) do
+        check_fail(message) do
           assert_equal(1, 2)
         end
       end
@@ -254,7 +254,7 @@ EOM
 <#{now.inspect}> expected but was
 <#{now.inspect}>.
 EOM
-        check_fails(message) do
+        check_fail(message) do
           assert_equal(now, now_without_usec)
         end
       end
@@ -269,7 +269,7 @@ diff:
 - a
 - b
 EOM
-        check_fails(message) do
+        check_fail(message) do
           assert_equal("a\nb", "x")
         end
       end
@@ -290,7 +290,7 @@ folded diff:
 #{(["- " + ("x" * 78)] * 12).join("\n")}
 - #{"x" * 61}
 EOM
-        check_fails(message) do
+        check_fail(message) do
           assert_equal("a\n" + "x" * 997, "x")
         end
 
@@ -298,7 +298,7 @@ EOM
 <#{("a\n" + "x" * 998).inspect}> expected but was
 <#{"x".inspect}>.
 EOM
-        check_fails(message) do
+        check_fail(message) do
           assert_equal("a\n" + "x" * 998, "x")
         end
       end
@@ -323,7 +323,7 @@ folded diff:
 #{(["- " + ("x" * 78)]).join("\n")}
 - #{"x" * 19}
 EOM
-          check_fails(message) do
+          check_fail(message) do
             assert_equal("a\n" + "x" * 97, "x")
           end
 
@@ -331,7 +331,7 @@ EOM
 <#{("a\n" + "x" * 98).inspect}> expected but was
 <#{"x".inspect}>.
 EOM
-          check_fails(message) do
+          check_fail(message) do
             assert_equal("a\n" + "x" * 98, "x")
           end
         ensure
@@ -349,7 +349,7 @@ EOM
 <#{utf8_string.inspect}>("UTF-8") expected but was
 <#{ascii_8bit_string.inspect}>("ASCII-8BIT").
 EOM
-        check_fails(message) do
+        check_fail(message) do
           assert_equal(utf8_string, ascii_8bit_string)
         end
       end
@@ -367,7 +367,7 @@ EOM
 <{"Lisp"=>"John McCarthy", "Ruby"=>"Matz"}> expected but was
 <{"Heavy"=>["C", "C++"], "LL"=>["Ruby", "Python"]}>.
 EOM
-        check_fails(message) do
+        check_fail(message) do
           assert_equal(designers, categories)
         end
       end
@@ -387,7 +387,7 @@ diff:
 + {"followers"=>[{"followers"=>[{...}], "name"=>"Alice"}], "name"=>"Bob"}
 ?                                                       +++++++++++++++++
 EOM
-        check_fails(message) do
+        check_fail(message) do
           assert_equal(alice, bob)
         end
       end
@@ -432,7 +432,7 @@ EOM
       end
 
       def test_assert_raise_fail
-        check_fails("<RuntimeError> exception expected but none was thrown.") do
+        check_fail("<RuntimeError> exception expected but none was thrown.") do
           assert_raise(RuntimeError) do
             1 + 1
           end
@@ -444,7 +444,7 @@ failed assert_raise.
 Class: <RuntimeError>
 Message: <Error>
 EOM
-        check_fails_exception(message) do
+        check_fail_exception(message) do
           assert_raise(ArgumentError, "failed assert_raise") do
             raise "Error"
           end
@@ -454,7 +454,7 @@ EOM
 Should expect a class of exception, Object.
 <false> is not true.
 EOM
-        check_fails(message.chomp) do
+        check_fail(message.chomp) do
           assert_nothing_raised(Object) do
             1 + 1
           end
@@ -494,7 +494,7 @@ EOM
                 "from a successful assert_raise")
         end
 
-        check_fails("<[ArgumentError, TypeError, Math, Comparable]> exception " +
+        check_fail("<[ArgumentError, TypeError, Math, Comparable]> exception " +
                     "expected but none was thrown.") do
           assert_raise(*rescues) do
             1 + 1
@@ -507,7 +507,7 @@ failed assert_raise.
 Class: <RuntimeError>
 Message: <Error>
 EOM
-        check_fails_exception(message) do
+        check_fail_exception(message) do
           assert_raise(ArgumentError, TypeError, "failed assert_raise") do
             raise "Error"
           end
@@ -533,7 +533,7 @@ EOM
 Class: <RuntimeError>
 Message: <Error>
 EOM
-        check_fails_exception(message) do
+        check_fail_exception(message) do
           return_value = assert_raise(RuntimeError.new("XXX")) do
             raise "Error"
           end
@@ -545,7 +545,7 @@ EOM
 Class: <RuntimeError>
 Message: <Error>
 EOM
-        check_fails_exception(message) do
+        check_fail_exception(message) do
           assert_raise(different_error_class.new("Error")) do
             raise "Error"
           end
@@ -560,7 +560,7 @@ EOM
 Class: <RuntimeError>
 Message: <Error>
 EOM
-        check_fails_exception(message) do
+        check_fail_exception(message) do
           assert_raise(different_error) do
             raise "Error"
           end
@@ -585,20 +585,20 @@ EOM
         check_nothing_fails {
           assert_instance_of(String, "string", "successful assert_instance_of")
         }
-        check_fails(%Q{<"string"> expected to be an instance of\n<Hash> but was\n<String>.}) {
+        check_fail(%Q{<"string"> expected to be an instance of\n<Hash> but was\n<String>.}) {
           assert_instance_of(Hash, "string")
         }
-        check_fails(%Q{failed assert_instance_of.\n<"string"> expected to be an instance of\n<Hash> but was\n<String>.}) {
+        check_fail(%Q{failed assert_instance_of.\n<"string"> expected to be an instance of\n<Hash> but was\n<String>.}) {
           assert_instance_of(Hash, "string", "failed assert_instance_of")
         }
 
         check_nothing_fails do
           assert_instance_of([Fixnum, NilClass], 100)
         end
-        check_fails(%Q{<"string"> expected to be an instance of\n[<Fixnum>, <NilClass>] but was\n<String>.}) do
+        check_fail(%Q{<"string"> expected to be an instance of\n[<Fixnum>, <NilClass>] but was\n<String>.}) do
           assert_instance_of([Fixnum, NilClass], "string")
         end
-        check_fails(%Q{<100> expected to be an instance of\n[<Numeric>, <NilClass>] but was\n<Fixnum>.}) do
+        check_fail(%Q{<100> expected to be an instance of\n[<Numeric>, <NilClass>] but was\n<Fixnum>.}) do
           assert_instance_of([Numeric, NilClass], 100)
         end
       end
@@ -613,10 +613,10 @@ EOM
         check_nothing_fails {
           assert_nil(nil, "successful assert_nil")
         }
-        check_fails(%Q{<"string"> expected to be nil.}) {
+        check_fail(%Q{<"string"> expected to be nil.}) {
           assert_nil("string")
         }
-        check_fails(%Q{failed assert_nil.\n<"string"> expected to be nil.}) {
+        check_fail(%Q{failed assert_nil.\n<"string"> expected to be nil.}) {
           assert_nil("string", "failed assert_nil")
         }
       end
@@ -624,8 +624,8 @@ EOM
       def test_assert_not_nil
         check_nothing_fails{assert_not_nil(false)}
         check_nothing_fails{assert_not_nil(false, "message")}
-        check_fails("<nil> expected to not be nil."){assert_not_nil(nil)}
-        check_fails("message.\n<nil> expected to not be nil.") {assert_not_nil(nil, "message")}
+        check_fail("<nil> expected to not be nil."){assert_not_nil(nil)}
+        check_fail("message.\n<nil> expected to not be nil.") {assert_not_nil(nil, "message")}
       end
         
       def test_assert_kind_of
@@ -641,17 +641,17 @@ EOM
         check_nothing_fails {
           assert_kind_of(Comparable, 1)
         }
-        check_fails(%Q{<"string"> expected to be kind_of?\n<Class> but was\n<String>.}) {
+        check_fail(%Q{<"string"> expected to be kind_of?\n<Class> but was\n<String>.}) {
           assert_kind_of(Class, "string")
         }
-        check_fails(%Q{failed assert_kind_of.\n<"string"> expected to be kind_of?\n<Class> but was\n<String>.}) {
+        check_fail(%Q{failed assert_kind_of.\n<"string"> expected to be kind_of?\n<Class> but was\n<String>.}) {
           assert_kind_of(Class, "string", "failed assert_kind_of")
         }
 
         check_nothing_fails do
           assert_kind_of([Fixnum, NilClass], 100)
         end
-        check_fails(%Q{<"string"> expected to be kind_of?\n[<Fixnum>, <NilClass>] but was\n<String>.}) do
+        check_fail(%Q{<"string"> expected to be kind_of?\n[<Fixnum>, <NilClass>] but was\n<String>.}) do
           assert_kind_of([Fixnum, NilClass], "string")
         end
       end
@@ -669,13 +669,13 @@ EOM
         check_nothing_fails {
           assert_match(/strin./, "string", "successful assert_match")
         }
-        check_fails(%Q{<"string"> expected to be =~\n</slin./>.}) {
+        check_fail(%Q{<"string"> expected to be =~\n</slin./>.}) {
           assert_match(/slin./, "string")
         }
-        check_fails(%Q{<"string"> expected to be =~\n</strin\\./>.}) {
+        check_fail(%Q{<"string"> expected to be =~\n</strin\\./>.}) {
           assert_match("strin.", "string")
         }
-        check_fails(%Q{failed assert_match.\n<"string"> expected to be =~\n</slin./>.}) {
+        check_fail(%Q{failed assert_match.\n<"string"> expected to be =~\n</slin./>.}) {
           assert_match(/slin./, "string", "failed assert_match")
         }
       end
@@ -692,10 +692,10 @@ EOM
           assert_same(thing, thing, "successful assert_same")
         }
         thing2 = "thing"
-        check_fails(%Q{<"thing">\nwith id <#{thing.__id__}> expected to be equal? to\n<"thing">\nwith id <#{thing2.__id__}>.}) {
+        check_fail(%Q{<"thing">\nwith id <#{thing.__id__}> expected to be equal? to\n<"thing">\nwith id <#{thing2.__id__}>.}) {
           assert_same(thing, thing2)
         }
-        check_fails(%Q{failed assert_same.\n<"thing">\nwith id <#{thing.__id__}> expected to be equal? to\n<"thing">\nwith id <#{thing2.__id__}>.}) {
+        check_fail(%Q{failed assert_same.\n<"thing">\nwith id <#{thing.__id__}> expected to be equal? to\n<"thing">\nwith id <#{thing2.__id__}>.}) {
           assert_same(thing, thing2, "failed assert_same")
         }
       end
@@ -724,7 +724,7 @@ EOM
           rescue ZeroDivisionError
           end
         }
-        check_fails("Should expect a class of exception, Object.\n<false> is not true.") {
+        check_fail("Should expect a class of exception, Object.\n<false> is not true.") {
           assert_nothing_raised(Object) {
             1 + 1
           }
@@ -734,7 +734,7 @@ Exception raised:
 Class: <RuntimeError>
 Message: <Error>
 EOM
-        check_fails_exception(expected_message) {
+        check_fail_exception(expected_message) {
           assert_nothing_raised {
             raise "Error"
           }
@@ -745,7 +745,7 @@ Exception raised:
 Class: <RuntimeError>
 Message: <Error>
 EOM
-        check_fails_exception(expected_message) {
+        check_fail_exception(expected_message) {
           assert_nothing_raised("failed assert_nothing_raised") {
             raise "Error"
           }
@@ -755,12 +755,12 @@ Exception raised:
 Class: <RuntimeError>
 Message: <Error>
 EOM
-        check_fails_exception(expected_message) {
+        check_fail_exception(expected_message) {
           assert_nothing_raised(StandardError, RuntimeError) {
             raise "Error"
           }
         }
-        check_fails("Failure.") do
+        check_fail("Failure.") do
           assert_nothing_raised do
             flunk("Failure")
           end
@@ -768,10 +768,10 @@ EOM
       end
       
       def test_flunk
-        check_fails("Flunked.") {
+        check_fail("Flunked.") {
           flunk
         }
-        check_fails("flunk message.") {
+        check_fail("flunk message.") {
           flunk("flunk message")
         }
       end
@@ -785,10 +785,10 @@ EOM
         check_nothing_fails {
           assert_not_same(thing, thing2, "message")
         }
-        check_fails(%Q{<"thing">\nwith id <#{thing.__id__}> expected to not be equal? to\n<"thing">\nwith id <#{thing.__id__}>.}) {
+        check_fail(%Q{<"thing">\nwith id <#{thing.__id__}> expected to not be equal? to\n<"thing">\nwith id <#{thing.__id__}>.}) {
           assert_not_same(thing, thing)
         }
-        check_fails(%Q{message.\n<"thing">\nwith id <#{thing.__id__}> expected to not be equal? to\n<"thing">\nwith id <#{thing.__id__}>.}) {
+        check_fail(%Q{message.\n<"thing">\nwith id <#{thing.__id__}> expected to not be equal? to\n<"thing">\nwith id <#{thing.__id__}>.}) {
           assert_not_same(thing, thing, "message")
         }
       end
@@ -800,10 +800,10 @@ EOM
         check_nothing_fails {
           assert_not_equal("string1", "string2", "message")
         }
-        check_fails(%Q{<"string"> expected to be != to\n<"string">.}) {
+        check_fail(%Q{<"string"> expected to be != to\n<"string">.}) {
           assert_not_equal("string", "string")
         }
-        check_fails(%Q{message.\n<"string"> expected to be != to\n<"string">.}) {
+        check_fail(%Q{message.\n<"string"> expected to be != to\n<"string">.}) {
           assert_not_equal("string", "string", "message")
         }
       end
@@ -821,7 +821,7 @@ EOM
       end
 
       def test_assert_not_match_fail_not_regexp
-        check_fails("<REGEXP> in assert_not_match(<REGEXP>, ...) " +
+        check_fail("<REGEXP> in assert_not_match(<REGEXP>, ...) " +
                     "should be a Regexp.\n" +
                     "<\"asdf\"> expected to be an instance of\n" +
                     "<Regexp> but was\n" +
@@ -831,14 +831,14 @@ EOM
       end
 
       def test_assert_not_match_fail_match
-        check_fails("</string/> expected to not match\n" +
+        check_fail("</string/> expected to not match\n" +
                     "<\"string\">.") do
           assert_not_match(/string/, "string")
         end
       end
 
       def test_assert_not_match_fail_match_with_message
-        check_fails("message.\n" +
+        check_fail("message.\n" +
                     "</string/> expected to not match\n" +
                     "<\"string\">.") do
           assert_not_match(/string/, "string", "message")
@@ -848,13 +848,13 @@ EOM
       def test_assert_no_match
         check_nothing_fails{assert_no_match(/sling/, "string")}
         check_nothing_fails{assert_no_match(/sling/, "string", "message")}
-        check_fails(%Q{The first argument to assert_no_match should be a Regexp.\n<"asdf"> expected to be an instance of\n<Regexp> but was\n<String>.}) do
+        check_fail(%Q{The first argument to assert_no_match should be a Regexp.\n<"asdf"> expected to be an instance of\n<Regexp> but was\n<String>.}) do
           assert_no_match("asdf", "asdf")
         end
-        check_fails(%Q{</string/> expected to not match\n<"string">.}) do
+        check_fail(%Q{</string/> expected to not match\n<"string">.}) do
           assert_no_match(/string/, "string")
         end
-        check_fails(%Q{message.\n</string/> expected to not match\n<"string">.}) do
+        check_fail(%Q{message.\n</string/> expected to not match\n<"string">.}) do
           assert_no_match(/string/, "string", "message")
         end
       end
@@ -867,14 +867,14 @@ EOM
         end
 
         tag = :thing2
-        check_fails("message.\n" +
+        check_fail("message.\n" +
                     "<:thing> expected to be thrown but\n" +
                     "<#{inspect_tag(tag)}> was thrown.") do
           assert_throw(:thing, "message") do
             throw :thing2
           end
         end
-        check_fails("message.\n" +
+        check_fail("message.\n" +
                     "<:thing> should have been thrown.") do
           assert_throw(:thing, "message") do
             1 + 1
@@ -891,7 +891,7 @@ EOM
 
         tag = :thing
         inspected = inspect_tag(tag)
-        check_fails("message.\n" +
+        check_fail("message.\n" +
                     "<#{inspected}> was thrown when nothing was expected.") do
           assert_nothing_thrown("message") do
             throw tag
@@ -903,10 +903,10 @@ EOM
         check_nothing_fails {
           assert_operator("thing", :==, "thing", "message")
         }
-        check_fails(%Q{<0.15>\ngiven as the operator for #assert_operator must be a Symbol or #respond_to?(:to_str).}) do
+        check_fail(%Q{<0.15>\ngiven as the operator for #assert_operator must be a Symbol or #respond_to?(:to_str).}) do
           assert_operator("thing", 0.15, "thing")
         end
-        check_fails(%Q{message.\n<"thing1"> expected to be\n==\n<"thing2">.}) {
+        check_fail(%Q{message.\n<"thing1"> expected to be\n==\n<"thing2">.}) {
           assert_operator("thing1", :==, "thing2", "message")
         }
       end
@@ -918,11 +918,11 @@ EOM
         check_nothing_fails {
           assert_respond_to("thing", "to_s", "message")
         }
-        check_fails("<0.15>.kind_of?(Symbol) or\n" +
+        check_fail("<0.15>.kind_of?(Symbol) or\n" +
                     "<0.15>.respond_to?(:to_str) expected") {
           assert_respond_to("thing", 0.15)
         }
-        check_fails("message.\n" +
+        check_fail("message.\n" +
                     "<:symbol>.respond_to?(:nonexistence) expected\n" +
                     "(Class: <Symbol>)") {
           assert_respond_to(:symbol, :nonexistence, "message")
@@ -942,14 +942,14 @@ EOM
       end
 
       def test_assert_not_respond_to_fail_number
-        check_fails("<0.15>.kind_of?(Symbol) or\n" +
+        check_fail("<0.15>.kind_of?(Symbol) or\n" +
                     "<0.15>.respond_to?(:to_str) expected") do
           assert_respond_to("thing", 0.15)
         end
       end
 
       def tset_assert_not_respond_to_fail_existence
-        check_fails("message.\n" +
+        check_fail("message.\n" +
                     "!<:symbol>.respond_to?(:to_s) expected\n" +
                     "(Class: <Symbol>)") do
           assert_respond_to(:symbol, :to_s, "message")
@@ -975,7 +975,7 @@ message.
 <return_argument(*[false, "bogus"])> with a true value but was
 <false>.
 EOM
-        check_fails(expected_message.chomp) do
+        check_fail(expected_message.chomp) do
           assert_send([object, :return_argument, false, "bogus"], "message")
         end
       end
@@ -1002,15 +1002,15 @@ EOM
           assert_boolean(false)
         end
 
-        check_fails("<true> or <false> expected but was\n<1>") do
+        check_fail("<true> or <false> expected but was\n<1>") do
           assert_boolean(1)
         end
 
-        check_fails("<true> or <false> expected but was\n<nil>") do
+        check_fail("<true> or <false> expected but was\n<nil>") do
           assert_boolean(nil)
         end
 
-        check_fails("message.\n<true> or <false> expected but was\n<\"XXX\">") do
+        check_fail("message.\n<true> or <false> expected but was\n<\"XXX\">") do
           assert_boolean("XXX", "message")
         end
       end
@@ -1020,15 +1020,15 @@ EOM
           assert_true(true)
         end
 
-        check_fails("<true> expected but was\n<false>") do
+        check_fail("<true> expected but was\n<false>") do
           assert_true(false)
         end
 
-        check_fails("<true> expected but was\n<1>") do
+        check_fail("<true> expected but was\n<1>") do
           assert_true(1)
         end
 
-        check_fails("message.\n<true> expected but was\n<nil>") do
+        check_fail("message.\n<true> expected but was\n<nil>") do
           assert_true(nil, "message")
         end
       end
@@ -1038,15 +1038,15 @@ EOM
           assert_false(false)
         end
 
-        check_fails("<false> expected but was\n<true>") do
+        check_fail("<false> expected but was\n<true>") do
           assert_false(true)
         end
 
-        check_fails("<false> expected but was\n<nil>") do
+        check_fail("<false> expected but was\n<nil>") do
           assert_false(nil)
         end
 
-        check_fails("message.\n<false> expected but was\n<:false>") do
+        check_fail("message.\n<false> expected but was\n<:false>") do
           assert_false(:false, "message")
         end
       end
@@ -1073,7 +1073,7 @@ EOM
 <15> expected less than
 <10>.
 EOM
-        check_fails(expected_message.chomp) do
+        check_fail(expected_message.chomp) do
           assert_compare(15, "<", 10)
         end
 
@@ -1082,7 +1082,7 @@ EOM
 <15> expected less than or equal to
 <10>.
 EOM
-        check_fails(expected_message.chomp) do
+        check_fail(expected_message.chomp) do
           assert_compare(15, "<=", 10)
         end
 
@@ -1091,7 +1091,7 @@ EOM
 <10> expected greater than
 <15>.
 EOM
-        check_fails(expected_message.chomp) do
+        check_fail(expected_message.chomp) do
           assert_compare(10, ">", 15)
         end
 
@@ -1100,7 +1100,7 @@ EOM
 <10> expected greater than or equal to
 <15>.
 EOM
-        check_fails(expected_message.chomp) do
+        check_fail(expected_message.chomp) do
           assert_compare(10, ">=", 15)
         end
       end
@@ -1112,7 +1112,7 @@ EOM
           end
         end
 
-        check_fails("Failed assertion was expected.") do
+        check_fail("Failed assertion was expected.") do
           assert_fail_assertion do
           end
         end
@@ -1141,7 +1141,7 @@ EOM
 <"Expected message"> exception message expected but was
 <"Actual message">.
 EOM
-        check_fails(expected_message.chomp) do
+        check_fail(expected_message.chomp) do
           assert_raise_message("Expected message") do
             raise "Actual message"
           end
@@ -1150,7 +1150,7 @@ EOM
         expected_message = <<-EOM
 <"Expected message"> exception message expected but none was thrown.
 EOM
-        check_fails(expected_message.chomp) do
+        check_fail(expected_message.chomp) do
           assert_raise_message("Expected message") do
           end
         end
@@ -1168,7 +1168,7 @@ EOM
 Class: <RuntimeError>
 Message: <XXX>
 EOM
-        check_fails_exception(expected_message) do
+        check_fail_exception(expected_message) do
           assert_raise_kind_of(SystemCallError) do
             raise RuntimeError, "XXX"
           end
@@ -1184,7 +1184,7 @@ EOM
           assert_const_defined(Test, "Unit")
         end
 
-        check_fails("<Test>.const_defined?(<:Nonexistence>) expected.") do
+        check_fail("<Test>.const_defined?(<:Nonexistence>) expected.") do
           assert_const_defined(Test, :Nonexistence)
         end
       end
@@ -1194,11 +1194,11 @@ EOM
           assert_not_const_defined(Test, :Nonexistence)
         end
 
-        check_fails("!<Test>.const_defined?(<:Unit>) expected.") do
+        check_fail("!<Test>.const_defined?(<:Unit>) expected.") do
           assert_not_const_defined(Test, :Unit)
         end
 
-        check_fails("!<Test>.const_defined?(<\"Unit\">) expected.") do
+        check_fail("!<Test>.const_defined?(<\"Unit\">) expected.") do
           assert_not_const_defined(Test, "Unit")
         end
       end
@@ -1208,11 +1208,11 @@ EOM
           assert_predicate([], :empty?)
         end
 
-        check_fails("<[1]>.empty? is true value expected but was\n<false>") do
+        check_fail("<[1]>.empty? is true value expected but was\n<false>") do
           assert_predicate([1], :empty?)
         end
 
-        check_fails("<[1]>.respond_to?(:nonexistent?) expected\n" +
+        check_fail("<[1]>.respond_to?(:nonexistent?) expected\n" +
                     "(Class: <Array>)") do
           assert_predicate([1], :nonexistent?)
         end
@@ -1223,11 +1223,11 @@ EOM
           assert_not_predicate([1], :empty?)
         end
 
-        check_fails("<[]>.empty? is false value expected but was\n<true>") do
+        check_fail("<[]>.empty? is false value expected but was\n<true>") do
           assert_not_predicate([], :empty?)
         end
 
-        check_fails("<[]>.respond_to?(:nonexistent?) expected\n" +
+        check_fail("<[]>.respond_to?(:nonexistent?) expected\n" +
                     "(Class: <Array>)") do
           assert_not_predicate([], :nonexistent?)
         end
@@ -1252,18 +1252,18 @@ EOM
           assert_alias_method(object, :original_method, :alias_method)
         end
 
-        check_fails("<#{object.method(:other).inspect}> is alias of\n" +
+        check_fail("<#{object.method(:other).inspect}> is alias of\n" +
                     "<#{object.method(:original_method).inspect}> expected") do
           assert_alias_method(object, :other, :original_method)
         end
 
         inspected_object = AssertionMessage.convert(object)
-        check_fails("<#{inspected_object}>.nonexistent doesn't exist\n" +
+        check_fail("<#{inspected_object}>.nonexistent doesn't exist\n" +
                     "(Class: <Object>)") do
           assert_alias_method(object, :nonexistent, :original_method)
         end
 
-        check_fails("<#{inspected_object}>.nonexistent doesn't exist\n" +
+        check_fail("<#{inspected_object}>.nonexistent doesn't exist\n" +
                     "(Class: <Object>)") do
           assert_alias_method(object, :alias_method, :nonexistent)
         end
@@ -1275,7 +1275,7 @@ EOM
         end
 
         nonexistent_file = __FILE__ + ".nonexistent"
-        check_fails("<#{nonexistent_file.inspect}> expected to exist") do
+        check_fail("<#{nonexistent_file.inspect}> expected to exist") do
           assert_path_exist(nonexistent_file)
         end
       end
@@ -1286,7 +1286,7 @@ EOM
           assert_path_not_exist(nonexistent_file)
         end
 
-        check_fails("<#{__FILE__.inspect}> expected to not exist") do
+        check_fail("<#{__FILE__.inspect}> expected to not exist") do
           assert_path_not_exist(__FILE__)
         end
       end
@@ -1314,26 +1314,26 @@ EOM
       end
 
       def test_fail_nil
-        check_fails("<nil> is not true.") do
+        check_fail("<nil> is not true.") do
           assert(nil)
         end
       end
 
       def test_fail_false
-        check_fails("<false> is not true.") do
+        check_fail("<false> is not true.") do
           assert(false)
         end
       end
 
       def test_fail_false_with_message
-        check_fails("failed assert.\n" +
+        check_fail("failed assert.\n" +
                     "<false> is not true.") do
           assert(false, "failed assert")
         end
       end
 
       def test_fail_with_assertion_message
-        check_fails("user message.\n" +
+        check_fail("user message.\n" +
                     "placeholder <:in> message") do
           assert(false, build_message("user message",
                                       "placeholder <?> message",
@@ -1342,7 +1342,7 @@ EOM
       end
 
       def test_error_invalid_message_true
-        check_fails("assertion message must be String, Proc or " +
+        check_fail("assertion message must be String, Proc or " +
                     "Test::Unit::Assertions::AssertionMessage: " +
                     "<true>(<TrueClass>)") do
           begin
@@ -1392,7 +1392,7 @@ EOM
       end
 
       def test_fail_with_message
-        check_fails("message.\n" +
+        check_fail("message.\n" +
                     "<0.5> -/+ <0.05> expected to include\n" +
                     "<0.4>.\n" +
                     "\n" +
@@ -1405,7 +1405,7 @@ EOM
       def test_fail_because_not_float_like_object
         object = Object.new
         inspected_object = AssertionMessage.convert(object)
-        check_fails("The arguments must respond to to_f; " +
+        check_fail("The arguments must respond to to_f; " +
                     "the first float did not.\n" +
                     "<#{inspected_object}>.respond_to?(:to_f) expected\n" +
                     "(Class: <Object>)") do
@@ -1414,14 +1414,14 @@ EOM
       end
 
       def test_fail_because_negaitve_delta
-        check_fails("The delta should not be negative.\n" +
+        check_fail("The delta should not be negative.\n" +
                     "<-0.1> expected to be\n>=\n<0.0>.") do
           assert_in_delta(0.5, 0.4, -0.1, "message")
         end
       end
 
       def test_fail_without_delta
-        check_fails("<1.402> -/+ <0.001> expected to include\n" +
+        check_fail("<1.402> -/+ <0.001> expected to include\n" +
                     "<1.404>.\n" +
                     "\n" +
                     "Relation:\n" +
@@ -1473,7 +1473,7 @@ EOM
       end
 
       def test_fail
-        check_fails("<1.4> -/+ <0.11> expected to not include\n" +
+        check_fail("<1.4> -/+ <0.11> expected to not include\n" +
                     "<1.5>.\n" +
                     "\n" +
                     "Relation:\n" +
@@ -1487,7 +1487,7 @@ EOM
       end
 
       def test_fail_without_delta
-        check_fails("<1.402> -/+ <0.001> expected to not include\n" +
+        check_fail("<1.402> -/+ <0.001> expected to not include\n" +
                     "<1.4021>.\n" +
                     "\n" +
                     "Relation:\n" +
@@ -1501,7 +1501,7 @@ EOM
       end
 
       def test_fail_with_message
-        check_fails("message.\n" +
+        check_fail("message.\n" +
                     "<0.5> -/+ <0.11> expected to not include\n" +
                     "<0.4>.\n" +
                     "\n" +
@@ -1518,7 +1518,7 @@ EOM
       def test_fail_because_not_float_like_object
         object = Object.new
         inspected_object = AssertionMessage.convert(object)
-        check_fails("The arguments must respond to to_f; " +
+        check_fail("The arguments must respond to to_f; " +
                     "the first float did not.\n" +
                     "<#{inspected_object}>.respond_to?(:to_f) expected\n" +
                     "(Class: <Object>)") do
@@ -1527,7 +1527,7 @@ EOM
       end
 
       def test_fail_because_negaitve_delta
-        check_fails("The delta should not be negative.\n" +
+        check_fail("The delta should not be negative.\n" +
                     "<-0.11> expected to be\n>=\n<0.0>.") do
           assert_not_in_delta(0.5, 0.4, -0.11, "message")
         end
@@ -1578,7 +1578,7 @@ EOM
       end
 
       def test_fail_with_message
-        check_fails("message.\n" +
+        check_fail("message.\n" +
                     "<10000> -/+ (<10000> * <0.1>)[1000.0] " +
                     "expected to include\n" +
                     "<8999>.\n" +
@@ -1596,7 +1596,7 @@ EOM
       def test_fail_because_not_float_like_object
         object = Object.new
         inspected_object = AssertionMessage.convert(object)
-        check_fails("The arguments must respond to to_f; " +
+        check_fail("The arguments must respond to to_f; " +
                     "the first float did not.\n" +
                     "<#{inspected_object}>.respond_to?(:to_f) expected\n" +
                     "(Class: <Object>)") do
@@ -1605,14 +1605,14 @@ EOM
       end
 
       def test_fail_because_negaitve_epsilon
-        check_fails("The epsilon should not be negative.\n" +
+        check_fail("The epsilon should not be negative.\n" +
                     "<-0.1> expected to be\n>=\n<0.0>.") do
           assert_in_epsilon(10000, 9000, -0.1, "message")
         end
       end
 
       def test_fail_without_epsilon
-        check_fails("<10000> -/+ (<10000> * <0.001>)[10.0] " +
+        check_fail("<10000> -/+ (<10000> * <0.001>)[10.0] " +
                     "expected to include\n" +
                     "<10011>.\n" +
                     "\n" +
@@ -1665,7 +1665,7 @@ EOM
       end
 
       def test_fail
-        check_fails("<10000> -/+ (<10000> * <0.1>)[1000.0] " +
+        check_fail("<10000> -/+ (<10000> * <0.1>)[1000.0] " +
                     "expected to not include\n" +
                     "<9000>.\n" +
                     "\n" +
@@ -1680,7 +1680,7 @@ EOM
       end
 
       def test_fail_without_epsilon
-        check_fails("<10000> -/+ (<10000> * <0.001>)[10.0] " +
+        check_fail("<10000> -/+ (<10000> * <0.001>)[10.0] " +
                     "expected to not include\n" +
                     "<9990>.\n" +
                     "\n" +
@@ -1695,7 +1695,7 @@ EOM
       end
 
       def test_fail_with_message
-        check_fails("message.\n" +
+        check_fail("message.\n" +
                     "<10000> -/+ (<10000> * <0.1>)[1000.0] " +
                     "expected to not include\n" +
                     "<9000>.\n" +
@@ -1713,7 +1713,7 @@ EOM
       def test_fail_because_not_float_like_object
         object = Object.new
         inspected_object = AssertionMessage.convert(object)
-        check_fails("The arguments must respond to to_f; " +
+        check_fail("The arguments must respond to to_f; " +
                     "the first float did not.\n" +
                     "<#{inspected_object}>.respond_to?(:to_f) expected\n" +
                     "(Class: <Object>)") do
@@ -1722,7 +1722,7 @@ EOM
       end
 
       def test_fail_because_negaitve_epsilon
-        check_fails("The epsilon should not be negative.\n" +
+        check_fail("The epsilon should not be negative.\n" +
                     "<-0.1> expected to be\n>=\n<0.0>.") do
           assert_not_in_epsilon(10000, 9000, -0.1, "message")
         end
@@ -1745,14 +1745,14 @@ EOM
       end
 
       def test_fail
-        check_fails("<[1, 2, 3]> expected to include\n" +
+        check_fail("<[1, 2, 3]> expected to include\n" +
                     "<4>.") do
           assert_include([1, 2, 3], 4)
         end
       end
 
       def test_fail_with_message
-        check_fails("message.\n" +
+        check_fail("message.\n" +
                     "<[1, 2, 3]> expected to include\n" +
                     "<4>.") do
           assert_include([1, 2, 3], 4, "message")
@@ -1762,7 +1762,7 @@ EOM
       def test_fail_because_not_collection_like_object
         object = Object.new
         inspected_object = AssertionMessage.convert(object)
-        check_fails("The collection must respond to :include?.\n" +
+        check_fail("The collection must respond to :include?.\n" +
                     "<#{inspected_object}>.respond_to?(:include?) expected\n" +
                     "(Class: <Object>)") do
           assert_include(object, 1)
@@ -1786,14 +1786,14 @@ EOM
       end
 
       def test_fail
-        check_fails("<[1, 2, 3]> expected to not include\n" +
+        check_fail("<[1, 2, 3]> expected to not include\n" +
                     "<2>.") do
           assert_not_include([1, 2, 3], 2)
         end
       end
 
       def test_fail_with_message
-        check_fails("message.\n" +
+        check_fail("message.\n" +
                     "<[1, 2, 3]> expected to not include\n" +
                     "<2>.") do
           assert_not_include([1, 2, 3], 2, "message")
@@ -1803,7 +1803,7 @@ EOM
       def test_fail_because_not_collection_like_object
         object = Object.new
         inspected_object = AssertionMessage.convert(object)
-        check_fails("The collection must respond to :include?.\n" +
+        check_fail("The collection must respond to :include?.\n" +
                     "<#{inspected_object}>.respond_to?(:include?) expected\n" +
                     "(Class: <Object>)") do
           assert_not_include(object, 1)
@@ -1827,13 +1827,13 @@ EOM
       end
 
       def test_fail
-        check_fails("<[1]> expected to be empty.") do
+        check_fail("<[1]> expected to be empty.") do
           assert_empty([1])
         end
       end
 
       def test_fail_with_message
-        check_fails("message.\n" +
+        check_fail("message.\n" +
                     "<[1]> expected to be empty.") do
           assert_empty([1], "message")
         end
@@ -1842,7 +1842,7 @@ EOM
       def test_fail_because_no_empty_method
         object = Object.new
         inspected_object = AssertionMessage.convert(object)
-        check_fails("The object must respond to :empty?.\n" +
+        check_fail("The object must respond to :empty?.\n" +
                     "<#{inspected_object}>.respond_to?(:empty?) expected\n" +
                     "(Class: <Object>)") do
           assert_empty(object)
@@ -1866,13 +1866,13 @@ EOM
       end
 
       def test_fail
-        check_fails("<[]> expected to not be empty.") do
+        check_fail("<[]> expected to not be empty.") do
           assert_not_empty([])
         end
       end
 
       def test_fail_with_message
-        check_fails("message.\n" +
+        check_fail("message.\n" +
                     "<[]> expected to not be empty.") do
           assert_not_empty([], "message")
         end
@@ -1881,7 +1881,7 @@ EOM
       def test_fail_because_no_empty_method
         object = Object.new
         inspected_object = AssertionMessage.convert(object)
-        check_fails("The object must respond to :empty?.\n" +
+        check_fail("The object must respond to :empty?.\n" +
                     "<#{inspected_object}>.respond_to?(:empty?) expected\n" +
                     "(Class: <Object>)") do
           assert_not_empty(object)
@@ -1905,7 +1905,7 @@ message.
 <member?(*[2])> with not a true value but was
 <true>.
 EOM
-        check_fails(expected_message.chomp) do
+        check_fail(expected_message.chomp) do
           assert_not_send([[1, 2], :member?, 2], "message")
         end
       end



test-unit-commit メーリングリストの案内