From e5c36a89e93dd69ce68c567579cd28e8f1c3bc22 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Tue, 29 Apr 2014 00:51:00 +0200 Subject: [PATCH] Test if commit works --- spec/gitolite_admin_spec.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/spec/gitolite_admin_spec.rb b/spec/gitolite_admin_spec.rb index 8030bf1..a8c0948 100644 --- a/spec/gitolite_admin_spec.rb +++ b/spec/gitolite_admin_spec.rb @@ -2,6 +2,7 @@ describe Gitolite::GitoliteAdmin do + conf_dir = File.join(File.dirname(__FILE__), 'fixtures', 'configs') output_dir = '/tmp' # output_dir = File.join(File.dirname(File.dirname(__FILE__)), 'tmp') @@ -32,4 +33,21 @@ end end + describe '#save' do + it 'should commit file to gitolite-admin repository' do + test_dir = File.join(output_dir, 'gitolite-admin-test') + opts = { :overwrite => true } + gl_admin = GitoliteAdmin.bootstrap(test_dir, opts) + + 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(test_dir, 'conf', c.filename) + expect(File.file?(new_file)).to be true + end + end + end