Top Level Namespace

Defined Under Namespace

Modules: Producer

Instance Method Summary collapse

Instance Method Details

#run_recipe(remote: false, options: nil, check: false, rargv: nil) ⇒ Object



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 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) ⇒ Object



1
2
3
4
5
# 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