Sha256: a96f7f39a88dc6aa3d6b3f842119624dc2327388f64027daa1f5344ad2d42bef

Contents?: true

Size: 1.03 KB

Versions: 12

Compression:

Stored size: 1.03 KB

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| }
              config.eager_load = false
            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

12 entries across 12 versions & 1 rubygems

Version Path
appsignal-0.6.7 spec/appsignal/inactive_railtie_spec.rb
appsignal-0.6.6 spec/appsignal/inactive_railtie_spec.rb
appsignal-0.6.5 spec/appsignal/inactive_railtie_spec.rb
appsignal-0.6.4 spec/appsignal/inactive_railtie_spec.rb
appsignal-0.6.3 spec/appsignal/inactive_railtie_spec.rb
appsignal-0.6.3.beta.3 spec/appsignal/inactive_railtie_spec.rb
appsignal-0.6.3.beta.2 spec/appsignal/inactive_railtie_spec.rb
appsignal-0.6.3.beta.1 spec/appsignal/inactive_railtie_spec.rb
appsignal-0.6.2 spec/appsignal/inactive_railtie_spec.rb
appsignal-0.6.1 spec/appsignal/inactive_railtie_spec.rb
appsignal-0.6.0.beta.2 spec/appsignal/inactive_railtie_spec.rb
appsignal-0.6.0.beta.1 spec/appsignal/inactive_railtie_spec.rb