3 describe_provider :vcsrepo, :svn, :resource => {:path => '/tmp/vcsrepo'} do
6 resource_with :source do
7 resource_with :revision do
8 it "should execute 'svn checkout' with a revision" do
9 provider.expects(:svn).with('--non-interactive', 'checkout', '-r',
10 resource.value(:revision),
11 resource.value(:source),
12 resource.value(:path))
16 resource_without :revision do
17 it "should just execute 'svn checkout' without a revision" do
18 provider.expects(:svn).with('--non-interactive', 'checkout',
19 resource.value(:source),
20 resource.value(:path))
25 resource_without :source do
26 resource_with :fstype do
27 it "should execute 'svnadmin create' with an '--fs-type' option" do
28 provider.expects(:svnadmin).with('create', '--fs-type',
29 resource.value(:fstype),
30 resource.value(:path))
34 resource_without :fstype do
35 it "should execute 'svnadmin create' without an '--fs-type' option" do
36 provider.expects(:svnadmin).with('create', resource.value(:path))
43 describe 'destroying' do
44 it "it should remove the directory" do
50 describe "checking existence" do
51 it "should check for the directory" do
52 expects_directory?(true, resource.value(:path))
53 expects_directory?(true, File.join(resource.value(:path), '.svn'))
58 describe "checking the revision property" do
60 provider.expects(:svn).with('--non-interactive', 'info').returns(fixture(:svn_info))
62 it "should use 'svn info'" do
64 provider.revision.should == '4' # From 'Revision', not 'Last Changed Rev'
68 describe "setting the revision property" do
72 resource_without :source do
73 it "should use 'svn update'" do
75 provider.expects(:svn).with('--non-interactive', 'update', '-r', @revision)
76 provider.revision = @revision
81 describe "setting the revision property and repo source" do
85 resource_with :source do
86 it "should use 'svn switch'" do
88 provider.expects(:svn).with('--non-interactive', 'switch', '-r', @revision, 'an-unimportant-value')
89 provider.revision = @revision