Sha256: c128fcc60faee424ecf123998c85f2c9e949f8d01dcf219e708294698d728f4f
Contents?: true
Size: 1.27 KB
Versions: 1
Compression:
Stored size: 1.27 KB
Contents
require 'spec_helper' describe Gitolite::GitoliteAdmin do conf_dir = File.join(File.dirname(__FILE__), 'fixtures', 'configs') repo_dir = File.join(File.dirname(__FILE__), 'fixtures', 'gitolite-admin') # Rugged doesn't complain when giving nil keys for testing settings = {private_key: nil, public_key: nil, update_on_init: false} describe '#is_gitolite_admin_repo?' do it 'should detect a non gitolite-admin repository' do expect(GitoliteAdmin.is_gitolite_admin_repo?('/tmp')).to be false end end describe '#save' do it 'should commit file to gitolite-admin repository' do Dir.mktmpdir('gitolite-rugged-admin-repo') do |dir| tmp_repo = File.join(dir, "gitolite-admin") FileUtils.cp_r(repo_dir, tmp_repo) FileUtils.mv(File.join(tmp_repo, ".gitted"), File.join(tmp_repo, '.git')) gl_admin = GitoliteAdmin.new(tmp_repo, settings) c = Gitolite::Config.new(File.join(conf_dir, 'complicated.conf')) c.filename = 'gitolite.conf' gl_admin.config = c gl_admin.save new_file = File.join(tmp_repo, 'conf', c.filename) expect(File.file?(new_file)).to be true expect(IO.read(new_file)).to eq IO.read(File.join(conf_dir, 'complicated-output.conf')) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
gitolite-rugged-1.2.2 | spec/gitolite_admin_spec.rb |