Module: ChefSpec::API::RubyBlockMatchers
- Defined in:
- lib/chefspec/api/ruby_block.rb
Overview
Instance Method Summary collapse
-
#run_ruby_block(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a
ruby_block
resource exists in the Chef run with the action:run
.
Instance Method Details
#run_ruby_block(resource_name) ⇒ ChefSpec::Matchers::ResourceMatcher
Assert that a ruby_block
resource exists in the Chef run with the action :run
. Given a Chef Recipe that runs “do_something” as a ruby_block
:
ruby_block 'do_something' do
block do
# ...
end
action :run
end
The Examples section demonstrates the different ways to test a ruby_block
resource with ChefSpec.
33 34 35 |
# File 'lib/chefspec/api/ruby_block.rb', line 33 def run_ruby_block(resource_name) ChefSpec::Matchers::ResourceMatcher.new(:ruby_block, :run, resource_name) end |