diff options
author | Ashley Penney <ashley.penney@puppetlabs.com> | 2013-09-18 18:01:13 -0400 |
---|---|---|
committer | Ashley Penney <ashley.penney@puppetlabs.com> | 2013-09-18 18:01:13 -0400 |
commit | c92ede74bedda8b43df17abfe7528d3ddffe951a (patch) | |
tree | f0f4e4fe4ec2bb1d654d09f9a5bf636db4703ed6 /spec/unit | |
parent | aeb3ea63ec561440c02f9d4c4d4c0ac3a1d096c9 (diff) | |
download | puppet-vcsrepo-c92ede74bedda8b43df17abfe7528d3ddffe951a.tar.gz puppet-vcsrepo-c92ede74bedda8b43df17abfe7528d3ddffe951a.tar.bz2 |
Add test for latest?
Also add some fixtures for previous tests.
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/puppet/provider/vcsrepo/git_spec.rb | 21 |
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 |