Sha256: bc992682c101efcc9186e933305277e2bb4a66f39759bbea2a5fc22e793b2f18

Contents?: true

Size: 806 Bytes

Versions: 4

Compression:

Stored size: 806 Bytes

Contents

require 'spec_helper'


describe Instrumental::Command, "basic functions of command structs" do
  it "should not allow bad arguments to command#+" do
    command = Instrumental::Command.new("gauge", "abc", 1, Time.at(0), 1)

    # nil is a no-op
    expect(command + nil).to eq(command)
    # it will change the top of the other command
    expect(command + Instrumental::Command.new("increment", "abc", 1, Time.at(0), 1))
      .to eq(Instrumental::Command.new("gauge", "abc", 2, Time.at(0), 2))
  end

  it "should add together with like commands" do
    command = Instrumental::Command.new("gauge", "abc", 1, Time.at(0), 1)
    other   = Instrumental::Command.new("gauge", "abc", 2, Time.at(0), 4)
    expect(command + other).to eq(Instrumental::Command.new("gauge", "abc", 3, Time.at(0), 5))
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
instrumental_agent-3.0.0 spec/command_struct_specs.rb
instrumental_agent-3.0.0.beta3 spec/command_struct_specs.rb
instrumental_agent-3.0.0.beta2 spec/command_struct_specs.rb
instrumental_agent-3.0.0.beta spec/command_struct_specs.rb