Sha256: 857548dd8259252bce21efa1bef8f52e8f158d864a08245d7ddccbc641398f01

Contents?: true

Size: 1.21 KB

Versions: 10

Compression:

Stored size: 1.21 KB

Contents

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

require 'test_helper'
require 'English'

class MinitestTest < Minitest::Test
  def perform_minitest_test(test_name)
    Bundler.with_clean_env do
      Dir.chdir 'test/fixtures/minitest_recorder' do
        FileUtils.rm_rf 'tmp'
        system 'bundle config --local local.appmap ../../..'
        system 'bundle'
        system({ 'APPMAP' => 'true' }, %(bundle exec ruby -Ilib -Itest test/#{test_name}_test.rb))

        yield
      end
    end
  end

  def test_hello
    perform_minitest_test 'hello' do
      appmap_file = 'tmp/appmap/minitest/Hello_hello.appmap.json'

      assert File.file?(appmap_file), 'appmap output file does not exist'
      appmap = JSON.parse(File.read(appmap_file))
      assert_equal AppMap::APPMAP_FORMAT_VERSION, appmap['version']
      assert_includes appmap.keys, 'metadata'
      metadata = appmap['metadata']
      assert_equal 'minitest_recorder', metadata['app']
      assert_equal 'minitest', metadata['recorder']['name']
      assert_equal 'ruby', metadata['language']['name']
      assert_equal 'Hello', metadata['feature_group']
      assert_equal 'hello', metadata['feature']
      assert_equal 'Hello hello', metadata['name']
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
appmap-0.41.2 test/minitest_test.rb
appmap-0.41.1 test/minitest_test.rb
appmap-0.41.0 test/minitest_test.rb
appmap-0.40.0 test/minitest_test.rb
appmap-0.39.1 test/minitest_test.rb
appmap-0.39.0 test/minitest_test.rb
appmap-0.38.1 test/minitest_test.rb
appmap-0.37.2 test/minitest_test.rb
appmap-0.37.0 test/minitest_test.rb
appmap-0.36.0 test/minitest_test.rb