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 2012/11/08 19:28:39 UTC

svn commit: r1407206 - in /subversion/trunk: ./ subversion/bindings/swig/ruby/svn/ subversion/bindings/swig/ruby/test/ subversion/bindings/swig/ruby/test/test-unit-ext/

Author: philip
Date: Thu Nov  8 18:28:38 2012
New Revision: 1407206

URL: http://svn.apache.org/viewvc?rev=1407206&view=rev
Log:
Initial support for ruby 1.9.3 when creating swig bindings for subversion.

* Makefile.in:
  (check-swig-rb): Ruby 1.8 uses --verbose, 1.9 does not for run-test.rb

* subversion/bindings/swig/ruby/test/test_core.rb:
  (test_time, test_create_commit_info): Updated for ruby1.9 time, which
   uses nanoseconds.
  (test_config_each): Tweak sort.

* subversion/bindings/swig/ruby/test/test_repos.rb:
  (test_create): Ruby1.8 carries the assignment through block, ruby1.9
   does not carry assignments, we need to explicitly do this.

* subversion/bindings/swig/ruby/test/test-unit-ext/priority.rb:
  (TestSuite): Run priority tests only for ruby1.8.

* subversion/bindings/swig/ruby/test/test_delta.rb:
  (test_txdelta_window): Fix nil return in ruby1.9,
  (test_txdelta_window_compose): Ruby1.8 carries the assignment through
   block, ruby1.9 does not carry assignments, we need to explicitly do this
  (test_svndiff): Fix StringIO encoding to be ASCII-8BIT, no longer
   assumed as in ruby1.8.

* subversion/bindings/swig/ruby/test/test-unit-ext.rb:
  (): Turn off some tests for ruby1.9, they should be fixed still.

* subversion/bindings/swig/ruby/test/test_fs.rb:
  (): Update md5 to digest/md5 in require.
  (assert_create): Assignments not carried through block in 1.9.
  (test_root, test_delta): Use new md5 name.

* subversion/bindings/swig/ruby/test/test_wc.rb,
  subversion/bindings/swig/ruby/test/test_client.rb:
  (make_context): Ruby1.8 carries the assignment through block, ruby1.9
   does not carry assignments, we need to explicitly do this.

* subversion/bindings/swig/ruby/test/my-assertions.rb:
  (my_assert_block): New.
  (assert_true, assert_false, assert_nested_sorted_array,
   assert_equal_log_entries): Use it.

* subversion/bindings/swig/ruby/svn/util.rb:
  (to_ruby_class_name): Convert to string before splitting for ruby1.9
   compat.

* subversion/bindings/swig/ruby/svn/info.rb:
  (parse_diff): Use each_line for ruby1.9 and each for ruby1.8.

* configure.ac:
  Detect ruby1.9.3 - added teeny version detection restrict build
  to 1.8.x and >= 1.9.3.

Patch by: Michael Chletsos <mp...@gmail.com>,
          Vincent Batts <vb...@slackware.com>

Modified:
    subversion/trunk/Makefile.in
    subversion/trunk/configure.ac
    subversion/trunk/subversion/bindings/swig/ruby/svn/info.rb
    subversion/trunk/subversion/bindings/swig/ruby/svn/util.rb
    subversion/trunk/subversion/bindings/swig/ruby/test/my-assertions.rb
    subversion/trunk/subversion/bindings/swig/ruby/test/test-unit-ext.rb
    subversion/trunk/subversion/bindings/swig/ruby/test/test-unit-ext/priority.rb
    subversion/trunk/subversion/bindings/swig/ruby/test/test_client.rb
    subversion/trunk/subversion/bindings/swig/ruby/test/test_core.rb
    subversion/trunk/subversion/bindings/swig/ruby/test/test_delta.rb
    subversion/trunk/subversion/bindings/swig/ruby/test/test_fs.rb
    subversion/trunk/subversion/bindings/swig/ruby/test/test_repos.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=1407206&r1=1407205&r2=1407206&view=diff
