Sha256: e4201f7f16340b0159bbd987ac8ffb473b02c930f5ec3c4685286d82e2914888

Contents?: true

Size: 946 Bytes

Versions: 2

Compression:

Stored size: 946 Bytes

Contents

require 'spec_helper'

describe FluQ::Event do

  subject { described_class.new({"a" => "v1", "b" => "v2"}, "1313131313") }

  it { should be_a(Hash) }
  its(:meta)       { should == {} }
  its(:timestamp)  { should == 1313131313 }
  its(:time)       { should be_instance_of(Time) }
  its(:time)       { should be_utc }

  it "should be comparable" do
    other = described_class.new({"a" => "v1", "b" => "v2"}, "1313131313")

    subject.should == other
    other.meta[:some] = "thing"
    subject.should == other
    other["c"] = "d"
    subject.should_not == other
    subject.should_not == described_class.new({"a" => "v1", "b" => "v2"}, "1313131312")
  end

  it "should be inspectable" do
    subject.inspect.should == %(#<FluQ::Event(1313131313) data:{"a"=>"v1", "b"=>"v2"} meta:{}>)
    subject.meta[:some] = "thing"
    subject.inspect.should == %(#<FluQ::Event(1313131313) data:{"a"=>"v1", "b"=>"v2"} meta:{:some=>"thing"}>)
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fluq-0.8.1 spec/fluq/event_spec.rb
fluq-0.8.0 spec/fluq/event_spec.rb