From null+test-unit ¡÷ clear-code.com Mon Sep 3 07:29:17 2012 From: null+test-unit ¡÷ clear-code.com (Kouhei Sutou) Date: Mon, 03 Sep 2012 16:29:17 +0900 Subject: [test-unit-commit:00433] test-unit/test-unit [master] Support diff for invalid encoding Message-ID: <20120903072932.38827940C17@jenkins.clear-code.com> Kouhei Sutou 2012-09-03 16:29:17 +0900 (Mon, 03 Sep 2012) New Revision: 714c47e256ea7ceea99c124659b4acc17f1719d9 https://github.com/test-unit/test-unit/commit/714c47e256ea7ceea99c124659b4acc17f1719d9 Log: Support diff for invalid encoding Modified files: lib/test/unit/diff.rb lib/test/unit/ui/console/testrunner.rb Modified: lib/test/unit/diff.rb (+6 -0) =================================================================== --- lib/test/unit/diff.rb 2012-08-29 11:58:22 +0900 (121d19a) +++ lib/test/unit/diff.rb 2012-09-03 16:29:17 +0900 (3810a21) @@ -723,6 +723,12 @@ module Test end def diff(differ_class, from, to, options={}) + if from.respond_to?(:valid_encoding?) and not from.valid_encoding? + from = from.dup.force_encoding("ASCII-8BIT") + end + if to.respond_to?(:valid_encoding?) and not to.valid_encoding? + to = to.dup.force_encoding("ASCII-8BIT") + end differ = differ_class.new(from.split(/\r?\n/), to.split(/\r?\n/)) lines = differ.diff(options) if Object.const_defined?(:EncodingError) Modified: lib/test/unit/ui/console/testrunner.rb (+8 -0) =================================================================== --- lib/test/unit/ui/console/testrunner.rb 2012-08-29 11:58:22 +0900 (092e2e0) +++ lib/test/unit/ui/console/testrunner.rb 2012-09-03 16:29:17 +0900 (17dc749) @@ -268,6 +268,14 @@ module Test output("") from, to = prepare_for_diff(failure.expected, failure.actual) if from and to + if need_encoding + unless from.valid_encoding? + from = from.dup.force_encoding("ASCII-8BIT") + end + unless to.valid_encoding? + to = to.dup.force_encoding("ASCII-8BIT") + end + end from_lines = from.split(/\r?\n/) to_lines = to.split(/\r?\n/) if need_encoding -------------- next part -------------- HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B... URL: From null+test-unit ¡÷ clear-code.com Fri Sep 28 12:18:47 2012 From: null+test-unit ¡÷ clear-code.com (Kouhei Sutou) Date: Fri, 28 Sep 2012 21:18:47 +0900 Subject: [test-unit-commit:00434] test-unit/test-unit [master] Fix comment for assert_raises Message-ID: <20120928121857.66C2C94027A@jenkins.clear-code.com> Kouhei Sutou 2012-09-28 21:18:47 +0900 (Fri, 28 Sep 2012) New Revision: 0ddf90bee389fd682e89f6f11eb3dec299f15fcb https://github.com/test-unit/test-unit/commit/0ddf90bee389fd682e89f6f11eb3dec299f15fcb Log: Fix comment for assert_raises Modified files: lib/test/unit/assertions.rb Modified: lib/test/unit/assertions.rb (+2 -2) =================================================================== --- lib/test/unit/assertions.rb 2012-09-03 16:29:17 +0900 (2827e61) +++ lib/test/unit/assertions.rb 2012-09-28 21:18:47 +0900 (7ccb5be) @@ -1,6 +1,6 @@ # Author:: Nathaniel Talbott. # Copyright:: Copyright (c) 2000-2003 Nathaniel Talbott. All rights reserved. -# Copyright (c) 2009-2010 Kouhei Sutou. All rights reserved. +# Copyright (c) 2009-2012 Kouhei Sutou. All rights reserved. # License:: Ruby license. require 'test/unit/assertionfailederror' @@ -166,7 +166,7 @@ EOT ## # Alias of assert_raise. # - # Will be deprecated in 1.9, and removed in 2.0. + # It is just for compatibility with minitest. public def assert_raises(*args, &block) -------------- next part -------------- HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B... URL: From null+test-unit ¡÷ clear-code.com Fri Sep 28 12:30:44 2012 From: null+test-unit ¡÷ clear-code.com (Kouhei Sutou) Date: Fri, 28 Sep 2012 21:30:44 +0900 Subject: [test-unit-commit:00435] test-unit/test-unit [master] Use .yardopts instead of YardocTask Message-ID: <20120928123056.9A49F94027A@jenkins.clear-code.com> Kouhei Sutou 2012-09-28 21:30:44 +0900 (Fri, 28 Sep 2012) New Revision: 2c848633b3b5013ca25fb0ecdd8f5ffdcdd44c8f https://github.com/test-unit/test-unit/commit/2c848633b3b5013ca25fb0ecdd8f5ffdcdd44c8f Log: Use .yardopts instead of YardocTask Added files: .yardopts Modified files: Rakefile Added: .yardopts (+7 -0) 100644 =================================================================== --- /dev/null +++ .yardopts 2012-09-28 21:30:44 +0900 (d73962a) @@ -0,0 +1,7 @@ +--title test-unit +--readme README.textile +--files doc/text/**/* +--output-dir doc/reference/en +--charset utf-8 +--use-cache +lib/**/*.rb Modified: Rakefile (+0 -7) =================================================================== --- Rakefile 2012-09-28 21:18:47 +0900 (2fdb889) +++ Rakefile 2012-09-28 21:30:44 +0900 (dc1081f) @@ -22,13 +22,6 @@ doc_en_dir = reference_base_dir + "en" html_base_dir = Pathname.new("doc/html") html_reference_dir = html_base_dir + spec.name YARD::Rake::YardocTask.new do |task| - task.options += ["--title", spec.name] - # task.options += ["--charset", "UTF-8"] - task.options += ["--readme", "README.textile"] - task.options += ["--files", "doc/text/**/*"] - task.options += ["--output-dir", doc_en_dir.to_s] - task.options += ["--charset", "utf-8"] - task.files += FileList["lib/**/*.rb"] end task :yard do -------------- next part -------------- HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B... URL: From null+test-unit ¡÷ clear-code.com Fri Sep 28 12:31:30 2012 From: null+test-unit ¡÷ clear-code.com (Kouhei Sutou) Date: Fri, 28 Sep 2012 21:31:30 +0900 Subject: [test-unit-commit:00436] test-unit/test-unit [master] Remove needless option Message-ID: <20120928123143.5DC3494027A@jenkins.clear-code.com> Kouhei Sutou 2012-09-28 21:31:30 +0900 (Fri, 28 Sep 2012) New Revision: 93b1d49fa6fc164e7504a6e92690de4e98ba4dce https://github.com/test-unit/test-unit/commit/93b1d49fa6fc164e7504a6e92690de4e98ba4dce Log: Remove needless option Modified files: .yardopts Modified: .yardopts (+0 -1) =================================================================== --- .yardopts 2012-09-28 21:30:44 +0900 (d73962a) +++ .yardopts 2012-09-28 21:31:30 +0900 (68f127b) @@ -4,4 +4,3 @@ --output-dir doc/reference/en --charset utf-8 --use-cache -lib/**/*.rb -------------- next part -------------- HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B... URL: From null+test-unit ¡÷ clear-code.com Fri Sep 28 12:32:37 2012 From: null+test-unit ¡÷ clear-code.com (Kouhei Sutou) Date: Fri, 28 Sep 2012 21:32:37 +0900 Subject: [test-unit-commit:00437] test-unit/test-unit [master] Add assert_includes for minitest compatibility :< Message-ID: <20120928123250.E11BC94027A@jenkins.clear-code.com> Kouhei Sutou 2012-09-28 21:32:37 +0900 (Fri, 28 Sep 2012) New Revision: 6963ba58c6bd8225fa4a4a89b5e3c40864784e03 https://github.com/test-unit/test-unit/commit/6963ba58c6bd8225fa4a4a89b5e3c40864784e03 Log: Add assert_includes for minitest compatibility :< GitHub: fix #40 Suggested by Michael Grosser. Thanks!!! Modified files: lib/test/unit/assertions.rb Modified: lib/test/unit/assertions.rb (+7 -0) =================================================================== --- lib/test/unit/assertions.rb 2012-09-28 21:31:30 +0900 (7ccb5be) +++ lib/test/unit/assertions.rb 2012-09-28 21:32:37 +0900 (6782cf7) @@ -1285,6 +1285,13 @@ EOT end end + # @note This is an alias of {#assert_include}. This is just for + # compatibility with minitest. If you are test-unit user, use + # {#assert_include} instead. + # + # @since 2.5.3 + alias_method :assert_includes, :assert_include + ## # Passes if +collection+ doesn't include +object+. # -------------- next part -------------- HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B... URL: From null+test-unit ¡÷ clear-code.com Fri Sep 28 12:33:55 2012 From: null+test-unit ¡÷ clear-code.com (Kouhei Sutou) Date: Fri, 28 Sep 2012 21:33:55 +0900 Subject: [test-unit-commit:00438] test-unit/test-unit [master] Use alias_method Message-ID: <20120928123407.9D4C194027A@jenkins.clear-code.com> Kouhei Sutou 2012-09-28 21:33:55 +0900 (Fri, 28 Sep 2012) New Revision: d8e1b1e7953262f8d3205361c028fd94335fd834 https://github.com/test-unit/test-unit/commit/d8e1b1e7953262f8d3205361c028fd94335fd834 Log: Use alias_method Modified files: lib/test/unit/assertions.rb Modified: lib/test/unit/assertions.rb (+4 -9) =================================================================== --- lib/test/unit/assertions.rb 2012-09-28 21:32:37 +0900 (6782cf7) +++ lib/test/unit/assertions.rb 2012-09-28 21:33:55 +0900 (c61494d) @@ -163,15 +163,10 @@ EOT _assert_raise(assert_expected_exception, *args, &block) end - ## - # Alias of assert_raise. - # - # It is just for compatibility with minitest. - - public - def assert_raises(*args, &block) - assert_raise(*args, &block) - end + # @note This is an alias of {#assert_raise}. This is just for + # compatibility with minitest. If you are test-unit user, use + # {#assert_raise} instead. + alias_method :assert_raises, :assert_raise ## # Passes if the block raises one of the given -------------- next part -------------- HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B... URL: From null+test-unit ¡÷ clear-code.com Fri Sep 28 12:39:18 2012 From: null+test-unit ¡÷ clear-code.com (Kouhei Sutou) Date: Fri, 28 Sep 2012 21:39:18 +0900 Subject: [test-unit-commit:00439] test-unit/test-unit [master] Use simple comment Message-ID: <20120928123933.85A8F94027A@jenkins.clear-code.com> Kouhei Sutou 2012-09-28 21:39:18 +0900 (Fri, 28 Sep 2012) New Revision: 2b4f2e232c053eecd2951c4cb2924922533a9700 https://github.com/test-unit/test-unit/commit/2b4f2e232c053eecd2951c4cb2924922533a9700 Log: Use simple comment Because comment for alias_method isn't shown in documentation generated by YARD. Modified files: lib/test/unit/assertions.rb Modified: lib/test/unit/assertions.rb (+2 -6) =================================================================== --- lib/test/unit/assertions.rb 2012-09-28 21:33:55 +0900 (c61494d) +++ lib/test/unit/assertions.rb 2012-09-28 21:39:18 +0900 (8606ed8) @@ -163,9 +163,7 @@ EOT _assert_raise(assert_expected_exception, *args, &block) end - # @note This is an alias of {#assert_raise}. This is just for - # compatibility with minitest. If you are test-unit user, use - # {#assert_raise} instead. + # Just for minitest compatibility. :< alias_method :assert_raises, :assert_raise ## @@ -1280,9 +1278,7 @@ EOT end end - # @note This is an alias of {#assert_include}. This is just for - # compatibility with minitest. If you are test-unit user, use - # {#assert_include} instead. + # Just for minitest compatibility. :< # # @since 2.5.3 alias_method :assert_includes, :assert_include -------------- next part -------------- HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B... URL: From null+test-unit ¡÷ clear-code.com Fri Sep 28 12:44:08 2012 From: null+test-unit ¡÷ clear-code.com (Kouhei Sutou) Date: Fri, 28 Sep 2012 21:44:08 +0900 Subject: [test-unit-commit:00440] test-unit/test-unit [master] Add refute_* aliases for minitest compatibility :< Message-ID: <20120928124418.A195B94027A@jenkins.clear-code.com> Kouhei Sutou 2012-09-28 21:44:08 +0900 (Fri, 28 Sep 2012) New Revision: feadacf9d93796dfbfc2b6332e6d1da5b5ea6b12 https://github.com/test-unit/test-unit/commit/feadacf9d93796dfbfc2b6332e6d1da5b5ea6b12 Log: Add refute_* aliases for minitest compatibility :< GitHub: fix #40 Suggested by Michael Grosser. Thanks!!! Modified files: lib/test/unit/assertions.rb Modified: lib/test/unit/assertions.rb (+30 -0) =================================================================== --- lib/test/unit/assertions.rb 2012-09-28 21:39:18 +0900 (8606ed8) +++ lib/test/unit/assertions.rb 2012-09-28 21:44:08 +0900 (a32be52) @@ -337,6 +337,11 @@ EOT end end + # Just for minitest compatibility. :< + # + # @since 2.5.3 + alias_method :refute_respond_to, :assert_not_respond_to + ## # Passes if +string+ =~ +pattern+. # @@ -459,6 +464,11 @@ EOT assert_block(full_message) { !actual.equal?(expected) } end + # Just for minitest compatibility. :< + # + # @since 2.5.3 + alias_method :refute_same, :assert_not_same + ## # Passes if +expected+ != +actual+ # @@ -471,6 +481,11 @@ EOT assert_block(full_message) { expected != actual } end + # Just for minitest compatibility. :< + # + # @since 2.5.3 + alias_method :refute_equal, :assert_not_equal + ## # Passes if ! +object+ .nil? # @@ -483,6 +498,11 @@ EOT assert_block(full_message){!object.nil?} end + # Just for minitest compatibility. :< + # + # @since 2.5.3 + alias_method :refute_nil, :assert_not_nil + ## # Passes if +regexp+ !~ +string+ # @@ -503,6 +523,11 @@ EOT end end + # Just for minitest compatibility. :< + # + # @since 2.5.3 + alias_method :refute_match, :assert_not_match + ## # Deprecated. Use #assert_not_match instead. # @@ -654,6 +679,11 @@ EOT end end + # Just for minitest compatibility. :< + # + # @since 2.5.3 + alias_method :refute_in_delta, :assert_not_in_delta + # :stopdoc: private def _assert_in_delta_validate_arguments(expected_float, -------------- next part -------------- HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B... URL: From null+test-unit ¡÷ clear-code.com Fri Sep 28 12:44:45 2012 From: null+test-unit ¡÷ clear-code.com (Kouhei Sutou) Date: Fri, 28 Sep 2012 21:44:45 +0900 Subject: [test-unit-commit:00441] test-unit/test-unit [master] Use alias_method Message-ID: <20120928124455.8E96394027A@jenkins.clear-code.com> Kouhei Sutou 2012-09-28 21:44:45 +0900 (Fri, 28 Sep 2012) New Revision: 54c8736bd4b152e375058db93e39cbee50c1cb2e https://github.com/test-unit/test-unit/commit/54c8736bd4b152e375058db93e39cbee50c1cb2e Log: Use alias_method Modified files: lib/test/unit/assertions.rb Modified: lib/test/unit/assertions.rb (+3 -6) =================================================================== --- lib/test/unit/assertions.rb 2012-09-28 21:44:08 +0900 (a32be52) +++ lib/test/unit/assertions.rb 2012-09-28 21:44:45 +0900 (890d281) @@ -596,13 +596,10 @@ EOT end end - ## - # Alias of assert_throw. + # Just for minitest compatibility. :< # - # Will be deprecated in 1.9, and removed in 2.0. - def assert_throws(*args, &block) - assert_throw(*args, &block) - end + # @since 2.5.3 + alias_method :assert_throws, :assert_throw ## # Passes if block does not throw anything. -------------- next part -------------- HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B... URL: