[DRE-commits] [ruby-test-unit] 01/05: Imported Upstream version 3.1.5

Cédric Boutillier boutil at moszumanska.debian.org
Tue Oct 20 18:37:58 UTC 2015


This is an automated email from the git hooks/post-receive script.

boutil pushed a commit to annotated tag debian/3.1.5-1
in repository ruby-test-unit.

commit 4e617d6385b683f90c0cf6979b3b830523cd5469
Author: Cédric Boutillier <boutil at debian.org>
Date:   Mon Oct 19 22:32:23 2015 +0200

    Imported Upstream version 3.1.5
---
 TODO                                  |  1 -
 doc/text/how-to.md                    |  2 ++
 doc/text/news.md                      | 60 +++++++++++++++++++++++++++++++++++
 lib/test-unit.rb                      | 14 ++++----
 lib/test/unit/code-snippet-fetcher.rb |  2 +-
 lib/test/unit/collector/xml.rb        |  5 ++-
 lib/test/unit/testcase.rb             |  4 +--
 lib/test/unit/version.rb              |  2 +-
 metadata.yml                          |  5 ++-
 sample/adder.rb                       |  2 +-
 sample/subtracter.rb                  |  2 +-
 sample/test_adder.rb                  |  2 +-
 sample/test_subtracter.rb             |  2 +-
 13 files changed, 82 insertions(+), 21 deletions(-)

diff --git a/TODO b/TODO
deleted file mode 100644
index 0c6a140..0000000
--- a/TODO
+++ /dev/null
@@ -1 +0,0 @@
-Do you have it?
diff --git a/doc/text/how-to.md b/doc/text/how-to.md
index e0cea5d..11bf236 100644
--- a/doc/text/how-to.md
+++ b/doc/text/how-to.md
@@ -67,6 +67,8 @@ Here are the syntax of color scheme definitions:
         ...
       ...
 
+| Definition  | Description                  |
+|-------------|------------------------------|
 | SCHEME_NAME | the name of the color scheme |
 | EVENT_NAME  | success, failure, pending, omission, notification, error |
 | COLOR_NAME  | black, red, green, yellow, blue, magenta, cyan, white    |
diff --git a/doc/text/news.md b/doc/text/news.md
index 95be524..6fdbcf6 100644
--- a/doc/text/news.md
+++ b/doc/text/news.md
@@ -1,5 +1,65 @@
 # News
 
