Hello community, here is the log from the commit of package rubygem-test-unit for openSUSE:Factory checked in at 2015-06-12 20:30:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-test-unit (Old) and /work/SRC/openSUSE:Factory/.rubygem-test-unit.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-test-unit" Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-test-unit/rubygem-test-unit.changes 2015-02-16 21:13:24.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-test-unit.new/rubygem-test-unit.changes 2015-06-12 20:30:35.000000000 +0200 @@ -1,0 +2,39 @@ +Thu May 28 04:34:33 UTC 2015 - co...@suse.com + +- updated to version 3.1.0 + see installed news.md + + ## 3.1.0 - 2015-05-28 {#version-3-1-0} + + It's a bug fix release. + + ### Improvements + + * [ui][console] Removed needless new line. + + ### Fixes + + * Fixed a bug that priority mode can't be used on Windows. + [GitHub#95][Reported by Daniel Berger] + * Fixed a homepage URL RubyGems spec. + [GitHub#96][Patch by Masayoshi Takahashi] + supported.) [GitHub#89][Patch by Aaron Stone] + * Fixed a bug that shutdown hook isn't called when pass throw + exception such as `Interrupt` is raised. + [GitHub#98][Reported by jeremiahishere.] + * Fixed typos in documents. + [GitHub#100][Reported by scivola] + [GitHub#102][GitHub#103][Patch by Masafumi Yokoyama] + * Fixed a bug that the same name test isn't executed in sub test case. + [GitHub#104][Reported by wanabe] + + ### Thanks + + * Daniel Berger + * Masayoshi Takahashi + * jeremiahishere + * scivola + * Masafumi Yokoyama + * wanabe + +------------------------------------------------------------------- Old: ---- test-unit-3.0.9.gem New: ---- test-unit-3.1.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-test-unit.spec ++++++ --- /var/tmp/diff_new_pack.wHwHl1/_old 2015-06-12 20:30:36.000000000 +0200 +++ /var/tmp/diff_new_pack.wHwHl1/_new 2015-06-12 20:30:36.000000000 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-test-unit -Version: 3.0.9 +Version: 3.1.0 Release: 0 %define mod_name test-unit %define mod_full_name %{mod_name}-%{version} @@ -32,7 +32,7 @@ BuildRequires: %{rubygem gem2rpm} BuildRequires: %{ruby} BuildRequires: ruby-macros >= 5 -Url: http://rubygems.org/gems/test-unit +Url: http://test-unit.github.io/ Source: http://rubygems.org/gems/%{mod_full_name}.gem Source1: gem2rpm.yml Summary: An xUnit family unit testing framework for Ruby ++++++ test-unit-3.0.9.gem -> test-unit-3.1.0.gem ++++++ Files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/doc/text/news.md new/doc/text/news.md --- old/doc/text/news.md 2014-12-31 04:12:08.000000000 +0100 +++ new/doc/text/news.md 2015-05-28 05:03:43.000000000 +0200 @@ -1,5 +1,38 @@ # News +## 3.1.0 - 2015-05-28 {#version-3-1-0} + +It's a bug fix release. + +### Improvements + + * [ui][console] Removed needless new line. + +### Fixes + + * Fixed a bug that priority mode can't be used on Windows. + [GitHub#95][Reported by Daniel Berger] + * Fixed a homepage URL RubyGems spec. + [GitHub#96][Patch by Masayoshi Takahashi] + supported.) [GitHub#89][Patch by Aaron Stone] + * Fixed a bug that shutdown hook isn't called when pass throw + exception such as `Interrupt` is raised. + [GitHub#98][Reported by jeremiahishere.] + * Fixed typos in documents. + [GitHub#100][Reported by scivola] + [GitHub#102][GitHub#103][Patch by Masafumi Yokoyama] + * Fixed a bug that the same name test isn't executed in sub test case. + [GitHub#104][Reported by wanabe] + +### Thanks + + * Daniel Berger + * Masayoshi Takahashi + * jeremiahishere + * scivola + * Masafumi Yokoyama + * wanabe + ## 3.0.9 - 2014-12-31 {#version-3-0-9} It's a release that improves colors. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/test/unit/assertions.rb new/lib/test/unit/assertions.rb --- old/lib/test/unit/assertions.rb 2014-12-31 04:12:08.000000000 +0100 +++ new/lib/test/unit/assertions.rb 2015-05-28 05:03:43.000000000 +0200 @@ -178,7 +178,7 @@ # refute(false) # => pass # refute(nil) # => pass # - # @example Fialure patterns + # @example Failure patterns # refute(true) # => failure # refute("string") # => failure # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/test/unit/error.rb new/lib/test/unit/error.rb --- old/lib/test/unit/error.rb 2014-12-31 04:12:08.000000000 +0100 +++ new/lib/test/unit/error.rb 2015-05-28 05:03:43.000000000 +0200 @@ -78,8 +78,12 @@ NOT_PASS_THROUGH_EXCEPTIONS = [] NOT_PASS_THROUGH_EXCEPTION_NAMES = ["Timeout::Error"] - PASS_THROUGH_EXCEPTIONS = [NoMemoryError, SignalException, Interrupt, - SystemExit] + PASS_THROUGH_EXCEPTIONS = [ + NoMemoryError, + SignalException, + Interrupt, + SystemExit, + ] PASS_THROUGH_EXCEPTION_NAMES = [] private def handle_all_exception(exception) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/test/unit/priority.rb new/lib/test/unit/priority.rb --- old/lib/test/unit/priority.rb 2014-12-31 04:12:08.000000000 +0100 +++ new/lib/test/unit/priority.rb 2015-05-28 05:03:43.000000000 +0200 @@ -122,9 +122,11 @@ end def result_dir - components = [".test-result", - @test.class.name || "AnonymousTestCase", - escaped_method_name] + components = [ + ".test-result", + escape_class_name(@test.class.name || "AnonymousTestCase"), + escaped_method_name, + ] parent_directories = [File.dirname($0), Dir.pwd] if Process.respond_to?(:uid) parent_directories << File.join(Dir.tmpdir, Process.uid.to_s) @@ -145,9 +147,17 @@ File.join(result_dir, "passed") end + def escape_class_name(class_name) + class_name.gsub(/(?:[: \\\/])/, "_") + end + def escaped_method_name - @test.method_name.to_s.gsub(/[!?=]$/) do |matched| + @test.method_name.to_s.gsub(/(?:[: ]|[!?=]$)/) do |matched| case matched + when ":" + "_colon_" + when " " + "_" when "!" ".destructive" when "?" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/test/unit/test-suite-creator.rb new/lib/test/unit/test-suite-creator.rb --- old/lib/test/unit/test-suite-creator.rb 2014-12-31 04:12:08.000000000 +0100 +++ new/lib/test/unit/test-suite-creator.rb 2015-05-28 05:03:43.000000000 +0200 @@ -44,9 +44,10 @@ methods = @test_case.public_instance_methods(true) super_test_case = @test_case.superclass methods -= super_test_case.public_instance_methods(true) + methods |= @test_case.public_instance_methods(false) method_names = methods.collect(&:to_s) test_names = method_names.find_all do |method_name| - method_name =~ /^test./ or + /\Atest./ =~ method_name or @test_case.find_attribute(method_name, :test) end __send__("sort_test_names_in_#{@test_case.test_order}_order", test_names) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/test/unit/testcase.rb new/lib/test/unit/testcase.rb --- old/lib/test/unit/testcase.rb 2014-12-31 04:12:08.000000000 +0100 +++ new/lib/test/unit/testcase.rb 2015-05-28 05:03:43.000000000 +0200 @@ -320,7 +320,7 @@ # end # end # - # The diffrence of them are the following: + # The difference of them are the following: # # * Test case created by {sub_test_case} is an anonymous class. # So you can't refer the test case by name. @@ -331,7 +331,7 @@ # # @param name [String] The name of newly created sub test case. # @yield - # The block is evaludated under the newly created sub test + # The block is evaluated under the newly created sub test # case class context. # @return [Test::Unit::TestCase] Created sub test case class. def sub_test_case(name, &block) @@ -346,7 +346,7 @@ sub_test_case end - # Checkes whether a test that is mathched the query is + # Checks whether a test that is matched the query is # defined. # # @option query [String] :path (nil) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/test/unit/testsuite.rb new/lib/test/unit/testsuite.rb --- old/lib/test/unit/testsuite.rb 2014-12-31 04:12:08.000000000 +0100 +++ new/lib/test/unit/testsuite.rb 2015-05-28 05:03:43.000000000 +0200 @@ -53,11 +53,14 @@ run_test(test, result, &progress_block) @passed = false unless test.passed? end - run_shutdown(result) ensure - @elapsed_time = Time.now - @start_time - yield(FINISHED, name) - yield(FINISHED_OBJECT, self) + begin + run_shutdown(result) + ensure + @elapsed_time = Time.now - @start_time + yield(FINISHED, name) + yield(FINISHED_OBJECT, self) + end end # Adds the test to the suite. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/test/unit/ui/console/testrunner.rb new/lib/test/unit/ui/console/testrunner.rb --- old/lib/test/unit/ui/console/testrunner.rb 2014-12-31 04:12:08.000000000 +0100 +++ new/lib/test/unit/ui/console/testrunner.rb 2015-05-28 05:03:43.000000000 +0200 @@ -186,7 +186,7 @@ else if fault.is_a?(Error) output_single("#{fault.label}: ") - output(fault.test_name, fault_color(fault)) + output_single(fault.test_name, fault_color(fault)) output_fault_message(fault) else output_single(fault.label, fault_color(fault)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/test/unit/version.rb new/lib/test/unit/version.rb --- old/lib/test/unit/version.rb 2014-12-31 04:12:08.000000000 +0100 +++ new/lib/test/unit/version.rb 2015-05-28 05:03:43.000000000 +0200 @@ -1,5 +1,5 @@ module Test module Unit - VERSION = '3.0.9' + VERSION = '3.1.0' end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2014-12-31 04:12:08.000000000 +0100 +++ new/metadata 2015-05-28 05:03:43.000000000 +0200 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: test-unit version: !ruby/object:Gem::Version - version: 3.0.9 + version: 3.1.0 platform: ruby authors: - Kouhei Sutou @@ -9,7 +9,7 @@ autorequire: bindir: bin cert_chain: [] -date: 2014-12-31 00:00:00.000000000 Z +date: 2015-05-28 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: power_assert @@ -208,7 +208,7 @@ - test/util/test_backtracefilter.rb - test/util/test_observable.rb - test/util/test_procwrapper.rb -homepage: http://rubygems.org/gems/test-unit +homepage: http://test-unit.github.io/ licenses: - Ruby - PSFL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test-assertions.rb new/test/test-assertions.rb --- old/test/test-assertions.rb 2014-12-31 04:12:08.000000000 +0100 +++ new/test/test-assertions.rb 2015-05-28 05:03:43.000000000 +0200 @@ -124,22 +124,30 @@ class TestAssertions < TestCase include AssertionCheckable - def test_assert_block - check_nothing_fails { - assert_block {true} - } - check_nothing_fails { - assert_block("successful assert_block") {true} - } - check_nothing_fails { - assert_block("successful assert_block") {true} - } - check_fail("assert_block failed.") { - assert_block {false} - } - check_fail("failed assert_block") { - assert_block("failed assert_block") {false} - } + class TestAssertBlock < self + def test_pass_without_message + check_nothing_fails { + assert_block {true} + } + end + + def test_pass_with_message + check_nothing_fails { + assert_block("successful assert_block") {true} + } + end + + def test_failure_without_message + check_fail("assert_block failed.") { + assert_block {false} + } + end + + def test_failure_with_message + check_fail("failed assert_block") { + assert_block("failed assert_block") {false} + } + end end class TestAssertEqual < self diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test-priority.rb new/test/test-priority.rb --- old/test/test-priority.rb 2014-12-31 04:12:08.000000000 +0100 +++ new/test/test-priority.rb 2015-05-28 05:03:43.000000000 +0200 @@ -102,33 +102,72 @@ assert_in_delta(expected, n_need_to_run.to_f / n, delta) end - class SpecialNameTestCase < Test::Unit::TestCase - class << self - def suite - Test::Unit::TestSuite.new(name) - end + class TestClassName < self + def test_colon + assert_escaped_name("Test__Priority", "Test::Priority") end - def test_question? + def test_space + assert_escaped_name("test_priority", "test priority") end - def test_exclamation! + def test_slash + assert_escaped_name("test_priority", "test/priority") end - def test_equal= + def test_back_slash + assert_escaped_name("test_priority", "test\/priority") end - end - def test_escaped? - assert_escaped_name("test_question.predicate", "test_question?") - assert_escaped_name("test_exclamation.destructive", "test_exclamation!") - assert_escaped_name("test_equal.equal", "test_equal=") + def assert_escaped_name(expected, class_name) + checker = Checker.new(nil) + escaped_class_name = checker.send(:escape_class_name, class_name) + assert_equal(expected, escaped_class_name) + end end - def assert_escaped_name(expected, test_method_name) - checker = Checker.new(SpecialNameTestCase.new(test_method_name)) - passed_file = checker.send(:passed_file) - method_name_component = File.basename(File.dirname(passed_file)) - assert_equal(expected, method_name_component) + class TestFileName < self + class SpecialNameTestCase < Test::Unit::TestCase + class << self + def suite + Test::Unit::TestSuite.new(name) + end + end + + def test_question? + end + + def test_exclamation! + end + + def test_equal= + end + + test "have space" do + end + end + + def test_question + assert_escaped_name("test_question.predicate", "test_question?") + end + + def test_exclamation + assert_escaped_name("test_exclamation.destructive", "test_exclamation!") + end + + def test_equal + assert_escaped_name("test_equal.equal", "test_equal=") + end + + def test_colon_and_space + assert_escaped_name("test_colon__have_space", "test: have space") + end + + def assert_escaped_name(expected, test_method_name) + checker = Checker.new(SpecialNameTestCase.new(test_method_name)) + passed_file = checker.send(:passed_file) + method_name_component = File.basename(File.dirname(passed_file)) + assert_equal(expected, method_name_component) + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/test/test-test-case.rb new/test/test-test-case.rb --- old/test/test-test-case.rb 2014-12-31 04:12:08.000000000 +0100 +++ new/test/test-test-case.rb 2015-05-28 05:03:43.000000000 +0200 @@ -842,6 +842,33 @@ end assert_equal(["test_nothing"], test_method_names) end + + def test_duplicated_name + test_case = Class.new(TestCase) do + def test_nothing + end + end + sub_test_case = test_case.sub_test_case("sub test case") do + def test_nothing + end + end + + test_method_names = test_case.suite.tests.collect do |test| + test.method_name + end + sub_test_method_names = sub_test_case.suite.tests.collect do |test| + test.method_name + end + + assert_equal([ + ["test_nothing"], + ["test_nothing"], + ], + [ + test_method_names, + sub_test_method_names, + ]) + end end class TestStartupShutdown < self @@ -1064,6 +1091,35 @@ run_test_case(test_case) end end + + def test_pass_through_in_test + test_case = Class.new(TestCase) do + @called = [] + class << self + def called + @called + end + + def startup + @called << :startup + end + + def shutdown + @called << :shutdown + end + end + + def test_error + raise Interrupt, "from test" + end + end + + assert_raise(Interrupt) do + run_test_case(test_case) + end + assert_equal([:startup, :shutdown], + test_case.called) + end end end end