==============================================================================
--- subversion/trunk/Makefile.in (original)
+++ subversion/trunk/Makefile.in Thu Nov  8 18:28:38 2012
@@ -842,9 +842,14 @@ swig-rb: autogen-swig-rb
 check-swig-rb: swig-rb svnserve
 	$(TEST_SHLIB_VAR_SWIG_RB) \
 	cd $(SWIG_RB_DIR); \
-	  $(RUBY) -I $(SWIG_RB_SRC_DIR) \
-	    $(SWIG_RB_SRC_DIR)/test/run-test.rb \
-	    --verbose=$(SWIG_RB_TEST_VERBOSE)
+          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; \
+          fi
 
 EXTRACLEAN_SWIG_RB=rm -f $(SWIG_RB_SRC_DIR)/svn_*.c $(SWIG_RB_SRC_DIR)/core.c
 

Modified: subversion/trunk/configure.ac
URL: http://svn.apache.org/viewvc/subversion/trunk/configure.ac?rev=1407206&r1=1407205&r2=1407206&view=diff
==============================================================================
--- subversion/trunk/configure.ac (original)
+++ subversion/trunk/configure.ac Thu Nov  8 18:28:38 2012
@@ -1145,7 +1145,7 @@ AC_PATH_PROG(PERL, perl, none)
 if test -n "$RUBY"; then
   AC_PATH_PROG(RUBY, "$RUBY", none)
 else
-  AC_PATH_PROGS(RUBY, ruby ruby1.8 ruby18, none)
+  AC_PATH_PROGS(RUBY, ruby ruby1.8 ruby18 ruby1.9 ruby1 ruby1.9.3 ruby193, none)
 fi
 if test "$RUBY" != "none"; then
   AC_MSG_CHECKING([rb_hash_foreach])
@@ -1154,7 +1154,7 @@ if test "$RUBY" != "none"; then
     if test -n "$RDOC"; then
       AC_PATH_PROG(RDOC, "$RDOC", none)
     else
-      AC_PATH_PROGS(RDOC, rdoc rdoc1.8 rdoc18, none)
+      AC_PATH_PROGS(RDOC, rdoc rdoc1.8 rdoc18 rdoc1.9 rdoc19 rdoc1.9.3 rdoc193, none)
     fi
     AC_CACHE_CHECK([for Ruby major version], [svn_cv_ruby_major],[
     svn_cv_ruby_major="`$RUBY -rrbconfig -e 'print RbConfig::CONFIG.fetch(%q(MAJOR))'`"
@@ -1166,14 +1166,23 @@ if test "$RUBY" != "none"; then
     ])
     RUBY_MINOR="$svn_cv_ruby_minor"
 
+    AC_CACHE_CHECK([for Ruby teeny version], [svn_cv_ruby_teeny],[
+    svn_cv_ruby_teeny="`$RUBY -rrbconfig -e 'major, minor, teeny = RUBY_VERSION.split("."); print teeny;'`"
+    ])
+    RUBY_TEENY="$svn_cv_ruby_teeny"
+    
     AC_SUBST(RUBY_MAJOR)
     AC_SUBST(RUBY_MINOR)
-    if test ! \( "$RUBY_MAJOR" -eq "1" -a "$RUBY_MINOR" -eq "8" \); then
-      # Disallow Ruby 1.9 or later until the binding tests get fixed
-      # to run with those versions.
+    AC_SUBST(RUBY_TEENY)
+    if test \( "$RUBY_MAJOR" -eq "1" -a "$RUBY_MINOR" -gt "8" -a "$RUBY_TEENY" -lt "3" \); then
+      # Disallow Ruby between 1.8.7 and 1.9.3
       RUBY="none"
