Sha256: def13cc20d7a3e957df38cd48bfb4f8360751c99c3df7b82244345a70ca1ec69

Contents?: true

Size: 508 Bytes

Versions: 56

Compression:

Stored size: 508 Bytes

Contents

module CLIHelpers
  def cli
    Appsignal::CLI
  end

  def run_cli(command, options = {})
    cli.run(format_cli_arguments_and_options(command, options))
  end

  def format_cli_arguments_and_options(command, options = {})
    [*command].tap do |o|
      options.each do |key, value|
        o << "--#{key}=#{value}"
      end
    end
  end

  def set_input(value)
    $stdin.puts value
  end

  def prepare_input
    # Prepare the input by rewinding the pointer in the StringIO
    $stdin.rewind
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
appsignal-2.3.0.beta.1 spec/support/helpers/cli_helpers.rb
appsignal-2.2.1 spec/support/helpers/cli_helpers.rb
appsignal-2.2.0 spec/support/helpers/cli_helpers.rb
appsignal-2.2.0.beta.1 spec/support/helpers/cli_helpers.rb
appsignal-2.1.2 spec/support/helpers/cli_helpers.rb
appsignal-2.1.1 spec/support/helpers/cli_helpers.rb
appsignal-2.1.1.beta.1 spec/support/helpers/cli_helpers.rb
appsignal-2.1.0 spec/support/helpers/cli_helpers.rb
appsignal-2.0.6 spec/support/helpers/cli_helpers.rb
appsignal-2.1.0.beta.1 spec/support/helpers/cli_helpers.rb
appsignal-2.0.5 spec/support/helpers/cli_helpers.rb
appsignal-2.0.5.beta.1 spec/support/helpers/cli_helpers.rb
appsignal-2.1.0.alpha.3 spec/support/helpers/cli_helpers.rb
appsignal-2.1.0.alpha.2 spec/support/helpers/cli_helpers.rb
appsignal-2.1.0.alpha.1 spec/support/helpers/cli_helpers.rb
appsignal-2.0.4 spec/support/helpers/cli_helpers.rb