Permalink
Browse files

Added support for chef 10.14.0.

  • Loading branch information...
1 parent f8c7427 commit bb0448c2a08b1ebe2a0454c15d80f021b328843f @abecciu abecciu committed Sep 9, 2012
Showing with 6 additions and 2 deletions.
  1. +1 −0 .travis.yml
  2. +3 −1 lib/chefspec/chef_runner.rb
  3. +2 −1 spec/chefspec/chef_runner_spec.rb
View
@@ -6,3 +6,4 @@ env:
- CHEF_VERSION=0.9.18
- CHEF_VERSION=0.10.8
- CHEF_VERSION=10.12.0
+ - CHEF_VERSION=10.14.0
@@ -42,7 +42,8 @@ def initialize(options={})
@@runner = the_runner
end
- def run_action(action)
+ def run_action(*args)
+ action = args.first
runner = if self.class.methods.include?(:class_variable_get)
self.class.class_variable_get(:@@runner)
else
@@ -74,6 +75,7 @@ def run_action(action)
Chef::Log.level(options[:log_level])
@client = Chef::Client.new
fake_ohai(@client.ohai)
+ @client.load_node if @client.respond_to?(:load_node) # chef >= 10.14.0
@node = @client.build_node
if block_given?
yield @node
@@ -46,6 +46,7 @@ module ChefSpec
file.run_action(:create)
end
it "should not execute not_if/only_if guards" do
+ Chef::Platform.stub(:provider_for_resource) { stub.as_null_object }
runner = ChefSpec::ChefRunner.new(:step_into => ['file'])
not_if_action = double()
only_if_action = double()
@@ -54,7 +55,7 @@ module ChefSpec
file.only_if { only_if_action.call }
not_if_action.should_receive(:call).never
only_if_action.should_receive(:call).never
- Chef::Platform.stub(:provider_for_resource) { stub.as_null_object }
+ file.stub(:run_context) { stub.as_null_object }
file.run_action(:create)
end
it "should accept a block to set node attributes" do

0 comments on commit bb0448c

Please sign in to comment.