You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ph...@apache.org on 2015/11/17 15:20:09 UTC

svn commit: r1714790 - in /subversion/trunk: Makefile.in subversion/bindings/swig/ruby/test/my-assertions.rb subversion/bindings/swig/ruby/test/test_wc.rb

Author: philip
Date: Tue Nov 17 14:20:09 2015
New Revision: 1714790

URL: http://svn.apache.org/viewvc?rev=1714790&view=rev
Log:
Adapt Ruby tests to work with test-unit gem.

Ruby 2.2 bundles the test-unit gem instead of using the older "test-unit
API provided by minitest".  This also fixes testing when the test-unit
gem happens to be installed along with older Ruby versions.

* Makefile.in:
  (check-swig-rb): Detect whether test-unit supports the --collector
   argument and, if so, use the dir collector.

* subversion/bindings/swig/ruby/test/my-assertions.rb:
  (_my_assert_block): Remove unnecessary assert_block.

* subversion/bindings/swig/ruby/test/test_wc.rb:
  (test_context_create): Remove useless assertion on result of
   Svn::Wc::Create, especially since it varies based on Ruby version.

Patch by: James McCoy <jamessan{_AT_}debian.org>

Modified:
    subversion/trunk/Makefile.in
    subversion/trunk/subversion/bindings/swig/ruby/test/my-assertions.rb
    subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb

Modified: subversion/trunk/Makefile.in
URL: http://svn.apache.org/viewvc/subversion/trunk/Makefile.in?rev=1714790&r1=1714789&r2=1714790&view=diff
==============================================================================
--- subversion/trunk/Makefile.in (original)
+++ subversion/trunk/Makefile.in Tue Nov 17 14:20:09 2015
@@ -921,13 +921,15 @@ swig-rb: autogen-swig-rb
 check-swig-rb: swig-rb svnserve
 	$(TEST_SHLIB_VAR_SWIG_RB) \
 	cd $(SWIG_RB_DIR); \
-          if [ "$(RUBY_MAJOR)" -eq 1 -a "$(RUBY_MINOR)" -lt 9 ] ; then \
-            $(RUBY) -I $(SWIG_RB_SRC_DIR) \
-              $(SWIG_RB_SRC_DIR)/test/run-test.rb \
-	      --verbose=$(SWIG_RB_TEST_VERBOSE); \
-          else \
-	    $(RUBY) -I $(SWIG_RB_SRC_DIR) \
-	      $(SWIG_RB_SRC_DIR)/test/run-test.rb; \
+	  check_rb() { \
+	    $(RUBY) -I $(SWIG_RB_SRC_DIR) $(SWIG_RB_SRC_DIR)/test/run-test.rb "$$@"; \
+	  }; \
+	  if check_rb --help 2>&1 | grep -q -- --collector; then \
+	    check_rb --collector=dir --verbose=$(SWIG_RB_TEST_VERBOSE); \
+	  elif [ "$(RUBY_MAJOR)" -eq 1 -a "$(RUBY_MINOR)" -lt 9 ] ; then \
+	    check_rb --verbose=$(SWIG_RB_TEST_VERBOSE); \
+	  else \
+	    check_rb; \
           fi
 
 EXTRACLEAN_SWIG_RB=rm -f $(SWIG_RB_SRC_DIR)/svn_*.c $(SWIG_RB_SRC_DIR)/core.c

Modified: subversion/trunk/subversion/bindings/swig/ruby/test/my-assertions.rb
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/test/my-assertions.rb?rev=1714790&r1=1714789&r2=1714790&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/test/my-assertions.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/test/my-assertions.rb Tue Nov 17 14:20:09 2015
@@ -27,9 +27,7 @@ module Test
       # make an intermediary assertion block handler
       def _my_assert_block(&block)
        if RUBY_VERSION > '1.9'
-         assert_block do
-           yield
-         end
+         yield
        else
          _wrap_assertion do
            yield

Modified: subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb?rev=1714790&r1=1714789&r2=1714790&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb Tue Nov 17 14:20:09 2015
@@ -1068,15 +1068,10 @@ EOE
 
   def test_context_create
     assert_nothing_raised do
-      result = Svn::Wc::Context.create do |context|
+      Svn::Wc::Context.create do |context|
         assert_not_nil context
         assert_kind_of Svn::Wc::Context, context
       end
-      if RUBY_VERSION > '1.9'
-        assert_equal(result,true)
-      else
-        assert_nil result
-      end
     end
   end