Sha256: 1b014bc410ed8da36d8fd73c91de30e5d79246b0516fc81bb24b90dd6a2a58d0
Contents?: true
Size: 881 Bytes
Versions: 14
Compression:
Stored size: 881 Bytes
Contents
require 'minitest/autorun' require 'securerandom' require_relative '../lib/orats/foreman' module Orats module Test include Foreman BINARY_PATH = File.absolute_path('../../bin/orats',__FILE__) TEST_PATH = '/tmp/orats/test' ORATS_FLAGS = '--pg-password pleasedonthackme --skip-foreman-start' def orats(command, options = {}) cmd, app_name = command.split(' ') prepend_command = '' command = "#{cmd} #{TEST_PATH}/#{app_name}" if command.include?(' ') if options.has_key?(:answer) options[:answer] == 'y' || options[:answer] == 'yes' ? insert_answer = 'yes' : insert_answer = 'echo' prepend_command = "#{insert_answer} | " end system "#{prepend_command} #{BINARY_PATH} #{command} #{options[:flags]}" end private def generate_app_name "a_#{SecureRandom.hex(8)}" end end end
Version data entries
14 entries across 14 versions & 1 rubygems