Sha256: 1c9189bc11703c3bfc48d36a9223a0f41f0a4edf67c797afb8a550c3d51c72be

Contents?: true

Size: 1.05 KB

Versions: 96

Compression:

Stored size: 1.05 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'test_helper'))
require 'new_relic/transaction_sample/summary_segment'
class NewRelic::TransactionSample::SummarySegmentTest < Test::Unit::TestCase
  def test_summary_segment_creation
    fake_segment = mock_segment
    NewRelic::TransactionSample::SummarySegment.new(fake_segment)
  end

  def test_add_segments
    fake_segment = mock_segment
    ss = NewRelic::TransactionSample::SummarySegment.new(fake_segment)
    other_fake_segment = mock_segment
    # with the new summary segment
    ss.expects(:add_called_segment).with(instance_of(NewRelic::TransactionSample::SummarySegment))
    ss.add_segments([other_fake_segment])
  end

  private

  @@seg_count = 0
  def mock_segment
    @@seg_count += 1
    segment = mock('segment ' + @@seg_count.to_s)
    segment.expects(:entry_timestamp).returns(Time.now)
    segment.expects(:exit_timestamp).returns(Time.now)
    segment.expects(:metric_name).returns('Custom/test/metric')
    segment.expects(:called_segments).returns([])
    segment
  end
end

Version data entries

96 entries across 96 versions & 5 rubygems

Version Path
newrelic_rpm-3.5.4.34 test/new_relic/transaction_sample/summary_segment_test.rb
newrelic_rpm-3.5.4.33 test/new_relic/transaction_sample/summary_segment_test.rb
newrelic_rpm-3.5.4.31.beta test/new_relic/transaction_sample/summary_segment_test.rb
newrelic_rpm-3.5.4.29.beta test/new_relic/transaction_sample/summary_segment_test.rb
ghazel-newrelic_rpm-3.5.4 test/new_relic/transaction_sample/summary_segment_test.rb
newrelic_rpm-3.5.3.25 test/new_relic/transaction_sample/summary_segment_test.rb
newrelic_rpm-3.5.3.24 test/new_relic/transaction_sample/summary_segment_test.rb
newrelic_rpm-3.5.2.17 test/new_relic/transaction_sample/summary_segment_test.rb
newrelic_rpm-3.5.1.14 test/new_relic/transaction_sample/summary_segment_test.rb
newrelic_rpm-3.5.1.14.beta test/new_relic/transaction_sample/summary_segment_test.rb
newrelic_rpm-3.5.1.beta1 test/new_relic/transaction_sample/summary_segment_test.rb
newrelic_rpm-3.5.0.1 test/new_relic/transaction_sample/summary_segment_test.rb
newrelic_rpm-3.5.1.alpha test/new_relic/transaction_sample/summary_segment_test.rb
newrelic_rpm-3.5.0 test/new_relic/transaction_sample/summary_segment_test.rb
newrelic_rpm-3.4.2.1 test/new_relic/transaction_sample/summary_segment_test.rb
newrelic_rpm-3.4.2 test/new_relic/transaction_sample/summary_segment_test.rb
newrelic_rpm-3.4.2.beta1 test/new_relic/transaction_sample/summary_segment_test.rb
newrelic_rpm-3.4.1 test/new_relic/transaction_sample/summary_segment_test.rb
newrelic_rpm-3.4.1.beta1 test/new_relic/transaction_sample/summary_segment_test.rb
ghazel-newrelic_rpm-3.4.0.2 test/new_relic/transaction_sample/summary_segment_test.rb