1 require 'pathname'; Pathname.new(__FILE__).realpath.ascend { |x| begin; require (x + 'spec_helper.rb'); break; rescue LoadError; end }
3 describe_provider :vcsrepo, :svn, :resource => {:path => '/tmp/vcsrepo'} do
6 context_with_resource :source do
7 context_with_resource :revision do
8 it "should execute 'svn checkout' with a revision" do
9 provider.expects(:svn).with('checkout', '-r',
10 resource.value(:revision),
11 resource.value(:source),
12 resource.value(:path))
16 context_without_resource :revision do
17 it "should just execute 'svn checkout' without a revision" do
18 provider.expects(:svn).with('checkout',
19 resource.value(:source),
20 resource.value(:path))
25 context_without_resource :source do
26 context_with_resource :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 context_without_resource :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, File.join(resource.value(:path), '.svn'))
57 describe "checking the revision property" do
59 provider.expects('svn').with('info').returns(fixture(:svn_info))
61 it "should use 'svn info'" do
63 provider.revision.should == '4'
67 describe "setting the revision property" do
71 it "should use 'svn update'" do
73 provider.expects('svn').with('update', '-r', @revision)
74 provider.revision = @revision