Author: breser Date: Tue Jun 24 02:53:58 2014 New Revision: 1604999 URL: http://svn.apache.org/r1604999 Log: Followup to r1603388: Fix ruby bindings tests for the new commit_finalizing notification.
* subversion/bindings/swig/ruby/test/test_client.rb: (assert_mkdir_with_multiple_paths, test_mkdir_p): Ignore notifications of the type Svn::Wc::NOTIFY_COMMIT_FINALIZING when producing the array of notifications to assert on. (test_copy, test_move, test_move_force): Expect the notification on '.' for the commit finalization, being careful to not expand the '.' path. Found by: stsp Modified: subversion/trunk/subversion/bindings/swig/ruby/test/test_client.rb 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=1604999&r1=1604998&r2=1604999&view=diff ============================================================================== --- subversion/trunk/subversion/bindings/swig/ruby/test/test_client.rb (original) +++ subversion/trunk/subversion/bindings/swig/ruby/test/test_client.rb Tue Jun 24 02:53:58 2014 @@ -179,7 +179,9 @@ class SvnClientTest < Test::Unit::TestCa infos = [] ctx.set_notify_func do |notify| - infos << [notify.path, notify] + if notify.action != Svn::Wc::NOTIFY_COMMIT_FINALIZING + infos << [notify.path, notify] + end end assert_equal([false, false], dirs_path.collect {|path| path.exist?}) @@ -223,7 +225,9 @@ class SvnClientTest < Test::Unit::TestCa infos = [] ctx.set_notify_func do |notify| - infos << [notify.path, notify] + if notify.action != Svn::Wc::NOTIFY_COMMIT_FINALIZING + infos << [notify.path, notify] + end end assert_equal([false, false], [dir_path.exist?, child_dir_path.exist?]) @@ -1228,10 +1232,12 @@ class SvnClientTest < Test::Unit::TestCa end ctx.ci(@wc_path) - assert_equal([full_path2.to_s].sort, + assert_equal([full_path2.to_s, '.'].sort, infos.collect{|path, notify| path}.sort) path2_notify = infos.assoc(full_path2.to_s)[1] assert(path2_notify.commit_added?) + finalizing_notify = infos.assoc('.')[1] + assert(finalizing_notify.action == Svn::Wc::NOTIFY_COMMIT_FINALIZING) assert_equal(File.open(path1) {|f| f.read}, File.open(path2) {|f| f.read}) end @@ -1259,12 +1265,16 @@ class SvnClientTest < Test::Unit::TestCa end ctx.ci(@wc_path) - assert_equal([path1, path2].sort.collect{|p|File.expand_path(p)}, + assert_equal([path1, path2].collect do |p| + File.expand_path(p) + end.push('.').sort, infos.collect{|path, notify| path}.sort) path1_notify = infos.assoc(File.expand_path(path1))[1] assert(path1_notify.commit_deleted?) path2_notify = infos.assoc(File.expand_path(path2))[1] assert(path2_notify.commit_added?) + finalizing_notify = infos.assoc('.')[1] + assert(finalizing_notify.action == Svn::Wc::NOTIFY_COMMIT_FINALIZING) assert_equal(src, File.open(path2) {|f| f.read}) end end @@ -1303,7 +1313,9 @@ class SvnClientTest < Test::Unit::TestCa paths = notifies.collect do |notify| notify.path end - assert_equal([path1, path2, path2].sort.collect{|p|File.expand_path(p)}, + assert_equal([path1, path2, path2].collect do |p| + File.expand_path(p) + end.push('.').sort, paths.sort) deleted_paths = notifies.find_all do |notify| @@ -1330,6 +1342,13 @@ class SvnClientTest < Test::Unit::TestCa assert_equal([path2].sort.collect{|p|File.expand_path(p)}, postfix_txdelta_paths.sort) + finalizing_paths = notifies.find_all do |notify| + notify.action == Svn::Wc::NOTIFY_COMMIT_FINALIZING + end.collect do |notify| + notify.path + end + assert_equal(['.'], finalizing_paths) + assert_equal(src2, File.open(path2) {|f| f.read}) end end