Sha256: 32c81a42adf08518d98228dccf881b6134a515e7ab55f79ff85106bc891e70ee

Contents?: true

Size: 587 Bytes

Versions: 13

Compression:

Stored size: 587 Bytes

Contents

#
# Specifying rufus-scheduler
#
# Sun Mar 22 16:47:28 JST 2009
#

require 'spec_base'


describe SCHEDULER_CLASS do

  before(:each) do
    @s = start_scheduler
  end
  after(:each) do
    stop_scheduler(@s)
  end


  it 'overrides jobs with the same id' do

    hits = []

    job0 = @s.in '1s', :job_id => 'nada' do
      hits << 0
    end

    wait_next_tick

    job1 = @s.in '1s', :job_id => 'nada' do
      hits << 1
    end

    wait_next_tick
    @s.jobs.size.should == 1

    hits.should == []

    sleep 1.5

    hits.should == [ 1 ]

    @s.jobs.size.should == 0
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rufus-scheduler-2.0.24 spec/at_in_spec.rb
rufus-scheduler-2.0.23 spec/at_in_spec.rb
rufus-scheduler-2.0.22 spec/at_in_spec.rb
rufus-scheduler-2.0.21 spec/at_in_spec.rb
rufus-scheduler-2.0.20 spec/at_in_spec.rb
rufus-scheduler-2.0.19 spec/at_in_spec.rb
rufus-scheduler-2.0.18 spec/at_in_spec.rb
rufus-scheduler-2.0.17 spec/at_in_spec.rb
rufus-scheduler-2.0.16 spec/at_in_spec.rb
rufus-scheduler-2.0.15 spec/at_in_spec.rb
rufus-scheduler-2.0.14 spec/at_in_spec.rb
rufus-scheduler-2.0.13 spec/at_in_spec.rb
rufus-scheduler-2.0.12 spec/at_in_spec.rb