Sha256: 6e519b204bbdb2f08791d668a171c903d43faf65c3d0f2622ba051fbe0731aa5

Contents?: true

Size: 701 Bytes

Versions: 12

Compression:

Stored size: 701 Bytes

Contents

require 'spec_helper'

describe "Unicorn integration" do
  let(:file) { File.expand_path('lib/appsignal/integrations/unicorn.rb') }
  before(:all) do
    module Unicorn
      class Worker
        def close
        end
      end
    end
  end
  before do
    load file
    start_agent
  end

  it "should add behavior to Unicorn::Worker#close" do
    worker = Unicorn::Worker.new

    Appsignal.should_receive(:stop)
    worker.should_receive(:original_close)

    worker.close
  end

  context "without unicorn" do
    before(:all) { Object.send(:remove_const, :Unicorn) }

    specify { expect { Unicorn }.to raise_error(NameError) }
    specify { expect { load file }.to_not raise_error }
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
appsignal-0.12.beta.50 spec/lib/appsignal/integrations/unicorn_spec.rb
appsignal-0.12.beta.49 spec/lib/appsignal/integrations/unicorn_spec.rb
appsignal-0.12.beta.48 spec/lib/appsignal/integrations/unicorn_spec.rb
appsignal-0.12.beta.47 spec/lib/appsignal/integrations/unicorn_spec.rb
appsignal-0.12.beta.46 spec/lib/appsignal/integrations/unicorn_spec.rb
appsignal-0.12.beta.45 spec/lib/appsignal/integrations/unicorn_spec.rb
appsignal-0.12.beta.44 spec/lib/appsignal/integrations/unicorn_spec.rb
appsignal-0.12.beta.43 spec/lib/appsignal/integrations/unicorn_spec.rb
appsignal-0.12.beta.42 spec/lib/appsignal/integrations/unicorn_spec.rb
appsignal-0.12.beta.41 spec/lib/appsignal/integrations/unicorn_spec.rb
appsignal-0.12.beta.40 spec/lib/appsignal/integrations/unicorn_spec.rb
appsignal-0.12.beta.39 spec/lib/appsignal/integrations/unicorn_spec.rb