summaryrefslogtreecommitdiff
path: root/spec/unit/puppet/provider/vcsrepo
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/puppet/provider/vcsrepo')
-rw-r--r--spec/unit/puppet/provider/vcsrepo/git_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/unit/puppet/provider/vcsrepo/git_spec.rb b/spec/unit/puppet/provider/vcsrepo/git_spec.rb
index d2769ae..cc369d9 100644
--- a/spec/unit/puppet/provider/vcsrepo/git_spec.rb
+++ b/spec/unit/puppet/provider/vcsrepo/git_spec.rb
@@ -296,4 +296,25 @@ describe Puppet::Type.type(:vcsrepo).provider(:git_provider) do
end
end
+ describe 'latest?' do
+ before do
+ expects_chdir('/tmp/test')
+ end
+ context 'when true' do
+ it do
+ provider.expects(:revision).returns('testrev')
+ provider.expects(:latest).returns('testrev')
+ provider.latest?.should be_true
+ end
+ end
+ context 'when false' do
+ it do
+ provider.expects(:revision).returns('master')
+ provider.expects(:latest).returns('testrev')
+ provider.latest?.should be_false
+ end
+ end
+ end
+
+
end