say_when 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
data/lib/say_when/version.rb
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../../spec_helper'
|
2
|
+
require File.dirname(__FILE__) + '/../../../lib/say_when/triggers/once_strategy'
|
3
|
+
|
4
|
+
describe SayWhen::Triggers::OnceStrategy do
|
5
|
+
|
6
|
+
it "should be constucted with at option" do
|
7
|
+
time_at = 1.second.ago
|
8
|
+
o = SayWhen::Triggers::OnceStrategy.new({:at=>time_at})
|
9
|
+
o.should_not be_nil
|
10
|
+
o.once_at.should == time_at
|
11
|
+
end
|
12
|
+
|
13
|
+
it "should return once at only once" do
|
14
|
+
time_at = 1.second.ago
|
15
|
+
o = SayWhen::Triggers::OnceStrategy.new({:at=>time_at})
|
16
|
+
o.should_not be_nil
|
17
|
+
o.next_fire_at.should == time_at
|
18
|
+
o.next_fire_at(time_at + 10.second).should be_nil
|
19
|
+
o.next_fire_at(time_at - 10.second).should == time_at
|
20
|
+
end
|
21
|
+
|
22
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: say_when
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 5
|
10
|
+
version: 0.2.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrew Kuklewicz
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-10-
|
18
|
+
date: 2012-10-11 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: activemessaging
|
@@ -174,6 +174,7 @@ files:
|
|
174
174
|
- spec/say_when/storage/memory/job_spec.rb
|
175
175
|
- spec/say_when/storage/memory/trigger_spec.rb
|
176
176
|
- spec/say_when/storage/mongoid/trigger_spec.rb
|
177
|
+
- spec/say_when/triggers/once_strategy_spec.rb
|
177
178
|
- spec/spec.opts
|
178
179
|
- spec/spec_helper.rb
|
179
180
|
- spec/support/models.rb
|
@@ -222,6 +223,7 @@ test_files:
|
|
222
223
|
- spec/say_when/storage/memory/job_spec.rb
|
223
224
|
- spec/say_when/storage/memory/trigger_spec.rb
|
224
225
|
- spec/say_when/storage/mongoid/trigger_spec.rb
|
226
|
+
- spec/say_when/triggers/once_strategy_spec.rb
|
225
227
|
- spec/spec.opts
|
226
228
|
- spec/spec_helper.rb
|
227
229
|
- spec/support/models.rb
|