Sha256: 72271dff6d0dce83779e4a27b3be47c5fc4b3d19a45db6f0d8d177aa775c61d6

Contents?: true

Size: 1.16 KB

Versions: 96

Compression:

Stored size: 1.16 KB

Contents

require File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'test_helper'))
require 'new_relic/transaction_sample/composite_segment'
class NewRelic::TransactionSample::CompositeSegmentTest < Test::Unit::TestCase
  def test_composite_segment_creation
    fake_segment = mock_segment
    NewRelic::TransactionSample::CompositeSegment.new([fake_segment])
  end

  def test_detail_segments_equals
    fake_segment = mock_segment
    cs = NewRelic::TransactionSample::CompositeSegment.new([fake_segment])

    # note that this is a bare mock
    # nothing should be called on it, for now
    other_fake_segment = mock('other segment')
    cs.detail_segments = [other_fake_segment]

    assert_equal cs.detail_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)
    # note the following 'twice' - different than SummarySegment
    segment.expects(:exit_timestamp).returns(Time.now).twice
    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
wd_newrelic_rpm-3.5.8 test/new_relic/transaction_sample/composite_segment_test.rb
sundawg_newrelic_rpm-3.5.8.2 test/new_relic/transaction_sample/composite_segment_test.rb
sundawg_newrelic_rpm-3.5.8.1 test/new_relic/transaction_sample/composite_segment_test.rb
newrelic_rpm-3.5.8.72 test/new_relic/transaction_sample/composite_segment_test.rb
newrelic_rpm-3.5.8.70 test/new_relic/transaction_sample/composite_segment_test.rb
newrelic_rpm-3.5.8.64.beta test/new_relic/transaction_sample/composite_segment_test.rb
newrelic_rpm-3.5.7.59 test/new_relic/transaction_sample/composite_segment_test.rb
newrelic_rpm-3.5.7.59.beta test/new_relic/transaction_sample/composite_segment_test.rb
newrelic_rpm-3.5.7.58.beta test/new_relic/transaction_sample/composite_segment_test.rb
wd_newrelic_rpm-3.5.6 test/new_relic/transaction_sample/composite_segment_test.rb
newrelic_rpm-3.5.7.57.beta test/new_relic/transaction_sample/composite_segment_test.rb
newrelic_rpm-3.5.6.55 test/new_relic/transaction_sample/composite_segment_test.rb
newrelic_rpm-3.5.6.48.beta test/new_relic/transaction_sample/composite_segment_test.rb
newrelic_rpm-3.5.6.46.beta test/new_relic/transaction_sample/composite_segment_test.rb
newrelic_rpm-3.5.6.42.beta test/new_relic/transaction_sample/composite_segment_test.rb
newrelic_rpm-3.5.5.39.beta test/new_relic/transaction_sample/composite_segment_test.rb
wd_newrelic_rpm-3.5.5 test/new_relic/transaction_sample/composite_segment_test.rb
newrelic_rpm-3.5.5.38 test/new_relic/transaction_sample/composite_segment_test.rb
newrelic_rpm-3.5.5.540.dev test/new_relic/transaction_sample/composite_segment_test.rb
newrelic_rpm-3.5.4.35.beta test/new_relic/transaction_sample/composite_segment_test.rb