Sha256: 6655c7e730a6414b3ea893aceca24e02a2a5e06c985dd7b2f0e3ed0c958a9e3c

Contents?: true

Size: 1018 Bytes

Versions: 74

Compression:

Stored size: 1018 Bytes

Contents

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

require 'test_helper'
require 'English'

class BundleVendorTest < Minitest::Test
  def perform_bundle_vendor_app(test_name)
    Bundler.with_clean_env do
      Dir.chdir 'test/fixtures/bundle_vendor_app' do
        FileUtils.rm_rf 'tmp'
        FileUtils.mkdir_p 'tmp'
        system 'bundle config --local local.appmap ../../..'
        system 'bundle'
        system(%(bundle exec ruby -Ilib -Itest cli.rb add foobar))
        system({ 'APPMAP' => 'true' }, %(bundle exec ruby -Ilib -Itest cli.rb list))

        yield
      end
    end
  end

  def test_record_gem
    perform_bundle_vendor_app 'parser' do
      appmap_file = 'tmp/bundle_vendor_app.appmap.json'
      appmap = JSON.parse(File.read(appmap_file))
      assert appmap['classMap'].find { |co| co['name'] == 'gli' }
      assert appmap['events'].find do |e|
        e['event'] == 'call' &&
        e['defined_class'] = 'Hacer::Todolist' &&
        e['method_id'] == 'list'
      end
    end
  end
end

Version data entries

74 entries across 74 versions & 1 rubygems

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