-      AC_MSG_WARN([The detected Ruby is too new for Subversion to use])
-      AC_MSG_WARN([Only 1.8.x releases are supported at this time])
+      AC_MSG_WARN([The detected Ruby is between 1.9 and 1.9.3])
+      AC_MSG_WARN([Only 1.8.x and 1.9.3 releases are supported at this time])
+    elif test \(  "$RUBY_MAJOR" -eq "1" -a "$RUBY_MINOR" -eq "9" -a "$RUBY_TEENY" -eq "3" \); then
+      #Warn about 1.9.3 support
+      AC_MSG_WARN([WARNING: The detected Ruby is 1.9.3])
+      AC_MSG_WARN([WARNING: Only 1.8.x releases are fully supported, 1.9.3 support is new])
     fi
   else
     AC_MSG_RESULT([no])

Modified: subversion/trunk/subversion/bindings/swig/ruby/svn/info.rb
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/svn/info.rb?rev=1407206&r1=1407205&r2=1407206&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/svn/info.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/svn/info.rb Thu Nov  8 18:28:38 2012
@@ -229,7 +229,9 @@ module Svn
 
     def parse_diff_unified(entry)
       in_content = false
-      entry.body.each do |line|
+      # ruby 1.8 and ruby 1.9 compat
+      each_meth = entry.body.respond_to?(:each_line) ? :each_line : :each
+      entry.body.send(each_meth) do |line|
         case line
         when /^@@/
           in_content = true

Modified: subversion/trunk/subversion/bindings/swig/ruby/svn/util.rb
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/svn/util.rb?rev=1407206&r1=1407205&r2=1407206&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/svn/util.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/svn/util.rb Thu Nov  8 18:28:38 2012
@@ -36,7 +36,7 @@ module Svn
   module Util #:nodoc:
     module_function
     def to_ruby_class_name(name)
-      name.split("_").collect do |x|
+      name.to_s.split("_").collect do |x|
         "#{x[0,1].upcase}#{x[1..-1].downcase}"
       end.join("")
     end

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=1407206&r1=1407205&r2=1407206&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/test/my-assertions.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/test/my-assertions.rb Thu Nov  8 18:28:38 2012
@@ -24,20 +24,33 @@ module Test
   module Unit
     module Assertions
 
+      # make an intermediary assertion block handler
+      def _my_assert_block(&block)
+       if RUBY_VERSION > '1.9'
+         assert_block do
+           yield
+         end
+       else
+         _wrap_assertion do
+           yield
+         end
+       end
+      end
+
       def assert_true(boolean, message=nil)
-        _wrap_assertion do
+        _my_assert_block do
           assert_equal(true, boolean, message)
         end
       end
 
       def assert_false(boolean, message=nil)
-        _wrap_assertion do
+        _my_assert_block do
           assert_equal(false, boolean, message)
         end
       end
 
       def assert_nested_sorted_array(expected, actual, message=nil)
-        _wrap_assertion do
+        _my_assert_block do
           assert_equal(expected.collect {|elem| elem.sort},
                        actual.collect {|elem| elem.sort},
                        message)
@@ -45,7 +58,7 @@ module Test
       end
 
       def assert_equal_log_entries(expected, actual, message=nil)
-        _wrap_assertion do
+        _my_assert_block do
           actual = actual.collect do |entry|
             changed_paths = entry.changed_paths
             changed_paths.each_key do |path|

Modified: subversion/trunk/subversion/bindings/swig/ruby/test/test-unit-ext.rb
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/test/test-unit-ext.rb?rev=1407206&r1=1407205&r2=1407206&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/test/test-unit-ext.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/test/test-unit-ext.rb Thu Nov  8 18:28:38 2012
@@ -17,7 +17,7 @@
 #    under the License.
 # ====================================================================
 
-require "test-unit-ext/always-show-result"
+require "test-unit-ext/always-show-result" if RUBY_VERSION < '1.9.3'
 require "test-unit-ext/priority"
-require "test-unit-ext/backtrace-filter"
-require "test-unit-ext/long-display-for-emacs"
+require "test-unit-ext/backtrace-filter" if RUBY_VERSION < '1.9.3'
+require "test-unit-ext/long-display-for-emacs" if RUBY_VERSION < '1.9.3'

