Sha256: 822288d36bc6d1e43ef61a72e3d3d20ebc65aeac4872fc0f208105618e4c996b

Contents?: true

Size: 689 Bytes

Versions: 3

Compression:

Stored size: 689 Bytes

Contents

require File.dirname(__FILE__) + '/../../spec_helper'
require File.dirname(__FILE__) + '/../../../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

3 entries across 3 versions & 1 rubygems

Version Path
say_when-0.3.0 spec/say_when/triggers/once_strategy_spec.rb
say_when-0.2.6 spec/say_when/triggers/once_strategy_spec.rb
say_when-0.2.5 spec/say_when/triggers/once_strategy_spec.rb