class Object

Public Instance Methods

run_recipe(remote: false, options: nil, check: false, rargv: nil) click to toggle source
# File lib/producer/core/testing/cucumber/recipe_steps.rb, line 1
def run_recipe remote: false, options: nil, check: false, rargv: nil
  command = %w[producer recipe.rb]
  case remote
    when :unknown then command += %w[-t unknown_host.test]
    when true     then command += %w[-t some_host.test]
  end
  command << options if options
  command << ['--', *rargv] if rargv

  with_environment 'HOME' => expand_path('.') do
    run_simple command.join(' '), false
  end

  assert_exit_status 0 if check
  assert_matching_output '\ASocketError', all_output if remote == :unknown
end
stat_mode(path) click to toggle source
# File lib/producer/core/testing/cucumber/remote_steps.rb, line 1
def stat_mode path
  cd '.' do
    ('%o' % [File::Stat.new(path).mode])[-4, 4]
  end
end