Modified: subversion/trunk/subversion/bindings/swig/ruby/test/test-unit-ext/priority.rb
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/test/test-unit-ext/priority.rb?rev=1407206&r1=1407205&r2=1407206&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/test/test-unit-ext/priority.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/test/test-unit-ext/priority.rb Thu Nov  8 18:28:38 2012
@@ -179,7 +179,7 @@ module Test
         apply_priority
         !@tests.empty?
       end
-    end
+    end if RUBY_VERSION < '1.9.3'
 
     class AutoRunner
       alias_method :original_options, :options

Modified: subversion/trunk/subversion/bindings/swig/ruby/test/test_client.rb
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/test/test_client.rb?rev=1407206&r1=1407205&r2=1407206&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/test/test_client.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/test/test_client.rb Thu Nov  8 18:28:38 2012
@@ -2203,7 +2203,10 @@ class SvnClientTest < Test::Unit::TestCa
 
     make_context(log) do |ctx|
       items = nil
-      ctx.set_log_msg_func do |items|
+      ctx.set_log_msg_func do |l_items|
+        # ruby 1.8 will carry the assignment of items out of the 
+        # scope of this block, 1.9 will not, so we must assign.
+        items = l_items
         [true, log]
       end
 

Modified: subversion/trunk/subversion/bindings/swig/ruby/test/test_core.rb
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/test/test_core.rb?rev=1407206&r1=1407205&r2=1407206&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/test/test_core.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/test/test_core.rb Thu Nov  8 18:28:38 2012
@@ -1,3 +1,4 @@
+# encoding = utf-8
 # ====================================================================
 #    Licensed to the Apache Software Foundation (ASF) under one
 #    or more contributor license agreements.  See the NOTICE file
@@ -52,7 +53,13 @@ class SvnCoreTest < Test::Unit::TestCase
     now = Time.now.gmtime
     str = now.strftime("%Y-%m-%dT%H:%M:%S.") + "#{now.usec}Z"
 
-    assert_equal(now, Time.from_svn_format(str))
+    if RUBY_VERSION > '1.9'
+      # ruby 1.9 Time comparison gets into the nano-seconds, strftime
+      # shaves these off. So we can compare epoch time instead
+      assert_equal(now.to_i, Time.from_svn_format(str).gmtime.to_i)
+    else
+      assert_equal(now, Time.from_svn_format(str).gmtime)
+    end
 
     apr_time = now.to_i * 1000000 + now.usec
     assert_equal(apr_time, now.to_apr_time)
@@ -244,7 +251,11 @@ class SvnCoreTest < Test::Unit::TestCase
       config_infos << [section, name, value]
     end
     assert_equal(infos.sort, config_infos.sort)
-    assert_equal(infos.sort, config.collect {|args| args}.sort)
+    if RUBY_VERSION > '1.9'
+      assert_equal(infos.sort, config.collect {|sect,name,val| [sect,name,val]}.sort)
+    else
+      assert_equal(infos.sort, config.collect {|args| args}.sort)
+    end
   end
 
   def test_config_find_group
@@ -532,7 +543,13 @@ EOD
     date_str = now.strftime("%Y-%m-%dT%H:%M:%S")
     date_str << ".#{now.usec}Z"
     info.date = date_str
-    assert_equal(now, info.date)
+    if RUBY_VERSION > '1.9'
+      # ruby 1.9 Time comparison gets into the nano-seconds, strftime
+      # shaves these off. So we can compare epoch time instead
+      assert_equal(now.to_i, info.date.gmtime.to_i)
+    else
+      assert_equal(now, info.date.gmtime)
+    end
   end
 
   def test_svn_prop

Modified: subversion/trunk/subversion/bindings/swig/ruby/test/test_delta.rb
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/test/test_delta.rb?rev=1407206&r1=1407205&r2=1407206&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/test/test_delta.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/test/test_delta.rb Thu Nov  8 18:28:38 2012
@@ -1,3 +1,4 @@
+# encoding: UTF-8
 # ====================================================================
 #    Licensed to the Apache Software Foundation (ASF) under one
 #    or more contributor license agreements.  See the NOTICE file
