Sha256: 1276d4ae3d7d4eb5f482b9c35ae4c428d0c93981f32dbf1f5fc25540edd9fd06

Contents?: true

Size: 1.48 KB

Versions: 38

Compression:

Stored size: 1.48 KB

Contents

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

require 'test_helper'

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

        yield
      end
    end
  end

  def test_expectation
    perform_minitest_test('sheep') do
      appmap_file = 'tmp/appmap/minitest/Sheep_sheep.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 'succeeded', metadata['test_status']
    end
  end

  def test_expectation_without_autorequire
    perform_minitest_test('sheep', 'APPMAP_AUTOREQUIRE' => 'false') do
      appmap_file = 'tmp/appmap/minitest/Sheep_sheep.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 'succeeded', metadata['test_status']
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
appmap-0.83.4 test/mock_compatibility_test.rb
appmap-0.83.3 test/mock_compatibility_test.rb
appmap-0.83.2 test/mock_compatibility_test.rb
appmap-0.83.1 test/mock_compatibility_test.rb
appmap-0.83.0 test/mock_compatibility_test.rb
appmap-0.82.0 test/mock_compatibility_test.rb
appmap-0.81.1 test/mock_compatibility_test.rb
appmap-0.81.0 test/mock_compatibility_test.rb
appmap-0.80.2 test/mock_compatibility_test.rb
appmap-0.80.1 test/mock_compatibility_test.rb
appmap-0.80.0 test/mock_compatibility_test.rb
appmap-0.79.0 test/mock_compatibility_test.rb
appmap-0.78.0 test/mock_compatibility_test.rb
appmap-0.77.4 test/mock_compatibility_test.rb
appmap-0.77.3 test/mock_compatibility_test.rb
appmap-0.77.2 test/mock_compatibility_test.rb
appmap-0.77.1 test/mock_compatibility_test.rb
appmap-0.77.0 test/mock_compatibility_test.rb
appmap-0.76.0 test/mock_compatibility_test.rb
appmap-0.75.0 test/mock_compatibility_test.rb