diff --git a/chef/lib/chef/provider/subversion.rb b/chef/lib/chef/provider/subversion.rb index 212e9647b60..9bfb29d3696 100644 --- a/chef/lib/chef/provider/subversion.rb +++ b/chef/lib/chef/provider/subversion.rb @@ -31,7 +31,7 @@ class Subversion < Chef::Provider def load_current_resource @current_resource = Chef::Resource::Subversion.new(@new_resource.name) - unless [:export, :force_export].include?(@new_resource.action.first) + unless [:export, :force_export].include?(Array(@new_resource.action).first) if current_revision = find_current_revision @current_resource.revision current_revision end diff --git a/chef/spec/unit/provider/subversion_spec.rb b/chef/spec/unit/provider/subversion_spec.rb index f9e3291e933..37d37c74905 100644 --- a/chef/spec/unit/provider/subversion_spec.rb +++ b/chef/spec/unit/provider/subversion_spec.rb @@ -87,7 +87,14 @@ and_return(@exitstatus) @provider.find_current_revision.should be_nil end - + + it "finds the current revision when loading the current resource state" do + # note: the test is kinda janky, but it provides regression coverage for CHEF-2092 + @resource.instance_variable_set(:@action, :sync) + @provider.should_receive(:find_current_revision).and_return("12345") + @provider.load_current_resource + @provider.current_resource.revision.should == "12345" + end end it "creates the current_resource object and sets its revision to the current deployment's revision as long as we're not exporting" do