@@ -17,9 +18,10 @@
 #    under the License.
 # ====================================================================
 
+require "my-assertions"
 require "util"
 require "stringio"
-require 'md5'
+require 'digest/md5'
 require 'tempfile'
 
 require "svn/info"
@@ -46,8 +48,8 @@ class SvnDeltaTest < Test::Unit::TestCas
     target = StringIO.new(t)
     stream = Svn::Delta::TextDeltaStream.new(source, target)
     assert_nil(stream.md5_digest)
-    _wrap_assertion do
-      stream.each do |window|
+    _my_assert_block do
+      ret = stream.each do |window|
         window.ops.each do |op|
           op_size = op.offset + op.length
           case op.action_code
@@ -62,8 +64,9 @@ class SvnDeltaTest < Test::Unit::TestCas
           end
         end
       end
+      true if RUBY_VERSION > '1.9' # this block returns nil in > ruby '1.9'
     end
-    assert_equal(MD5.new(t).hexdigest, stream.md5_digest)
+    assert_equal(Digest::MD5.hexdigest(t), stream.md5_digest)
   end
 
   def test_txdelta_window_compose
@@ -81,7 +84,7 @@ class SvnDeltaTest < Test::Unit::TestCas
       end
     end
 
-    _wrap_assertion do
+    _my_assert_block do
       composed_window.ops.each do |op|
         op_size = op.offset + op.length
         case op.action_code
@@ -161,21 +164,33 @@ class SvnDeltaTest < Test::Unit::TestCas
     assert_equal(target_text * 3, apply_result.read)
   end
 
+  def get_regex(pattern, encoding='ASCII', options=0)
+    Regexp.new(pattern.encode(encoding),options)
+  end
+
   def test_svndiff
     source_text = "abcde"
     target_text = "abXde"
     source = StringIO.new(source_text)
     target = StringIO.new(target_text)
     stream = Svn::Delta::TextDeltaStream.new(source, target)
-
-    output = StringIO.new("")
+    
+    if RUBY_VERSION > '1.9' 
+      output = StringIO.new("".encode('ASCII-8BIT'))
+    else
+      output = StringIO.new("")
+    end
     handler = Svn::Delta.svndiff_handler(output)
 
     Svn::Delta.send(target_text, handler)
     output.rewind
     result = output.read
