Sha256: a28d874ef327dbc41546947b81ac97b84f166b303c6d5e933acfa786741ae8af

Contents?: true

Size: 1.23 KB

Versions: 16

Compression:

Stored size: 1.23 KB

Contents

# encoding: utf-8

require 'spec_helper'

describe Adhearsion::Statistics::Dump do
  it "should have a timestamp" do
    origin_time = Time.now
    dump = Adhearsion::Statistics::Dump.new timestamp: origin_time
    dump.timestamp.should == origin_time
  end

  it "should have a hash of call counts" do
    counts = {dialed: 0, offered: 0, routed: 0, rejected: 0, active: 0}
    dump = Adhearsion::Statistics::Dump.new call_counts: counts
    dump.call_counts.should == counts
  end

  it "should have a hash of call counts by route" do
    counts = {"my route" => 1, "your route" => 10}
    dump = Adhearsion::Statistics::Dump.new calls_by_route: counts
    dump.calls_by_route.should == counts
  end

  it "should be equal to another dump if they share the same timestamp" do
    origin_time = Time.now
    dump1 = Adhearsion::Statistics::Dump.new timestamp: origin_time
    dump2 = Adhearsion::Statistics::Dump.new timestamp: origin_time
    dump1.should be == dump2
  end

  it "should compare based on the timestamp" do
    origin_time = Time.now
    dump1 = Adhearsion::Statistics::Dump.new timestamp: origin_time
    dump2 = Adhearsion::Statistics::Dump.new timestamp: (origin_time + 1)
    dump1.should be < dump2
    dump2.should be > dump1
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
adhearsion-2.5.4 spec/adhearsion/statistics/dump_spec.rb
adhearsion-2.5.3 spec/adhearsion/statistics/dump_spec.rb
adhearsion-2.5.2 spec/adhearsion/statistics/dump_spec.rb
adhearsion-2.5.0 spec/adhearsion/statistics/dump_spec.rb
adhearsion-2.4.0 spec/adhearsion/statistics/dump_spec.rb
adhearsion-2.4.0.beta3 spec/adhearsion/statistics/dump_spec.rb
adhearsion-2.4.0.beta2 spec/adhearsion/statistics/dump_spec.rb
adhearsion-2.4.0.beta1 spec/adhearsion/statistics/dump_spec.rb
adhearsion-2.3.5 spec/adhearsion/statistics/dump_spec.rb
adhearsion-2.3.4 spec/adhearsion/statistics/dump_spec.rb
adhearsion-2.3.3 spec/adhearsion/statistics/dump_spec.rb
adhearsion-2.3.2 spec/adhearsion/statistics/dump_spec.rb
adhearsion-2.3.1 spec/adhearsion/statistics/dump_spec.rb
adhearsion-2.3.0 spec/adhearsion/statistics/dump_spec.rb
adhearsion-2.2.1 spec/adhearsion/statistics/dump_spec.rb
adhearsion-2.2.0 spec/adhearsion/statistics/dump_spec.rb