diff options
author | Bryan Jen <bryan.jen@gmail.com> | 2015-08-04 08:38:54 -0700 |
---|---|---|
committer | Bryan Jen <bryan.jen@gmail.com> | 2015-08-04 08:38:54 -0700 |
commit | 5ef1b4740e1aab6672ee3971762c796c898ca639 (patch) | |
tree | 753956993a40f5a2163746e7181c34cb3201bfaf /spec/acceptance | |
parent | 266b20510b9eec7e8e91096f5aa370ae52a136e7 (diff) | |
parent | d68402d1f930d5a30f1ec9224ac3791b6d9d29b9 (diff) | |
download | puppet-vcsrepo-5ef1b4740e1aab6672ee3971762c796c898ca639.tar.gz puppet-vcsrepo-5ef1b4740e1aab6672ee3971762c796c898ca639.tar.bz2 |
Merge pull request #260 from mhaskel/MODULES-1800
MODULES-1800 - fix case where ensure => latest and no revision specified
Diffstat (limited to 'spec/acceptance')
-rw-r--r-- | spec/acceptance/modules_1800_spec.rb | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/spec/acceptance/modules_1800_spec.rb b/spec/acceptance/modules_1800_spec.rb new file mode 100644 index 0000000..12415e8 --- /dev/null +++ b/spec/acceptance/modules_1800_spec.rb @@ -0,0 +1,41 @@ +require 'spec_helper_acceptance' + +tmpdir = default.tmpdir('vcsrepo') + +describe 'clones a remote repo' do + before(:all) do + my_root = File.expand_path(File.join(File.dirname(__FILE__), '..')) + shell("mkdir -p #{tmpdir}") # win test + end + + after(:all) do + shell("rm -rf #{tmpdir}/vcsrepo") + end + + context 'ensure latest with no revision' do + it 'clones from default remote' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/vcsrepo": + ensure => present, + provider => git, + source => "https://github.com/puppetlabs/puppetlabs-vcsrepo.git", + } + EOS + + apply_manifest(pp, :catch_failures => true) + shell("cd #{tmpdir}/vcsrepo; /usr/bin/git reset --hard HEAD~2") + end + + it 'updates' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/vcsrepo": + ensure => latest, + provider => git, + source => "https://github.com/puppetlabs/puppetlabs-vcsrepo.git", + } + EOS + + apply_manifest(pp, :catch_failures => true) + end + end +end |