File: metric_spec.rb

package info (click to toggle)
ruby-hitimes 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 352 kB
  • sloc: ruby: 1,196; ansic: 418; java: 265; makefile: 15
file content (28 lines) | stat: -rw-r--r-- 742 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require "spec_helper"

describe Hitimes::Metric do
  before( :each ) do
    @metric = Hitimes::Metric.new( "testing" )
  end

  it 'has a name' do
    @metric.name.must_equal "testing"
  end

  it "has associated data from initialization" do
    m = Hitimes::Metric.new( "more-data", 'foo' => 'bar', 'this' => 'that' )
    m.additional_data['foo'].must_equal 'bar'
    m.additional_data['this'].must_equal 'that'
    
    m = Hitimes::Metric.new( "more-data", { 'foo' => 'bar', 'this' => 'that' } )
    m.additional_data['foo'].must_equal 'bar'
    m.additional_data['this'].must_equal 'that'
  end

  it "initially has no sampling times" do
    @metric.sampling_start_time.must_be_nil
    @metric.sampling_stop_time.must_be_nil
  end
end