Sha256: 2ae90493d3dbdaa16fcb4f45d00d050689a5390908f46df6b77e0b8c9046870c

Contents?: true

Size: 930 Bytes

Versions: 6

Compression:

Stored size: 930 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

require 'test_helper'

class AgentSetupInitTest < Minitest::Test
  CONFIG_FILENAME = '123.yml'
  EXPECTED_CONFIG_CONTENT = %(---
name: appmap-ruby
packages:
- path: lib
language: ruby
appmap_dir: tmp/appmap
)

  def test_init_when_config_exists
    output = `./exe/appmap-agent-init`
    assert_equal 0, $CHILD_STATUS.exitstatus
    expected = JSON.pretty_generate({
      configuration: {
        filename: 'appmap.yml',
        contents: EXPECTED_CONFIG_CONTENT
      }
    })
    assert_equal expected, output.strip
  end

  def test_init_with_custom_config_filename
    output = `./exe/appmap-agent-init -c #{CONFIG_FILENAME}`
    assert_equal 0, $CHILD_STATUS.exitstatus
    expected = JSON.pretty_generate({
      configuration: {
        filename: CONFIG_FILENAME,
        contents: EXPECTED_CONFIG_CONTENT
      }
    })
    assert_equal expected, output.strip
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
appmap-0.83.4 test/agent_setup_init_test.rb
appmap-0.83.3 test/agent_setup_init_test.rb
appmap-0.83.2 test/agent_setup_init_test.rb
appmap-0.83.1 test/agent_setup_init_test.rb
appmap-0.83.0 test/agent_setup_init_test.rb
appmap-0.82.0 test/agent_setup_init_test.rb