From 818f5298b6be3b1a25e997ba84eae237d9051be9 Mon Sep 17 00:00:00 2001 From: Hunter Haugen Date: Fri, 20 Jun 2014 13:48:02 -0700 Subject: Update noop to work --- spec/acceptance/clone_repo_spec.rb | 40 ++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) (limited to 'spec/acceptance') diff --git a/spec/acceptance/clone_repo_spec.rb b/spec/acceptance/clone_repo_spec.rb index a989661..23b0b31 100644 --- a/spec/acceptance/clone_repo_spec.rb +++ b/spec/acceptance/clone_repo_spec.rb @@ -318,6 +318,36 @@ describe 'clones a remote repo' do describe file("#{tmpdir}/testrepo_force/.git") do it { should be_directory } end + + context 'and noop' do + let(:repo_name) do + 'testrepo_already_exists' + end + before(:all) do + shell("mkdir #{tmpdir}/#{repo_name}") + shell("cd #{tmpdir}/#{repo_name} && git init") + shell("cd #{tmpdir}/#{repo_name} && touch a && git add a && git commit -m 'a'") + end + after(:all) do + shell("rm -rf #{tmpdir}/#{repo_name}") + end + + it 'applies the manifest' do + pp = <<-EOS + vcsrepo { "#{tmpdir}/#{repo_name}": + ensure => present, + source => "file://#{tmpdir}/testrepo.git", + provider => git, + force => true, + noop => true, + } + EOS + + apply_manifest_on(host, pp, :catch_changes => true) do |r| + expect(r.stdout).to match(/Noop Mode/) + end + end + end end context 'as a user' do @@ -474,15 +504,5 @@ describe 'clones a remote repo' do apply_manifest(pp, :catch_failures => true) apply_manifest(pp, :catch_changes => true) end - - after(:all) do - pp = <<-EOS - user { 'testuser-ssh': - ensure => absent, - managehome => true, - } - EOS - apply_manifest(pp, :catch_failures => true) - end end end -- cgit v1.2.3