Sha256: b0e17e5d4863db2e7bca306de9ee3f68f65012def30b7bcdf8d4918ef980e617

Contents?: true

Size: 763 Bytes

Versions: 4

Compression:

Stored size: 763 Bytes

Contents

require 'spec_helper'

RSpec.describe Appdash::Span::ID do

  before do
    allow(SecureRandom).to receive(:random_bytes).with(8).
      and_return("A~CDEF~H", "xyz\x00\x00\x00\x00\x00", "^&<>^*%!", "2531afas", "*&^%$-[]")
  end

  it "should create instances" do
    expect(subject.trace).to eq(5223689881108315713)
    expect(subject.span).to eq(8026488)
    expect(subject.parent).to be_nil
    expect(subject.to_s).to eq("487e464544437e41/00000000007a7978")
  end

  it "should create children" do
    child = subject.child
    expect(child.trace).to eq(5223689881108315713)
    expect(child.span).to eq(2388361761649337950)
    expect(child.parent).to eq(8026488)
    expect(child.to_s).to eq("487e464544437e41/21252a5e3e3c265e/00000000007a7978")
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
appdash-0.6.3 spec/appdash/span/id_spec.rb
appdash-0.6.2 spec/appdash/span/id_spec.rb
appdash-0.6.1 spec/appdash/span/id_spec.rb
appdash-0.6.0 spec/appdash/span/id_spec.rb