Sha256: fb4656ebd21331be5e264af1ab7295aacbf05459585b3bc42e4ac6abbb3ae76d

Contents?: true

Size: 1.6 KB

Versions: 1

Compression:

Stored size: 1.6 KB

Contents

require_relative '../test_helper'
require 'socket'

module OhlohScm::Adapters
	class SvnPullTest < Scm::Test

		def test_svnadmin_create
			Scm::ScratchDir.new do |dir|
				url = File.join(dir, "my_svn_repo")
				svn = SvnAdapter.new(:url => url).normalize

				assert !svn.exist?
				svn.svnadmin_create
				assert svn.exist?

				# Ensure that revision properties are settable
        # Note that only valid properties can be set
				svn.propset('log','bar')
				assert_equal 'bar', svn.propget('log')
			end
		end

		def test_basic_pull_using_svnsync
			with_svn_repository('svn') do |src|
				Scm::ScratchDir.new do |dest_dir|

					dest = SvnAdapter.new(:url => dest_dir).normalize
					assert !dest.exist?

					dest.pull(src)
					assert dest.exist?

					assert_equal src.log, dest.log
				end
			end
		end

		def test_svnadmin_create_local
			Scm::ScratchDir.new do |dir|
				svn = SvnAdapter.new(:url => "file://#{dir}")
				svn.svnadmin_create_local
				assert svn.exist?
				assert FileTest.exist?(File.join(dir, 'hooks', 'pre-revprop-change'))
				assert FileTest.executable?(File.join(dir, 'hooks', 'pre-revprop-change'))
				svn.run File.join(dir, 'hooks', 'pre-revprop-change')
			end
		end

		def test_svnadmin_create_remote
			Scm::ScratchDir.new do |dir|
				svn = SvnAdapter.new(:url => "svn+ssh://#{Socket.gethostname}#{dir}")
				svn.svnadmin_create_remote
				assert svn.exist?
				assert FileTest.exist?(File.join(dir, 'hooks', 'pre-revprop-change'))
				assert FileTest.executable?(File.join(dir, 'hooks', 'pre-revprop-change'))
				svn.run File.join(dir, 'hooks', 'pre-revprop-change')
			end
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ohloh_scm-2.0.0 test/unit/svn_pull_test.rb