-    assert_match(/\ASVN.*#{target_text}\z/, result)
-
+    if RUBY_VERSION > '1.9' 
+      regex = get_regex("\\ASVN.*#{target_text}\\Z".encode('utf-8'),result.encoding,16)
+      assert_match(regex, result)
+    else
+      assert_match(/\ASVN.*#{target_text}\Z/, result)
+    end
     # skip svndiff window
     input = StringIO.new(result[4..-1])
     window = Svn::Delta.read_svndiff_window(input, 0)

Modified: subversion/trunk/subversion/bindings/swig/ruby/test/test_fs.rb
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/test/test_fs.rb?rev=1407206&r1=1407205&r2=1407206&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/test/test_fs.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/test/test_fs.rb Thu Nov  8 18:28:38 2012
@@ -20,7 +20,7 @@
 require "my-assertions"
 require "util"
 require "time"
-require "md5"
+require "digest/md5"
 
 require "svn/core"
 require "svn/fs"
@@ -49,14 +49,15 @@ class SvnFsTest < Test::Unit::TestCase
 
     assert(!File.exist?(path))
     fs = nil
-    callback = Proc.new do |fs|
+    callback = Proc.new do |t_fs|
       assert(File.exist?(path))
       assert_equal(fs_type, Svn::Fs.type(path))
-      fs.set_warning_func do |err|
+      t_fs.set_warning_func do |err|
         p err
         abort
       end
-      assert_equal(path, fs.path)
+      assert_equal(path, t_fs.path)
+      fs = t_fs
     end
     yield(:create, [path, config], callback)
 
@@ -162,7 +163,7 @@ class SvnFsTest < Test::Unit::TestCase
 
       assert_equal(src, @fs.root.file_contents(path_in_repos){|f| f.read})
       assert_equal(src.length, @fs.root.file_length(path_in_repos))
-      assert_equal(MD5.new(src).hexdigest,
+      assert_equal(Digest::MD5.hexdigest(src),
                    @fs.root.file_md5_checksum(path_in_repos))
 
       assert_equal([path_in_repos], @fs.root.paths_changed.keys)
@@ -364,7 +365,7 @@ class SvnFsTest < Test::Unit::TestCase
 
       File.open(path, "w") {|f| f.print(modified)}
       @fs.transaction do |txn|
-        checksum = MD5.new(normalize_line_break(result)).hexdigest
+        checksum = Digest::MD5.hexdigest(normalize_line_break(result))
         stream = txn.root.apply_text(path_in_repos, checksum)
         stream.write(normalize_line_break(result))
         stream.close
@@ -392,8 +393,8 @@ class SvnFsTest < Test::Unit::TestCase
 
       File.open(path, "w") {|f| f.print(modified)}
       @fs.transaction do |txn|
-        base_checksum = MD5.new(normalize_line_break(src)).hexdigest
-        checksum = MD5.new(normalize_line_break(result)).hexdigest
+        base_checksum = Digest::MD5.hexdigest(normalize_line_break(src))
+        checksum = Digest::MD5.hexdigest(normalize_line_break(result))
         handler = txn.root.apply_textdelta(path_in_repos,
                                            base_checksum, checksum)
         assert_raises(Svn::Error::ChecksumMismatch) do

Modified: subversion/trunk/subversion/bindings/swig/ruby/test/test_repos.rb
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/ruby/test/test_repos.rb?rev=1407206&r1=1407205&r2=1407206&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/test/test_repos.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/test/test_repos.rb Thu Nov  8 18:28:38 2012
@@ -98,11 +98,12 @@ class SvnReposTest < Test::Unit::TestCas
     fs_type = Svn::Fs::TYPE_FSFS
     fs_config = {Svn::Fs::CONFIG_FS_TYPE => fs_type}
     repos = nil
-    Svn::Repos.create(tmp_repos_path, {}, fs_config) do |repos|
+    Svn::Repos.create(tmp_repos_path, {}, fs_config) do |t_repos|
       assert(File.exist?(tmp_repos_path))
-      fs_type_path = File.join(repos.fs.path, Svn::Fs::CONFIG_FS_TYPE)
+      fs_type_path = File.join(t_repos.fs.path, Svn::Fs::CONFIG_FS_TYPE)
       assert_equal(fs_type, File.open(fs_type_path) {|f| f.read.chop})
-      repos.fs.set_warning_func(&warning_func)
+      t_repos.fs.set_warning_func(&warning_func)
+      repos = t_repos
     end
 
     assert(repos.closed?)

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=1407206&r1=1407205&r2=1407206&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb (original)
+++ subversion/trunk/subversion/bindings/swig/ruby/test/test_wc.rb Thu Nov  8 18:28:38 2012
@@ -534,7 +534,7 @@ EOE
       ctx.ci(lf_path)
 
       Svn::Wc::AdmAccess.open(nil, @wc_path, true, 5) do |access|
-        _wrap_assertion do
+        _my_assert_block do
           File.open(src_path, "wb") {|f| f.print(source)}
           args = [method_name, src_path, crlf_path, Svn::Wc::TRANSLATE_FROM_NF]
           result = yield(access.send(*args), source)
@@ -1089,7 +1089,11 @@ EOE
         assert_not_nil context
         assert_kind_of Svn::Wc::Context, context
       end
-      assert_nil result;
+      if RUBY_VERSION > '1.9'
+        assert_equal(result,true)
+      else
+        assert_nil result
+      end
     end
   end