Sha256: 31a6a1c69dfe3e46b4d47e4e1ab3a09df6fd3c199df9be23f2eda21490bd6700

Contents?: true

Size: 1.62 KB

Versions: 35

Compression:

Stored size: 1.62 KB

Contents

require_relative '../test_helper'
require 'socket'

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

		def test_svnadmin_create
			OhlohScm::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|
				OhlohScm::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
			OhlohScm::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
			OhlohScm::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

35 entries across 35 versions & 1 rubygems

Version Path
ohloh_scm-2.4.14 test/unit/svn_pull_test.rb
ohloh_scm-2.4.13 test/unit/svn_pull_test.rb
ohloh_scm-2.4.12 test/unit/svn_pull_test.rb
ohloh_scm-2.4.11 test/unit/svn_pull_test.rb
ohloh_scm-2.4.10 test/unit/svn_pull_test.rb
ohloh_scm-2.4.9 test/unit/svn_pull_test.rb
ohloh_scm-2.4.8 test/unit/svn_pull_test.rb
ohloh_scm-2.4.7 test/unit/svn_pull_test.rb
ohloh_scm-2.4.6 test/unit/svn_pull_test.rb
ohloh_scm-2.4.5 test/unit/svn_pull_test.rb
ohloh_scm-2.4.4 test/unit/svn_pull_test.rb
ohloh_scm-2.4.3 test/unit/svn_pull_test.rb
ohloh_scm-2.4.1 test/unit/svn_pull_test.rb
ohloh_scm-2.4.0 test/unit/svn_pull_test.rb
ohloh_scm-2.3.5 test/unit/svn_pull_test.rb
ohloh_scm-2.3.4 test/unit/svn_pull_test.rb
ohloh_scm-2.3.2 test/unit/svn_pull_test.rb
ohloh_scm-2.3.1 test/unit/svn_pull_test.rb
ohloh_scm-2.3.0 test/unit/svn_pull_test.rb
ohloh_scm-2.2.13 test/unit/svn_pull_test.rb