Sha256: 4f81089414861d2ce39d879b60d54080d372fa17b132f1f337d30f0fdb91b7e3

Contents?: true

Size: 890 Bytes

Versions: 23

Compression:

Stored size: 890 Bytes

Contents

# encoding: utf-8

require File.join(File.dirname(__FILE__), 'helper')

class TestAgent < TuneMyGcTestCase
  def test_interposer
    assert_instance_of TuneMyGc::Interposer, TuneMyGc.interposer
  end

  def test_snapshotter
    assert_instance_of TuneMyGc::Snapshotter, TuneMyGc.snapshotter
  end

  def test_spy
    assert_equal ['ActionController'], TuneMyGc.spies
    ENV['RUBY_GC_SPY'] = "minitest"
    assert_equal ['Minitest'], TuneMyGc.spies
    assert_equal 'minitest', TuneMyGc.spy_ids
    ENV['RUBY_GC_SPY'] = "action_controller,active_job"
    assert_equal ['ActionController','ActiveJob'], TuneMyGc.spies
    assert_equal 'action_controller,active_job', TuneMyGc.spy_ids
  ensure
    ENV.delete('RUBY_GC_SPY')
  end

  def test_log
    out, err = capture_io do
      TuneMyGc.logger = Logger.new($stdout)
      TuneMyGc.log 'test'
    end
    assert_match(/test/, out)
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
tunemygc-1.0.49 test/test_agent.rb
tunemygc-1.0.48 test/test_agent.rb
tunemygc-1.0.47 test/test_agent.rb