Sha256: 371a1e57273e008293ee3f9b7280902931c1069d6622f911199b5a0eea8e5dfa

Contents?: true

Size: 655 Bytes

Versions: 2

Compression:

Stored size: 655 Bytes

Contents

require_relative '../../spec_helper'
require_relative '../../../lib/say_when/triggers/once_strategy'

describe SayWhen::Triggers::OnceStrategy do

  it "should be constucted with at option" do
    time_at = 1.second.ago
    o = SayWhen::Triggers::OnceStrategy.new({:at=>time_at})
    o.should_not be_nil
    o.once_at.should == time_at
  end

  it "should return once at only once" do
    time_at = 1.second.ago
    o = SayWhen::Triggers::OnceStrategy.new({:at=>time_at})
    o.should_not be_nil
    o.next_fire_at.should == time_at
    o.next_fire_at(time_at + 10.second).should be_nil
    o.next_fire_at(time_at - 10.second).should == time_at
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
say_when-0.4.1 spec/say_when/triggers/once_strategy_spec.rb
say_when-0.4.0 spec/say_when/triggers/once_strategy_spec.rb