importing_test.rb revision a9a0428a54199be3b810a0871c947383c2f916d3
require 'test_helper'
teardown do
end
context 'an imported repository' do
context 'via git' do
setup do
@source_path = '/tmp/ontohub/test/unit/repository/repo'
@commit_count = 2
@commit_count.times do |n|
end
@repository = Repository.import_remote('git', @user, "file://#{@source_path}", 'local import', description: 'just an imported repo')
end
should 'be read_only' do
end
should 'have all the commits' do
end
should 'have source-type git' do
end
should 'have correct source address' do
end
should 'save the ontologies in the database' do
end
should 'save ontology versions in the database' do
@repository.ontologies.each do |o|
end
end
context 'getting synchronized' do
setup do
@commit_count.times do |n|
m = n+@commit_count
end
@repository.user = @user # it's crucial to set the user to the current user when synchronizing a repository
end
should 'get the new changes' do
end
should 'save the ontologies in the database' do
end
should 'save ontology versions in the database' do
@repository.ontologies.each do |o|
end
end
end
end
context 'via svn' do
setup do
svn_server_name = 'server'
svn_client_name = 'client'
@url_svn_server = "file://#{@path_svn}/#{svn_server_name}"
@path_svn_client = "#{@path_svn}/#{svn_client_name}"
@commit_count = 2
stdin, stdout, stderr, wait_thr = Open3.popen3('bash', SCRIPT_SVN_CREATE_REPO, @path_svn, svn_server_name, svn_client_name)
stdin, stdout, stderr, wait_thr = Open3.popen3('bash', SCRIPT_SVN_ADD_COMMITS, @path_svn_client, "#{@commit_count}")
@repository = Repository.import_remote('svn', @user, @url_svn_server, 'local svn clone', description: 'just a local svn clone')
end
should 'be read_only' do
end
should 'have correct source type' do
end
should 'have correct source address' do
end
should 'be successful' do
end
should 'save the ontologies in the database' do
end
should 'save ontology versions in the database' do
@repository.ontologies.each do |o|
end
end
end
end
end