From a42116b0968cc2f7fe1714564c969ad4674f4f69 Mon Sep 17 00:00:00 2001 From: Bruce Williams Date: Sat, 13 Mar 2010 00:00:11 -0800 Subject: Convert bare repos to working copy repos and vice-versa --- spec/unit/puppet/provider/vcsrepo/svn_spec.rb | 36 +++++++++++++-------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'spec/unit/puppet/provider/vcsrepo/svn_spec.rb') diff --git a/spec/unit/puppet/provider/vcsrepo/svn_spec.rb b/spec/unit/puppet/provider/vcsrepo/svn_spec.rb index 3af06f2..fc5c37b 100644 --- a/spec/unit/puppet/provider/vcsrepo/svn_spec.rb +++ b/spec/unit/puppet/provider/vcsrepo/svn_spec.rb @@ -10,7 +10,7 @@ describe provider_class do @path = '/tmp/vcsrepo' end - context 'when creating' do + describe 'when creating' do context "when a source is given" do context "and when a revision is given" do it "should execute 'svn checkout' with a revision" do @@ -53,7 +53,7 @@ describe provider_class do end end - context 'when destroying' do + describe 'when destroying' do it "it should remove the directory" do @resource.expects(:value).with(:path).returns(@path).at_least_once FileUtils.expects(:rm_rf).with(@path) @@ -61,7 +61,7 @@ describe provider_class do end end - context "when checking existence" do + describe "when checking existence" do it "should check for the directory" do @resource.expects(:value).with(:path).returns(@path) File.expects(:directory?).with(@path) @@ -69,23 +69,21 @@ describe provider_class do end end - describe "revision property" do - context "when checking" do - it "should use 'svn info'" do - @resource.expects(:value).with(:path).returns(@path) - p fixture(:svn_info)[/^Revision:\s+(\d+)/m, 1] - @provider.expects('svn').with('info').returns(fixture(:svn_info)) - Dir.expects(:chdir).with(@path).yields - @provider.revision.should == '4' - end + describe "when checking the revision property" do + it "should use 'svn info'" do + @resource.expects(:value).with(:path).returns(@path) + @provider.expects('svn').with('info').returns(fixture(:svn_info)) + Dir.expects(:chdir).with(@path).yields + @provider.revision.should == '4' end - context "when setting" do - it "should use 'svn update'" do - @resource.expects(:value).with(:path).returns(@path) - @provider.expects('svn').with('update', '-r', '30') - Dir.expects(:chdir).with(@path).yields - @provider.revision = '30' - end + end + + describe "when setting the revision property" do + it "should use 'svn update'" do + @resource.expects(:value).with(:path).returns(@path) + @provider.expects('svn').with('update', '-r', '30') + Dir.expects(:chdir).with(@path).yields + @provider.revision = '30' end end -- cgit v1.2.3