|
90 | 90 |
|
91 | 91 | end |
92 | 92 |
|
93 | | - it "creates the current_resource object and sets its revision to the current deployment's revision" do |
| 93 | + it "creates the current_resource object and sets its revision to the current deployment's revision as long as we're not exporting" do |
94 | 94 | @provider.stub!(:find_current_revision).and_return("11410") |
| 95 | + @provider.new_resource.instance_variable_set :@action, [:checkout] |
95 | 96 | @provider.load_current_resource |
96 | 97 | @provider.current_resource.name.should eql(@resource.name) |
97 | 98 | @provider.current_resource.revision.should eql("11410") |
|
166 | 167 | @provider.checkout_command.should eql("svn checkout --no-auth-cache -q -r12345 "+ |
167 | 168 | "http://svn.example.org/trunk/ /my/deploy/dir") |
168 | 169 | end |
169 | | - |
| 170 | + |
170 | 171 | it "generates a sync command with default options" do |
171 | 172 | @provider.sync_command.should eql("svn update -q -r12345 /my/deploy/dir") |
172 | 173 | end |
173 | | - |
| 174 | + |
174 | 175 | it "generates an export command with default options" do |
175 | 176 | @provider.export_command.should eql("svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir") |
176 | 177 | end |
177 | | - |
| 178 | + |
178 | 179 | it "doesn't try to find the current revision when loading the resource if running an export" do |
179 | | - @provider.new_resource.instance_variable_set :@action, :export |
| 180 | + @provider.new_resource.instance_variable_set :@action, [:export] |
180 | 181 | @provider.should_not_receive(:find_current_revision) |
181 | 182 | @provider.load_current_resource |
182 | 183 | end |
183 | | - |
| 184 | + |
184 | 185 | it "doesn't try to find the current revision when loading the resource if running a force export" do |
185 | | - @provider.new_resource.instance_variable_set :@action, :force_export |
| 186 | + @provider.new_resource.instance_variable_set :@action, [:force_export] |
186 | 187 | @provider.should_not_receive(:find_current_revision) |
187 | 188 | @provider.load_current_resource |
188 | 189 | end |
189 | | - |
| 190 | + |
190 | 191 | it "runs an export with the --force option" do |
191 | 192 | expected_cmd = "svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir" |
192 | 193 | @provider.should_receive(:run_command).with(:command => expected_cmd) |
193 | 194 | @provider.action_force_export |
194 | 195 | end |
195 | | - |
| 196 | + |
196 | 197 | it "runs the checkout command for action_checkout" do |
197 | 198 | expected_cmd = "svn checkout -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir" |
198 | 199 | @provider.should_receive(:run_command).with(:command => expected_cmd) |
|
0 commit comments