describe "setting the revision property" do
it "should use 'bzr update -r' with the revision" do
revision = 'somerev'
- provider.expects('bzr').with('update', '-r', revision, resource.value(:path))
+ provider.expects(:bzr).with('update', '-r', revision, resource.value(:path))
provider.revision = revision
end
end
it "should use 'cvs update -dr'" do
expects_chdir
- provider.expects('cvs').with('update', '-dr', @tag, '.')
+ provider.expects(:cvs).with('update', '-dr', @tag, '.')
provider.revision = @tag
end
end
resource_with :ensure => :present do
context "with a revision that is a remote branch", :resource => {:revision => 'only/remote'} do
it "should execute 'git clone' and 'git checkout -b'" do
- provider.expects('git').with('clone', resource.value(:source), resource.value(:path))
+ provider.expects(:git).with('clone', resource.value(:source), resource.value(:path))
expects_chdir
provider.expects(:update_submodules)
provider.expects(:git).with('branch', '-a').returns(resource.value(:revision))
end
context "with a revision that is not a remote branch", :resource => {:revision => 'a-commit-or-tag'} do
it "should execute 'git clone' and 'git reset --hard'" do
- provider.expects('git').with('clone', resource.value(:source), resource.value(:path))
+ provider.expects(:git).with('clone', resource.value(:source), resource.value(:path))
expects_chdir
provider.expects(:update_submodules)
provider.expects(:git).with('branch', '-a').returns(resource.value(:revision))
end
it "should use 'hg update ---clean -r'" do
expects_chdir
- provider.expects('hg').with('pull')
- provider.expects('hg').with('merge')
- provider.expects('hg').with('update', '--clean', '-r', @revision)
+ provider.expects(:hg).with('pull')
+ provider.expects(:hg).with('merge')
+ provider.expects(:hg).with('update', '--clean', '-r', @revision)
provider.revision = @revision
end
end
describe "checking the revision property" do
before do
- provider.expects('svn').with('--non-interactive', 'info').returns(fixture(:svn_info))
+ provider.expects(:svn).with('--non-interactive', 'info').returns(fixture(:svn_info))
end
it "should use 'svn info'" do
expects_chdir
end
it "should use 'svn update'" do
expects_chdir
- provider.expects('svn').with('--non-interactive', 'update', '-r', @revision)
+ provider.expects(:svn).with('--non-interactive', 'update', '-r', @revision)
provider.revision = @revision
end
end