summaryrefslogtreecommitdiff
path: root/spec/unit/puppet/provider/vcsrepo/svn_spec.rb
diff options
context:
space:
mode:
authorBruce Williams <bruce@codefluency.com>2010-03-13 00:00:11 -0800
committerBruce Williams <bruce@codefluency.com>2010-03-13 00:00:11 -0800
commita42116b0968cc2f7fe1714564c969ad4674f4f69 (patch)
tree2ad1f4debca2cbcf5c1dd2e1a662a77c2e57bf11 /spec/unit/puppet/provider/vcsrepo/svn_spec.rb
parentabd973080207906c32831ff315b9f7a6d2bcb872 (diff)
Convert bare repos to working copy repos and vice-versa
Diffstat (limited to 'spec/unit/puppet/provider/vcsrepo/svn_spec.rb')
-rw-r--r--spec/unit/puppet/provider/vcsrepo/svn_spec.rb36
1 files changed, 17 insertions, 19 deletions
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