summaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorTravis Fields <travis@puppetlabs.com>2014-05-15 22:32:47 -0700
committerTravis Fields <travis@puppetlabs.com>2014-05-15 22:32:47 -0700
commit2458aba1401ad6336137653f87086e7656625bf7 (patch)
treece259a7fec6733b7406d5f2b4a332cf14842d858 /spec/unit
parenta909fe74c71e7e214087c3c95bb21e6dfd90c940 (diff)
Fix spec tests
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/puppet/provider/vcsrepo/git_spec.rb16
1 files changed, 6 insertions, 10 deletions
diff --git a/spec/unit/puppet/provider/vcsrepo/git_spec.rb b/spec/unit/puppet/provider/vcsrepo/git_spec.rb
index 20aa084..8e296ef 100644
--- a/spec/unit/puppet/provider/vcsrepo/git_spec.rb
+++ b/spec/unit/puppet/provider/vcsrepo/git_spec.rb
@@ -261,10 +261,8 @@ describe Puppet::Type.type(:vcsrepo).provider(:git_provider) do
it "should use 'git fetch' and 'git reset'" do
resource[:revision] = 'feature/foo'
provider.expects(:update_submodules)
- provider.expects(:git).with('branch','--list').returns("* master")
- provider.expects(:git).with('branch', '-a').returns(resource.value(:revision))
+ provider.expects(:git).with('branch', '-a').at_least_once.returns(resource.value(:revision))
provider.expects(:git).with('checkout', '--force', resource.value(:revision))
- provider.expects(:git).with('branch', '-a').returns(resource.value(:revision))
provider.expects(:git).with('reset', '--hard', "origin/#{resource.value(:revision)}")
provider.revision = resource.value(:revision)
end
@@ -273,10 +271,8 @@ describe Puppet::Type.type(:vcsrepo).provider(:git_provider) do
it "should use 'git fetch' and 'git reset'" do
resource[:revision] = 'only/remote'
provider.expects(:update_submodules)
- provider.expects(:git).with('branch','--list').returns("* master")
- provider.expects(:git).with('branch', '-a').returns(resource.value(:revision))
+ provider.expects(:git).with('branch', '-a').at_least_once.returns(resource.value(:revision))
provider.expects(:git).with('checkout', '--force', resource.value(:revision))
- provider.expects(:git).with('branch', '-a').returns(resource.value(:revision))
provider.expects(:git).with('reset', '--hard', "origin/#{resource.value(:revision)}")
provider.revision = resource.value(:revision)
end
@@ -343,7 +339,7 @@ describe Puppet::Type.type(:vcsrepo).provider(:git_provider) do
context "retrieving the current revision" do
before do
expects_chdir
- provider.expects(:git).with('branch','--list').returns("* foo")
+ provider.expects(:git).with('branch','-a').returns("* foo")
end
it "will strip trailing newlines" do
@@ -379,20 +375,20 @@ describe Puppet::Type.type(:vcsrepo).provider(:git_provider) do
end
context 'on master' do
it do
- provider.expects(:git).with('branch','--list').returns("* master")
+ provider.expects(:git).with('branch','-a').returns("* master")
provider.latest.should == 'master'
end
end
context 'no branch' do
it do
- provider.expects(:git).with('branch','--list').returns("* master")
+ provider.expects(:git).with('branch','-a').returns("* master")
provider.latest.should == 'master'
end
end
context 'feature/bar' do
it do
- provider.expects(:git).with('branch','--list').returns("* master")
+ provider.expects(:git).with('branch','-a').returns("* master")
provider.latest.should == 'master'
end
end