Sha256: 3b8ca5c47d00e11fd20b75eaa0068b6bd3336057753f30f21d5f3d8c503cd022

Contents?: true

Size: 719 Bytes

Versions: 4

Compression:

Stored size: 719 Bytes

Contents

require "spec_helper"

module Sidewatch

  describe Metric do

    let(:namespace){ "Clocks" }
    let(:metric_name){ "Ticks" }
    let(:metric_value){ 1234 }
    let(:metric_unit){ "Count" }
    let(:dimensions){ { "ClockName" => "cuckoo" } }
    let(:timestamp){ Time.at(1440494300) }
    subject {
      described_class.new(
        name: metric_name,
        value: metric_value,
        unit: metric_unit,
        dimensions: dimensions,
        timestamp: timestamp,
      )
    }

    describe "#initialize" do

      context "missing timestamp" do
        let(:timestamp){ nil }
        it "sets a default timestamp" do
          expect(subject.timestamp).to_not be_nil
        end
      end

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sidewatch-0.0.4 spec/metric_spec.rb
sidewatch-0.0.3 spec/metric_spec.rb
sidewatch-0.0.2 spec/metric_spec.rb
sidewatch-0.0.1 spec/metric_spec.rb