lib/bolt_spec/plans/action_stubs.rb
# Set different result values for each target. May use string or symbol keys, but allowed key names
# are restricted based on action.
Set different result values for each target. May use string or symbol keys, but allowed key names
are restricted based on action.
Set different result values for each target . May use string or symbol keys but allowed key names are restricted based on action .
def return_for_targets(data)
        data.each_with_object(@data) do |(target, result), hsh|
          raise "Mocked results must be hashes: #{target}: #{result}" unless result.is_a? Hash
          hsh[target] = result_for(Bolt::Target.new(target, @inventory), Bolt::Util.walk_keys(result, &:to_sym))
        end
        raise "Cannot set return values and return block." if @return_block
        @data_set = true
        self
      end
def return_for_targets ( data ) data . each_with_object ( @data ) do | ( target , result ) , hsh | raise "Mocked results must be hashes: #{target}: #{result}" unless result . is_a? Hash hsh [ target ] = result_for ( Bolt :: Target . new ( target , @inventory ) , Bolt :: Util . walk_keys ( result , & :to_sym ) ) end raise "Cannot set return values and return block." if @return_block @data_set = true self end
Set different result values for each target.
Set different result values for each target .
# set the inventory from the BoltSpec::Plans, otherwise if we try to convert # this target to a string, it will fail to string conversion because the # inventory is nil
data
<not_specific>