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, wait: true) ⇒ Object



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/producer/core/testing/cucumber/recipe_steps.rb', line 1

def run_recipe remote: false, options: nil, check: false, rargv: nil, wait: true
  command = $_baf[:program] + %w[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 += %w[--] + rargv if rargv

  env_allow = Baf::Testing::ENV_WHITELIST + $_baf[:env_allow]
  $_baf[:process] = Baf::Testing.run command, env_allow: env_allow, wait: wait

  Baf::Testing.expect_ex $_baf[:process], 0 if check
  expect($_baf[:process].output).to match /\ASocketError/ if remote == :unknown
end

#stat_mode(path) ⇒ Object



1
2
3
# File 'lib/producer/core/testing/cucumber/remote_steps.rb', line 1

def stat_mode path
  ('%o' % [File::Stat.new(path).mode])[-4, 4]
end