+## 3.1.5 - 2015-10-09 {#version-3-1-5}
+
+It's a Rack integration improvement release.
+
+### Improvements
+
+  * Renamed experimental top-level `run` method to `run_test` method
+  because `run` is conflicted with Rack.
+  [GitHub#32][GitHub:basecamp/pow#303] [Reported by Yevhen Viktorov]
+
+### Thanks
+
+  * Yevhen Viktorov
+
+## 3.1.4 - 2015-09-26 {#version-3-1-4}
+
+It's a minor improvement release.
+
+### Improvements
+
+  * Updated sample code. [GitHub#109][Patch by takiy33]
+  * Updated .travis.yml. [GitHub#110][Patch by takiy33]
+  * document: Added table header in how to document.
+    [GitHub#111][Patch by takiy33]
+  * Removed duplicated code.
+    [GitHub#112][Patch by takiy33]
+  * Removed needless encoding conversion in fetching code snippet.
+    [GitHub#113][Patch by NARUSE, Yui]
+
+### Thanks
+
+  * takiy33
+  * NARUSE, Yui
+
+## 3.1.3 - 2015-07-26 {#version-3-1-3}
+
+It's a bug fix release.
+
+### Improvements
+
+  * Removed unused `TODO` file. [GitHub#108][Patch by takiy33]
+
+### Fixes
+
+  * `--location`: Fixed a bug that `--location LINE` doesn't work when
+    test script is specified as relative path. [Reported by TOMITA Masahiro]
+
+    The following doesn't work:
+
+        % ruby ./test.rb --location 10
+
+    The following works:
+
+        % ruby test.rb --location 10
+
+### Thanks
+
+  * takiy33
+  * TOMITA Masahiro
+
 ## 3.1.2 - 2015-06-09 {#version-3-1-2}
 
 It's command line option improvements fix release.
diff --git a/lib/test-unit.rb b/lib/test-unit.rb
index b4fa088..25abbdc 100644
--- a/lib/test-unit.rb
+++ b/lib/test-unit.rb
@@ -1,4 +1,4 @@
-# Copyright (C) 2012  Kouhei Sutou <kou at clear-code.com>
+# Copyright (C) 2012-2015  Kouhei Sutou <kou at clear-code.com>
 #
 # License: Ruby's or LGPLv2.1 or later
 #
@@ -24,9 +24,11 @@ module Test
   end
 end
 
-# experimental. It is for "ruby -rtest-unit -e run test/test_*.rb".
-# Is this API OK or dirty?
-def run
-  self.class.send(:undef_method, :run)
-  require "test/unit"
+unless respond_to?(:run_test, true)
+  # experimental. It is for "ruby -rtest-unit -e run_test test/test_*.rb".
+  # Is this API OK or dirty?
+  def run_test
+    self.class.send(:undef_method, :run_test)
+    require "test/unit"
+  end
 end
diff --git a/lib/test/unit/code-snippet-fetcher.rb b/lib/test/unit/code-snippet-fetcher.rb
index 4ad3519..7969a07 100644
--- a/lib/test/unit/code-snippet-fetcher.rb
+++ b/lib/test/unit/code-snippet-fetcher.rb
@@ -32,7 +32,7 @@ module Test
           encoding = detect_encoding(first_line)
           if encoding
             first_line.force_encoding(encoding)
-            file.set_encoding(encoding)
+            file.set_encoding(encoding, encoding)
           end
           lines << first_line
           lines.concat(file.readlines)
diff --git a/lib/test/unit/collector/xml.rb b/lib/test/unit/collector/xml.rb
index 96117a6..cde4528 100644
--- a/lib/test/unit/collector/xml.rb
+++ b/lib/test/unit/collector/xml.rb
@@ -64,16 +64,15 @@ module Test
 
             state = next_state(@state_stack.last, uri, local)
             @state_stack.push(state)
+            @values = {}
             case state
             when :test_suite, :test_case
-              @values = {}
+              # do nothing
             when :test
-              @values = {}
               @n_pass_assertions = 0 if _parent_tag == "start-test"
             when :backtrace
               @backtrace = []
               @values_backup = @values
-              @values = {}
             end
           end
 
diff --git a/lib/test/unit/testcase.rb b/lib/test/unit/testcase.rb
index 4a91baf..8aaaea2 100644
--- a/lib/test/unit/testcase.rb
+++ b/lib/test/unit/testcase.rb
@@ -121,12 +121,12 @@ module Test
           if source_location
             path, line = source_location
           else
-            path, line, = caller[0].split(/:(\d+)/,2)
+            path, line, = caller[0].split(/:(\d+)/, 2)
             line = line.to_i if line
           end
           method_locations << {
             :method_name => stringified_name,
-            :path => path,
+            :path => File.expand_path(path),
             :line => line,
           }
           added_method_names[stringified_name] = true
diff --git a/lib/test/unit/version.rb b/lib/test/unit/version.rb
index 6809f14..3a17716 100644
--- a/lib/test/unit/version.rb
+++ b/lib/test/unit/version.rb
@@ -1,5 +1,5 @@
 module Test
   module Unit
-    VERSION = '3.1.2'
+    VERSION = '3.1.5'
   end
 end
diff --git a/metadata.yml b/metadata.yml
index fe030d6..9734071 100644
--- a/metadata.yml
+++ b/metadata.yml
@@ -1,7 +1,7 @@
 --- !ruby/object:Gem::Specification
 name: test-unit
 version: !ruby/object:Gem::Version
-  version: 3.1.2
+  version: 3.1.5
 platform: ruby
 authors:
 - Kouhei Sutou
@@ -9,7 +9,7 @@ authors:
 autorequire: 
 bindir: bin
 cert_chain: []
-date: 2015-06-09 00:00:00.000000000 Z
+date: 2015-10-09 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: power_assert
@@ -113,7 +113,6 @@ files:
 - PSFL
 - README.md
 - Rakefile
-- TODO
 - doc/text/how-to.md
 - doc/text/news.md
 - lib/test-unit.rb
diff --git a/sample/adder.rb b/sample/adder.rb
index aa5c88c..ca1b0f5 100644
--- a/sample/adder.rb
+++ b/sample/adder.rb
@@ -7,7 +7,7 @@ class Adder
     @number = number
   end
   def add(number)
-    return @number + number
+    @number + number
   end
 end
 
diff --git a/sample/subtracter.rb b/sample/subtracter.rb
index 2c08247..b7d3ab8 100644
--- a/sample/subtracter.rb
+++ b/sample/subtracter.rb
@@ -7,6 +7,6 @@ class Subtracter
     @number = number
   end
   def subtract(number)
-    return @number - number
+    @number - number
   end
 end
diff --git a/sample/test_adder.rb b/sample/test_adder.rb
index c1104f8..92c7f4d 100644
--- a/sample/test_adder.rb
+++ b/sample/test_adder.rb
@@ -3,7 +3,7 @@
 # License:: Ruby license.
 
 require 'test/unit'
-require 'adder'
+require_relative 'adder'
 
 class TestAdder < Test::Unit::TestCase
   def setup
diff --git a/sample/test_subtracter.rb b/sample/test_subtracter.rb
index 6fbf423..9c85fae 100644
--- a/sample/test_subtracter.rb
+++ b/sample/test_subtracter.rb
@@ -3,7 +3,7 @@
 # License:: Ruby license.
 
 require 'test/unit'
-require 'subtracter'
+require_relative 'subtracter'
 
 class TestSubtracter < Test::Unit::TestCase
   def setup

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-test-unit.git



More information about the Pkg-ruby-extras-commits mailing list