diff options
author | Ashley Penney <ashley.penney@puppetlabs.com> | 2013-09-18 18:16:39 -0400 |
---|---|---|
committer | Ashley Penney <ashley.penney@puppetlabs.com> | 2013-09-18 18:16:39 -0400 |
commit | a3d888f1fdd0a4cbd423b8b47f546c2d1decead7 (patch) | |
tree | 6bdea87b45d7db3e0f9860848564641caecce800 /spec/unit/puppet/provider/vcsrepo | |
parent | c92ede74bedda8b43df17abfe7528d3ddffe951a (diff) |
Add latest tests.
Diffstat (limited to 'spec/unit/puppet/provider/vcsrepo')
-rw-r--r-- | spec/unit/puppet/provider/vcsrepo/git_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/unit/puppet/provider/vcsrepo/git_spec.rb b/spec/unit/puppet/provider/vcsrepo/git_spec.rb index cc369d9..1e4704f 100644 --- a/spec/unit/puppet/provider/vcsrepo/git_spec.rb +++ b/spec/unit/puppet/provider/vcsrepo/git_spec.rb @@ -316,5 +316,30 @@ describe Puppet::Type.type(:vcsrepo).provider(:git_provider) do end end + describe 'latest' do + before do + provider.expects(:get_revision).returns('master') + expects_chdir + end + context 'on master' do + it do + provider.expects(:git).with('branch', '-a').returns(fixture(:git_branch_a)) + provider.latest.should == 'master' + end + end + context 'no branch' do + it do + provider.expects(:git).with('branch', '-a').returns(fixture(:git_branch_none)) + provider.latest.should == 'master' + end + end + context 'feature/bar' do + it do + provider.expects(:git).with('branch', '-a').returns(fixture(:git_branch_feature_bar)) + provider.latest.should == 'master' + end + end + end + end |