Sha256: 2253db748897f5a4df3ce0132c844098c6d4e5f032ccda944a4d327c203d1f67

Contents?: true

Size: 1013 Bytes

Versions: 4

Compression:

Stored size: 1013 Bytes

Contents

require 'spec_helper'

describe "Inactive Appsignal::Railtie" do
  it "should not insert itself into the middleware stack" do
    # This uses a hack because Rails really dislikes you trying to
    # start multiple applications in one process. This works decently
    # on every platform except JRuby, so we're disabling this test on
    # JRuby for now.
    if RUBY_PLATFORM == "java"
      pending "This spec cannot run on JRuby currently"
    else
      pid = fork do
        Appsignal.stub(:active? => false)
        Rails.application = nil
        instance_eval do
          module MyTempApp
            class Application < Rails::Application
              config.active_support.deprecation = proc { |message, stack| }
            end
          end
        end
        MyTempApp::Application.initialize!

        MyTempApp::Application.middleware.to_a.
          should_not include Appsignal::Listener
      end
      Process.wait(pid)
      raise 'Example failed' unless $?.exitstatus == 0
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
appsignal-0.5.5 spec/appsignal/inactive_railtie_spec.rb
appsignal-0.5.3 spec/appsignal/inactive_railtie_spec.rb
appsignal-0.5.1 spec/appsignal/inactive_railtie_spec.rb
appsignal-0.5.0 spec/appsignal/inactive_railtie_spec.rb