Sha256: 914b8c77134584e3f2d74aa1c3e36021a0d9e54dcf8279a124ce686d80249265

Contents?: true

Size: 1.19 KB

Versions: 31

Compression:

Stored size: 1.19 KB

Contents

require 'rails_spec_helper'

describe 'AppMap tracer via Railtie' do
  include_context 'Rails app pg database', 'spec/fixtures/rails6_users_app' do 
    let(:env) { {} }

    let(:cmd) { %(docker-compose run --rm -e RAILS_ENV=development -e APPMAP app ./bin/rails r "puts AppMap.instance_variable_get('@configuration').nil?") }
    let(:command_capture2) do
      require 'open3'
      Open3.capture3(env, cmd, chdir: fixture_dir).tap do |result|
        unless result[2] == 0
          warn <<~STDERR
            Failed to run rails6_users_app container
            <<< Output:
            #{result[0]}
            #{result[1]}
            >>> End of output
          STDERR
          raise 'Failed to run rails6_users_app container'
        end
      end
    end
    let(:command_output) { command_capture2[0].strip }
    let(:command_result) { command_capture2[2] }

    describe 'with APPMAP=false' do
      let(:env) { { 'APPMAP' => 'false' } }
      it 'is disabled' do
        expect(command_output).to eq('true')
      end
    end
    describe 'with APPMAP=true' do
      let(:env) { { 'APPMAP' => 'true' } }
      it 'is enabled' do
        expect(command_output).to eq('false')
      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
appmap-0.78.0 spec/railtie_spec.rb
appmap-0.77.4 spec/railtie_spec.rb
appmap-0.77.3 spec/railtie_spec.rb
appmap-0.77.2 spec/railtie_spec.rb
appmap-0.77.1 spec/railtie_spec.rb
appmap-0.77.0 spec/railtie_spec.rb
appmap-0.76.0 spec/railtie_spec.rb
appmap-0.75.0 spec/railtie_spec.rb
appmap-0.74.0 spec/railtie_spec.rb
appmap-0.73.0 spec/railtie_spec.rb
appmap-0.72.5 spec/railtie_spec.rb
appmap-0.72.4 spec/railtie_spec.rb
appmap-0.72.3 spec/railtie_spec.rb
appmap-0.72.2 spec/railtie_spec.rb
appmap-0.72.1 spec/railtie_spec.rb
appmap-0.72.0 spec/railtie_spec.rb
appmap-0.71.0 spec/railtie_spec.rb
appmap-0.70.2 spec/railtie_spec.rb
appmap-0.70.1 spec/railtie_spec.rb
appmap-0.70.0 spec/railtie_spec.rb