From null+test-unit @ clear-code.com Sun Sep 4 09:45:13 2011 From: null+test-unit @ clear-code.com (null+test-unit @ clear-code.com) Date: Sun, 04 Sep 2011 13:45:13 +0000 Subject: [test-unit-commit:00100] test-unit/test-unit [master] [console] add missing the last newline for progress level. Message-ID: <20110904134825.4A9972C4647@taiyaki.ru> Kouhei Sutou 2011-09-04 13:45:13 +0000 (Sun, 04 Sep 2011) New Revision: f00483abc2d0372b592012b60a2609740b85b607 Log: [console] add missing the last newline for progress level. Modified files: lib/test/unit/ui/console/testrunner.rb Modified: lib/test/unit/ui/console/testrunner.rb (+1 -1) =================================================================== --- lib/test/unit/ui/console/testrunner.rb 2011-08-28 02:35:39 +0000 (ebe69a2) +++ lib/test/unit/ui/console/testrunner.rb 2011-09-04 13:45:13 +0000 (8b66dbd) @@ -100,7 +100,7 @@ module Test def finished(elapsed_time) nl if output?(NORMAL) and !output?(VERBOSE) output_faults unless @show_detail_immediately - nl(IMPORTANT_FAULTS_ONLY) + nl(PROGRESS_ONLY) change_output_level(IMPORTANT_FAULTS_ONLY) do output_statistics(elapsed_time) end From null+test-unit @ clear-code.com Sun Sep 4 10:01:56 2011 From: null+test-unit @ clear-code.com (null+test-unit @ clear-code.com) Date: Sun, 04 Sep 2011 14:01:56 +0000 Subject: [test-unit-commit:00101] test-unit/test-unit [master] support correct backtrace for redefined notification. Message-ID: <20110904140502.D59412C466D@taiyaki.ru> Kouhei Sutou 2011-09-04 14:01:56 +0000 (Sun, 04 Sep 2011) New Revision: 9360c928aed6f42bdacb6ef4ea816d86a210d738 Log: support correct backtrace for redefined notification. Modified files: lib/test/unit/notification.rb lib/test/unit/testcase.rb Modified: lib/test/unit/notification.rb (+6 -2) =================================================================== --- lib/test/unit/notification.rb 2011-09-04 14:01:30 +0000 (a0946fb) +++ lib/test/unit/notification.rb 2011-09-04 14:01:56 +0000 (685fc8d) @@ -69,8 +69,12 @@ module Test # notify("Special!") if special_case? # # Reached here too # end - def notify(message, &block) - notification = Notification.new(name, filter_backtrace(caller), message) + # + # options: + # :backtrace override backtrace. + def notify(message, options={} &block) + backtrace = filter_backtrace(options[:backtrace] || caller) + notification = Notification.new(name, backtrace, message) add_notification(notification) end Modified: lib/test/unit/testcase.rb (+5 -3) =================================================================== --- lib/test/unit/testcase.rb 2011-09-04 14:01:30 +0000 (51e8b78) +++ lib/test/unit/testcase.rb 2011-09-04 14:01:56 +0000 (6b09f60) @@ -113,7 +113,7 @@ module Test _added_methods = added_methods stringified_name = name.to_s if _added_methods.include?(stringified_name) - attribute(:redefined, true, {}, stringified_name) + attribute(:redefined, {:backtrace => caller}, {}, stringified_name) end _added_methods << stringified_name end @@ -520,8 +520,10 @@ module Test end def run_test - if self[:redefined] - notify("#{self.class}\##{@method_name} was redefined") + redefined_info = self[:redefined] + if redefined_info + notify("#{self.class}\##{@method_name} was redefined", + :backtrace => redefined_info[:backtrace]) end if @internal_data.have_test_data? __send__(@method_name, @internal_data.test_data) From null+test-unit @ clear-code.com Sun Sep 4 10:01:30 2011 From: null+test-unit @ clear-code.com (null+test-unit @ clear-code.com) Date: Sun, 04 Sep 2011 14:01:30 +0000 Subject: [test-unit-commit:00102] test-unit/test-unit [master] [console] support notification in show-detail-immediately. Message-ID: <20110904140502.CB6E52C466B@taiyaki.ru> Kouhei Sutou 2011-09-04 14:01:30 +0000 (Sun, 04 Sep 2011) New Revision: 0c4dc64f4b6353d654460e8d3d336c91e8aab14e Log: [console] support notification in show-detail-immediately. Modified files: lib/test/unit/ui/console/testrunner.rb Modified: lib/test/unit/ui/console/testrunner.rb (+14 -7) =================================================================== --- lib/test/unit/ui/console/testrunner.rb 2011-09-04 13:45:13 +0000 (8b66dbd) +++ lib/test/unit/ui/console/testrunner.rb 2011-09-04 14:01:30 +0000 (e1ad410) @@ -127,7 +127,7 @@ module Test faults.each_with_index do |fault, index| nl output_single("%#{digit}d) " % (index + 1)) - output_fault(fault) + output_fault_in_detail(fault) end end @@ -139,9 +139,7 @@ module Test output(":") faults.each_with_index do |fault, index| output_single("%#{digit}d) " % (index + 1)) - output_single(fault.message, fault_color(fault)) - output(" [#{fault.test_name}]") - output(fault.location.first) + output_fault_in_short(fault) end end @@ -166,7 +164,7 @@ module Test end end - def output_fault(fault) + def output_fault_in_detail(fault) if @use_color and fault.is_a?(Failure) and fault.inspected_expected and fault.inspected_actual output_single(fault.label, fault_color(fault)) @@ -250,6 +248,12 @@ module Test end end + def output_fault_in_short(fault) + output_single(fault.message, fault_color(fault)) + output(" [#{fault.test_name}]") + output(fault.location.first) + end + def format_fault(fault) fault.long_display end @@ -358,10 +362,13 @@ module Test def output_progress_in_detail(fault) return if @output_level == SILENT - return unless categorize_fault(fault) == :need_detail_faults nl nl - output_fault(fault) + if categorize_fault(fault) == :need_detail_faults + output_fault_in_detail(fault) + else + output_fault_in_short(fault) + end nl end From null+test-unit @ clear-code.com Fri Sep 9 23:06:30 2011 From: null+test-unit @ clear-code.com (null+test-unit @ clear-code.com) Date: Sat, 10 Sep 2011 03:06:30 +0000 Subject: [test-unit-commit:00103] test-unit/test-unit [master] add missing ', '. Message-ID: <20110910031127.D55222C4112@taiyaki.ru> Kouhei Sutou 2011-09-10 03:06:30 +0000 (Sat, 10 Sep 2011) New Revision: ba101c9687ca877def5f1891caf33a2b8d711fae Log: add missing ','. Modified files: lib/test/unit/notification.rb Modified: lib/test/unit/notification.rb (+1 -1) =================================================================== --- lib/test/unit/notification.rb 2011-09-04 14:01:56 +0000 (685fc8d) +++ lib/test/unit/notification.rb 2011-09-10 03:06:30 +0000 (e91deff) @@ -72,7 +72,7 @@ module Test # # options: # :backtrace override backtrace. - def notify(message, options={} &block) + def notify(message, options={}, &block) backtrace = filter_backtrace(options[:backtrace] || caller) notification = Notification.new(name, backtrace, message) add_notification(notification) From null+test-unit @ clear-code.com Fri Sep 9 23:08:08 2011 From: null+test-unit @ clear-code.com (null+test-unit @ clear-code.com) Date: Sat, 10 Sep 2011 03:08:08 +0000 Subject: [test-unit-commit:00104] test-unit/test-unit [master] don't handle Timeout::Error as pass through exception on Ruby 1.8. Message-ID: <20110910031127.EAA5A2C42F2@taiyaki.ru> Kouhei Sutou 2011-09-10 03:08:08 +0000 (Sat, 10 Sep 2011) New Revision: dfacb2154e3e893b3886b78fe99134b4958756e5 Log: don't handle Timeout::Error as pass through exception on Ruby 1.8. fixes #8 Reported by rb2k (Mark Seeger). Thanks!!! Modified files: README.textile lib/test/unit/error.rb test/test-testcase.rb Modified: README.textile (+1 -0) =================================================================== --- README.textile 2011-09-10 03:06:30 +0000 (cec94c5) +++ README.textile 2011-09-10 03:08:08 +0000 (38e18a2) @@ -82,3 +82,4 @@ h2. Thanks * Jeremy Stephens: A bug report. * Hans de Graaff: Bug reports. * James Mead: A bug report. +* Mark Seeger: A bug report. Modified: lib/test/unit/error.rb (+24 -4) =================================================================== --- lib/test/unit/error.rb 2011-09-10 03:06:30 +0000 (5b91ef7) +++ lib/test/unit/error.rb 2011-09-10 03:08:08 +0000 (00d7742) @@ -75,19 +75,39 @@ module Test end NOT_PASS_THROUGH_EXCEPTIONS = [] + NOT_PASS_THROUGH_EXCEPTION_NAMES = ["Timeout::Error"] PASS_THROUGH_EXCEPTIONS = [NoMemoryError, SignalException, Interrupt, SystemExit] + PASS_THROUGH_EXCEPTION_NAMES = [] private def handle_all_exception(exception) + return false if pass_through_exception?(exception) + + problem_occurred + add_error(exception) + true + end + + def pass_through_exception?(exception) case exception when *NOT_PASS_THROUGH_EXCEPTIONS - when *PASS_THROUGH_EXCEPTIONS + return false + end + case exception.class.name + when *NOT_PASS_THROUGH_EXCEPTION_NAMES return false end - problem_occurred - add_error(exception) - true + case exception + when *PASS_THROUGH_EXCEPTIONS + return true + end + case exception.class.name + when *PASS_THROUGH_EXCEPTION_NAMES + return true + end + + false end def add_error(exception) Modified: test/test-testcase.rb (+19 -0) =================================================================== --- test/test-testcase.rb 2011-09-10 03:06:30 +0000 (e7c3385) +++ test/test-testcase.rb 2011-09-10 03:08:08 +0000 (6e3bdbf) @@ -279,6 +279,25 @@ module Test end end + def test_timeout_error + test_case = Class.new(TestCase) do + def test_raise_timeout_error + require "timeout" + raise Timeout::Error + end + end + + test_suite = test_case.suite + result = TestResult.new + begin + test_suite.run(result) {} + check("Timeout::Error should be handled as error", + result.error_count == 1) + rescue Exception + check("Timeout::Error should not be passed through: #{$!}", false) + end + end + def test_startup_shutdown called = [] test_case = Class.new(TestCase) do From null+test-unit @ clear-code.com Sat Sep 10 04:12:29 2011 From: null+test-unit @ clear-code.com (null+test-unit @ clear-code.com) Date: Sat, 10 Sep 2011 08:12:29 +0000 Subject: [test-unit-commit:00105] test-unit/test-unit [master] fixed a typo in my name Message-ID: <20110910131720.EF5142C41BC@taiyaki.ru> Marc Seeger 2011-09-10 08:12:29 +0000 (Sat, 10 Sep 2011) New Revision: 86453edd8bf24e322cd0d3058679402b8cb06d2d Merged 2e0d24f: Merge pull request #9 from rb2k/patch-1 Log: fixed a typo in my name Modified files: README.textile Modified: README.textile (+1 -1) =================================================================== --- README.textile 2011-09-10 03:08:08 +0000 (38e18a2) +++ README.textile 2011-09-10 08:12:29 +0000 (d5e3b33) @@ -82,4 +82,4 @@ h2. Thanks * Jeremy Stephens: A bug report. * Hans de Graaff: Bug reports. * James Mead: A bug report. -* Mark Seeger: A bug report. +* Marc Seeger (Acquia): A bug report. From null+test-unit @ clear-code.com Sat Sep 10 09:14:12 2011 From: null+test-unit @ clear-code.com (null+test-unit @ clear-code.com) Date: Sat, 10 Sep 2011 13:14:12 +0000 Subject: [test-unit-commit:00106] test-unit/test-unit [master] Merge pull request #9 from rb2k/patch-1 Message-ID: <20110910131721.0545C2C42F2@taiyaki.ru> Kouhei Sutou 2011-09-10 13:14:12 +0000 (Sat, 10 Sep 2011) New Revision: 2e0d24f36571f1df280862be4d14b76f799a9deb Log: Merge pull request #9 from rb2k/patch-1 fixed a typo in my name From null+test-unit @ clear-code.com Sun Sep 11 04:12:19 2011 From: null+test-unit @ clear-code.com (null+test-unit @ clear-code.com) Date: Sun, 11 Sep 2011 08:12:19 +0000 Subject: [test-unit-commit:00107] test-unit/test-unit [master] [ui][console] enable --show-detail-immediately by default. Message-ID: <20110911081535.170F92C419A@taiyaki.ru> Kouhei Sutou 2011-09-11 08:12:19 +0000 (Sun, 11 Sep 2011) New Revision: 938f97ee37901f88677215dcc6c90bb813cae1bd Log: [ui][console] enable --show-detail-immediately by default. Modified files: lib/test/unit/runner/console.rb lib/test/unit/ui/console/testrunner.rb Modified: lib/test/unit/runner/console.rb (+2 -2) =================================================================== --- lib/test/unit/runner/console.rb 2011-09-10 13:14:12 +0000 (a1d0c27) +++ lib/test/unit/runner/console.rb 2011-09-11 08:12:19 +0000 (461a95a) @@ -49,9 +49,9 @@ module Test auto_runner.runner_options[:progress_row_max] = max end - opts.on("--[no-]show-detail-immediately", + opts.on("--no-show-detail-immediately", "Shows not passed test details immediately.", - "(default is no)") do |boolean| + "(default is yes)") do |boolean| auto_runner.runner_options[:show_detail_immediately] = boolean end end Modified: lib/test/unit/ui/console/testrunner.rb (+1 -0) =================================================================== --- lib/test/unit/ui/console/testrunner.rb 2011-09-10 13:14:12 +0000 (e1ad410) +++ lib/test/unit/ui/console/testrunner.rb 2011-09-11 08:12:19 +0000 (db76963) @@ -38,6 +38,7 @@ module Test @progress_row_max = @options[:progress_row_max] @progress_row_max ||= guess_progress_row_max @show_detail_immediately = @options[:show_detail_immediately] + @show_detail_immediately = true if @show_detail_immediately.nil? @already_outputted = false @indent = 0 @top_level = true From null+test-unit @ clear-code.com Sun Sep 18 01:46:23 2011 From: null+test-unit @ clear-code.com (null+test-unit @ clear-code.com) Date: Sun, 18 Sep 2011 05:46:23 +0000 Subject: [test-unit-commit:00108] test-unit/test-unit [master] 2.3.3 -> 2.4.0 because console output format is incompatible. Message-ID: <20110918054952.9B7B22C4793@taiyaki.ru> Kouhei Sutou 2011-09-18 05:46:23 +0000 (Sun, 18 Sep 2011) New Revision: 2d1ac6d6a9e3f6dfc5f555ab956d5fccb968b7c7 Log: 2.3.3 -> 2.4.0 because console output format is incompatible. Modified files: lib/test/unit/version.rb Modified: lib/test/unit/version.rb (+1 -1) =================================================================== --- lib/test/unit/version.rb 2011-09-11 08:12:19 +0000 (7e665a9) +++ lib/test/unit/version.rb 2011-09-18 05:46:23 +0000 (e981587) @@ -1,5 +1,5 @@ module Test module Unit - VERSION = '2.3.3' + VERSION = '2.4.0' end end From null+test-unit @ clear-code.com Sun Sep 18 02:30:34 2011 From: null+test-unit @ clear-code.com (null+test-unit @ clear-code.com) Date: Sun, 18 Sep 2011 06:30:34 +0000 Subject: [test-unit-commit:00109] test-unit/test-unit [master] add --max-diff-target-string-size option. Message-ID: <20110918063401.3A2A22C41B8@taiyaki.ru> Kouhei Sutou 2011-09-18 06:30:34 +0000 (Sun, 18 Sep 2011) New Revision: ee5df6973aedbdf2db3fbe33a6f5f92ab26b12dd Log: add --max-diff-target-string-size option. Modified files: lib/test/unit/assertions.rb lib/test/unit/autorunner.rb Modified: lib/test/unit/assertions.rb (+7 -0) =================================================================== --- lib/test/unit/assertions.rb 2011-09-18 05:46:23 +0000 (df8c53b) +++ lib/test/unit/assertions.rb 2011-09-18 06:30:34 +0000 (8f75b3d) @@ -1431,6 +1431,8 @@ EOT MAX_DIFF_TARGET_STRING_SIZE = 1000 def max_diff_target_string_size + return @@max_diff_target_string_size if @@max_diff_target_string_size + size = ENV["TEST_UNIT_MAX_DIFF_TARGET_STRING_SIZE"] if size begin @@ -1442,6 +1444,11 @@ EOT size || MAX_DIFF_TARGET_STRING_SIZE end + @@max_diff_target_string_size = nil + def max_diff_target_string_size=(size) + @@max_diff_target_string_size = size + end + def diff_target_string?(string) if string.respond_to?(:bytesize) string.bytesize < max_diff_target_string_size Modified: lib/test/unit/autorunner.rb (+9 -0) =================================================================== --- lib/test/unit/autorunner.rb 2011-09-18 05:46:23 +0000 (31fc130) +++ lib/test/unit/autorunner.rb 2011-09-18 06:30:34 +0000 (7a31aa1) @@ -296,6 +296,15 @@ module Test TestCase.test_order = order end + assertion_message_class = Test::Unit::Assertions::AssertionMessage + o.on("--max-diff-target-string-size=SIZE", Integer, + "Shows diff if both expected result string size and " + + "actual result string size are " + + "less than or equal SIZE in bytes.", + "(#{assertion_message_class.max_diff_target_string_size})") do |size| + assertion_message_class.max_diff_target_string_size = size + end + ADDITIONAL_OPTIONS.each do |option_builder| option_builder.call(self, o) end From null+test-unit @ clear-code.com Sun Sep 18 02:48:11 2011 From: null+test-unit @ clear-code.com (null+test-unit @ clear-code.com) Date: Sun, 18 Sep 2011 06:48:11 +0000 Subject: [test-unit-commit:00110] test-unit/test-unit [master] support 256 colors. Message-ID: <20110918065139.00FB62C41B8@taiyaki.ru> Kouhei Sutou 2011-09-18 06:48:11 +0000 (Sun, 18 Sep 2011) New Revision: 1b10c1a71d2eb1a167e1a400892d8029f9b03451 Log: support 256 colors. Modified files: lib/test/unit/color-scheme.rb lib/test/unit/color.rb test/test-color-scheme.rb Modified: lib/test/unit/color-scheme.rb (+75 -28) =================================================================== --- lib/test/unit/color-scheme.rb 2011-09-18 06:30:34 +0000 (9f4fefc) +++ lib/test/unit/color-scheme.rb 2011-09-18 06:48:11 +0000 (7ec6abc) @@ -6,35 +6,68 @@ module Test include Enumerable class << self - @@default = nil def default - @@default ||= new("pass" => - Color.new("green", :foreground => false) + - Color.new("white", :bold => true), - "failure" => - Color.new("red", :foreground => false) + - Color.new("white", :bold => true), - "pending" => Color.new("magenta", :bold => true), - "omission" => Color.new("blue", :bold => true), - "notification" => Color.new("cyan", :bold => true), - "error" => Color.new("yellow", :bold => true) + - Color.new("black", :foreground => false), - "case" => Color.new("white", :bold => true) + - Color.new("blue", :foreground => false), - "suite" => Color.new("white", :bold => true) + - Color.new("green", :foreground => false), - "diff-inserted-tag" => - Color.new("red", :bold => true), - "diff-deleted-tag" => - Color.new("green", :bold => true), - "diff-difference-tag" => - Color.new("cyan", :bold => true), - "diff-inserted" => - Color.new("red", :foreground => false) + - Color.new("white", :bold => true), - "diff-deleted" => - Color.new("green", :foreground => false) + - Color.new("white", :bold => true)) + if available_colors == 256 + default_for_256_colors + else + default_for_8_colors + end + end + + @@default_for_8_colors = nil + def default_for_8_colors + @@default_for_8_colors ||= + new("pass" => Color.new("green", :foreground => false) + + Color.new("white", :bold => true), + "failure" => Color.new("red", :foreground => false) + + Color.new("white", :bold => true), + "pending" => Color.new("magenta", :bold => true), + "omission" => Color.new("blue", :bold => true), + "notification" => Color.new("cyan", :bold => true), + "error" => Color.new("yellow", :bold => true) + + Color.new("black", :foreground => false), + "case" => Color.new("white", :bold => true) + + Color.new("blue", :foreground => false), + "suite" => Color.new("white", :bold => true) + + Color.new("green", :foreground => false), + "diff-inserted-tag" => Color.new("red", :bold => true), + "diff-deleted-tag" => Color.new("green", :bold => true), + "diff-difference-tag" => Color.new("cyan", :bold => true), + "diff-inserted" => Color.new("red", :foreground => false) + + Color.new("white", :bold => true), + "diff-deleted" => Color.new("green", :foreground => false) + + Color.new("white", :bold => true)) + end + + @@default_for_256_colors = nil + def default_for_256_colors + @@default_for_256_colors ||= + new("pass" => Color.new("030", :foreground => false) + + Color.new("555", :bold => true), + "failure" => Color.new("300", :foreground => false) + + Color.new("555", :bold => true), + "pending" => Color.new("303", :foreground => false) + + Color.new("555", :bold => true), + "omission" => Color.new("001", :foreground => false) + + Color.new("555", :bold => true), + "notification" => Color.new("011", :foreground => false) + + Color.new("555", :bold => true), + "error" => Color.new("550", :bold => true) + + Color.new("000", :foreground => false), + "case" => Color.new("220", :foreground => false) + + Color.new("555", :bold => true), + "suite" => Color.new("110", :foreground => false) + + Color.new("555", :bold => true), + "diff-inserted-tag" => Color.new("500", :foreground => false) + + Color.new("000", :bold => true), + "diff-deleted-tag" => Color.new("050", :foreground => false) + + Color.new("000", :bold => true), + "diff-difference-tag" => Color.new("005", :foreground => false) + + Color.new("555", :bold => true), + "diff-inserted" => Color.new("300", :foreground => false) + + Color.new("555", :bold => true), + "diff-deleted" => Color.new("030", :foreground => false) + + Color.new("555", :bold => true)) end @@schemes = {} @@ -54,6 +87,20 @@ module Test end @@schemes[id.to_s] = scheme end + + def available_colors + case ENV["COLORTERM"] + when "gnome-terminal" + 256 + else + case ENV["TERM"] + when "xterm-256color" + 256 + else + 8 + end + end + end end def initialize(scheme_spec) Modified: lib/test/unit/color.rb (+30 -3) =================================================================== --- lib/test/unit/color.rb 2011-09-18 06:30:34 +0000 (600af10) +++ lib/test/unit/color.rb 2011-09-18 06:48:11 +0000 (fff29ef) @@ -1,6 +1,26 @@ module Test module Unit class Color + class Error < StandardError + end + + class ParseError < Error + end + + class << self + def parse_256_color(string) + case string + when /\A([0-5])([0-5])([0-5])\z/ + red, green, blue = $1, $2, $3 + red.to_i * 36 + green.to_i * 6 + blue.to_i + 16 + else + message = "must be 'RGB' format and R, G and B " + + "are in 0-5: #{string.inspect}" + raise ParseError, message + end + end + end + NAMES = ["black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"] @@ -49,9 +69,16 @@ module Test elsif @name == "reset" sequence << "0" else - foreground_parameter = foreground? ? 3 : 4 - foreground_parameter += 6 if intensity? - sequence << "#{foreground_parameter}#{NAMES.index(@name)}" + if NAMES.include?(@name) + foreground_parameter = foreground? ? 3 : 4 + foreground_parameter += 6 if intensity? + color = NAMES.index(@name) + sequence << "#{foreground_parameter}#{color}" + else + sequence << (foreground? ? "38" : "48") + sequence << "5" + sequence << self.class.parse_256_color(@name).to_s + end end sequence << "1" if bold? sequence << "3" if italic? Modified: test/test-color-scheme.rb (+39 -26) =================================================================== --- test/test-color-scheme.rb 2011-09-18 06:30:34 +0000 (401a789) +++ test/test-color-scheme.rb 2011-09-18 06:48:11 +0000 (05a26a6) @@ -1,30 +1,4 @@ class TestUnitColorScheme < Test::Unit::TestCase - def test_default - assert_equal({ - "pass" => color("green", :foreground => false) + - color("white", :bold => true), - "failure" => color("red", :foreground => false) + - color("white", :bold => true), - "pending" => color("magenta", :bold => true), - "omission" => color("blue", :bold => true), - "notification" => color("cyan", :bold => true), - "error" => color("yellow", :bold => true) + - color("black", :foreground => false), - "case" => color("white", :bold => true) + - color("blue", :foreground => false), - "suite" => color("white", :bold => true) + - color("green", :foreground => false), - "diff-inserted-tag" => color("red", :bold => true), - "diff-deleted-tag" => color("green", :bold => true), - "diff-difference-tag" => color("cyan", :bold => true), - "diff-inserted" => color("red", :foreground => false) + - color("white", :bold => true), - "diff-deleted" => color("green", :foreground => false) + - color("white", :bold => true), - }, - Test::Unit::ColorScheme.default.to_hash) - end - def test_register inverted_scheme_spec = { "success" => {:name => "red"}, @@ -66,4 +40,43 @@ class TestUnitColorScheme < Test::Unit::TestCase def color(name, options={}) Test::Unit::Color.new(name, options) end + + class TestFor8Colors < self + def setup + @original_term, ENV["TERM"] = ENV["TERM"], nil + @original_color_term, ENV["COLORTERM"] = ENV["COLORTERM"], nil + ENV["TERM"] = "xterm" + end + + def teardown + ENV["TERM"] = @original_term + ENV["COLORTERM"] = @original_color_term + end + + def test_default + assert_equal({ + "pass" => color("green", :foreground => false) + + color("white", :bold => true), + "failure" => color("red", :foreground => false) + + color("white", :bold => true), + "pending" => color("magenta", :bold => true), + "omission" => color("blue", :bold => true), + "notification" => color("cyan", :bold => true), + "error" => color("yellow", :bold => true) + + color("black", :foreground => false), + "case" => color("white", :bold => true) + + color("blue", :foreground => false), + "suite" => color("white", :bold => true) + + color("green", :foreground => false), + "diff-inserted-tag" => color("red", :bold => true), + "diff-deleted-tag" => color("green", :bold => true), + "diff-difference-tag" => color("cyan", :bold => true), + "diff-inserted" => color("red", :foreground => false) + + color("white", :bold => true), + "diff-deleted" => color("green", :foreground => false) + + color("white", :bold => true), + }, + Test::Unit::ColorScheme.default.to_hash) + end + end end From null+test-unit @ clear-code.com Sun Sep 18 03:08:08 2011 From: null+test-unit @ clear-code.com (null+test-unit @ clear-code.com) Date: Sun, 18 Sep 2011 07:08:08 +0000 Subject: [test-unit-commit:00111] test-unit/test-unit [master] added 2.4.0 entry. Message-ID: <20110918071137.DEAB32C41B8@taiyaki.ru> Kouhei Sutou 2011-09-18 07:08:08 +0000 (Sun, 18 Sep 2011) New Revision: 93cee50ca54cc1d5562b7f3c172f2d1fa5f0c6a0 Log: added 2.4.0 entry. Modified files: doc/text/news.textile Modified: doc/text/news.textile (+25 -0) =================================================================== --- doc/text/news.textile 2011-09-18 06:48:11 +0000 (d0b3c98) +++ doc/text/news.textile 2011-09-18 07:08:08 +0000 (2e79f9a) @@ -1,5 +1,30 @@ h1. News +h2. 2.4.0 - 2011-09-18 + +h3. Improvements + + * Supported Travis CI. #5 [Suggested by James Mead] + * Added Gemfile. #6 [Suggested by James Mead] + * [ui][console] Supported notification in show-detail-immediately. + * [ui][console] enable --show-detail-immediately by default. + * [ui] Added --max-diff-target-string-size option. + * [ui][console] Supported 256 colors. + +h3. Fixes + + * Added missing fixture file. #7 [Reported by grafi-tt] + * [ui][console] Added missing the last newline for progress level. + * Supported correct backtrace for redefined notification. + * Don't handle Timeout::Error as pass through exception on Ruby 1.8. #8 + [Reported by Marc Seeger (Acquia)] + +h3. Thanks + + * James Mead + * grafi-tt + * Marc Seeger (Acquia) + h2. 2.3.2 - 2011-08-15 A bug fix release. From null+test-unit @ clear-code.com Sun Sep 18 03:09:07 2011 From: null+test-unit @ clear-code.com (null+test-unit @ clear-code.com) Date: Sun, 18 Sep 2011 07:09:07 +0000 Subject: [test-unit-commit:00112] test-unit/test-unit [master] update 2.4.0 release date. Message-ID: <20110918071234.4CBC52C41B8@taiyaki.ru> Kouhei Sutou 2011-09-18 07:09:07 +0000 (Sun, 18 Sep 2011) New Revision: 64e4934426bcdca9b8ea782fdecefe4fb403fef1 Log: update 2.4.0 release date. Modified files: doc/html/index.html doc/html/index.html.ja Modified: doc/html/index.html (+1 -1) =================================================================== --- doc/html/index.html 2011-09-18 07:08:08 +0000 (4d4e986) +++ doc/html/index.html 2011-09-18 07:09:07 +0000 (1b83472) @@ -88,7 +88,7 @@ require "test/unit"
- 2.3.2 is the latest release. It had been released at 2011-08-15. + 2.4.0 is the latest release. It had been released at 2011-09-18.
Modified: doc/html/index.html.ja (+1 -1) =================================================================== --- doc/html/index.html.ja 2011-09-18 07:08:08 +0000 (cf9d2e5) +++ doc/html/index.html.ja 2011-09-18 07:09:07 +0000 (d997362) @@ -101,7 +101,7 @@ require "test/unit"
- 2011-08-15にリリースされた2.3.2が最新リリースです。 + 2011-09-18にリリースされた2.4.0が最新リリースです。
From null+test-unit @ clear-code.com Sun Sep 18 03:24:50 2011 From: null+test-unit @ clear-code.com (null+test-unit @ clear-code.com) Date: Sun, 18 Sep 2011 07:24:50 +0000 Subject: [test-unit-commit:00113] test-unit/test-unit [master] 2.4.0 -> 2.4.1. Message-ID: <20110918072830.77ECE2C4793@taiyaki.ru> Kouhei Sutou 2011-09-18 07:24:50 +0000 (Sun, 18 Sep 2011) New Revision: 4f7905a164218af46d33f95233b4d302ab60458c Log: 2.4.0 -> 2.4.1. Modified files: lib/test/unit/version.rb Modified: lib/test/unit/version.rb (+1 -1) =================================================================== --- lib/test/unit/version.rb 2011-09-18 07:09:07 +0000 (e981587) +++ lib/test/unit/version.rb 2011-09-18 07:24:50 +0000 (732eeda) @@ -1,5 +1,5 @@ module Test module Unit - VERSION = '2.4.0' + VERSION = '2.4.1' end end From null+test-unit @ clear-code.com Sun Sep 25 02:03:59 2011 From: null+test-unit @ clear-code.com (null+test-unit @ clear-code.com) Date: Sun, 25 Sep 2011 06:03:59 +0000 Subject: [test-unit-commit:00114] test-unit/test-unit [master] fix test failure on LANG=C. fixes #11 Message-ID: <20110925060741.6093D2C4790@taiyaki.ru> Kouhei Sutou 2011-09-25 06:03:59 +0000 (Sun, 25 Sep 2011) New Revision: 364b2e9775e0c4177ad23c5700fb78dbf174bf56 Log: fix test failure on LANG=C. fixes #11 Reported by boutil. Thanks!!! Modified files: README.textile test/test-assertions.rb Modified: README.textile (+1 -0) =================================================================== --- README.textile 2011-09-18 07:24:50 +0000 (d5e3b33) +++ README.textile 2011-09-25 06:03:59 +0000 (ca344b8) @@ -83,3 +83,4 @@ h2. Thanks * Hans de Graaff: Bug reports. * James Mead: A bug report. * Marc Seeger (Acquia): A bug report. +* boutil: A bug report. Modified: test/test-assertions.rb (+1 -1) =================================================================== --- test/test-assertions.rb 2011-09-18 07:24:50 +0000 (9f8ad7c) +++ test/test-assertions.rb 2011-09-25 06:03:59 +0000 (022b554) @@ -330,7 +330,7 @@ EOM end ascii_8bit_string = utf8_string.dup.force_encoding("ascii-8bit") message = <<-EOM.chomp -<"こんにちは">("UTF-8") expected but was +<#{utf8_string.inspect}>("UTF-8") expected but was <#{ascii_8bit_string.inspect}>("ASCII-8BIT"). EOM check_fails(message) do