test/scheduler_0_test.rb in rufus-scheduler-1.0.7 vs test/scheduler_0_test.rb in rufus-scheduler-1.0.8
- old
+ new
@@ -60,11 +60,11 @@
$var = nil
scheduler = Rufus::Scheduler.new
scheduler.start
- sid = scheduler.schedule_in('1s') do
+ sid = scheduler.in('1s') do
$var = "ok..1"
end
assert \
sid,
@@ -142,11 +142,11 @@
#
# phase 1
es = EverySchedulable.new
- job_id = scheduler.schedule_every "500", es
+ job_id = scheduler.every "500", es
#puts "1 job_id : " + job_id.to_s
#sleep(3.4) # was a bit soonish for JRuby...
sleep 3.5
@@ -158,10 +158,13 @@
sleep 1
assert_equal 6, es.count
+ assert_nil scheduler.get_job(job_id)
+ assert_equal 1, scheduler.every_job_count # one left from before
+
# done
scheduler.sstop
end
@@ -263,15 +266,14 @@
#
# Scheduling in the past, with :discard_past set to true.
#
def test_8b
- scheduler = Rufus::Scheduler.new
- scheduler.start
+ scheduler = Rufus::Scheduler.start_new
var = nil
- job_id = scheduler.schedule_at(Time.now.to_s, :discard_past => true) do
+ job_id = scheduler.at(Time.now.to_s, :discard_past => true) do
var = "something"
end
assert_nil var
assert_nil job_id