Sha256: 9b85180fdf12d79c60d64578ef62d38df8a261b1972e1dc21faccba3ca3f3b3e

Contents?: true

Size: 771 Bytes

Versions: 24

Compression:

Stored size: 771 Bytes

Contents

require 'spec_helper'

describe DashingContrib::RunnableJob do

  describe 'Common States' do
    it { expect(DashingContrib::RunnableJob::WARNING).to eq 'warning' }
    it { expect(DashingContrib::RunnableJob::CRITICAL).to eq 'critical' }
    it { expect(DashingContrib::RunnableJob::OK).to eq 'ok' }
  end

  describe '#run' do
    context 'when event name is not provided' do
      it { expect { DashingContrib::RunnableJob.run }.to raise_exception(':event String is required to identify a job name') }
    end

    context 'when event name is provided' do
      let(:event_name) { 'test-event' }
      after(:each) { DashingContrib::RunnableJob.run(event: event_name) }
      it { expect(SCHEDULER).to receive(:every).with('30s', { first_in: 0 }) }
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
dashing-contrib-0.2.9 spec/runnable_job_spec.rb
dashing-contrib-0.2.8 spec/runnable_job_spec.rb
dashing-contrib-0.2.7 spec/runnable_job_spec.rb
dashing-contrib-0.2.6 spec/runnable_job_spec.rb
dashing-contrib-0.2.5 spec/runnable_job_spec.rb
dashing-contrib-0.2.4 spec/runnable_job_spec.rb
dashing-contrib-0.2.3 spec/runnable_job_spec.rb
dashing-contrib-0.2.2 spec/runnable_job_spec.rb
dashing-contrib-0.2.1 spec/runnable_job_spec.rb
dashing-contrib-0.2.0 spec/runnable_job_spec.rb
dashing-contrib-0.1.14 spec/runnable_job_spec.rb
dashing-contrib-0.1.12 spec/runnable_job_spec.rb
dashing-contrib-0.1.11 spec/runnable_job_spec.rb
dashing-contrib-0.1.10 spec/runnable_job_spec.rb
dashing-contrib-0.1.9 spec/runnable_job_spec.rb
dashing-contrib-0.1.8 spec/runnable_job_spec.rb
dashing-contrib-0.1.7 spec/runnable_job_spec.rb
dashing-contrib-0.1.6 spec/runnable_job_spec.rb
dashing-contrib-0.1.5 spec/runnable_job_spec.rb
dashing-contrib-0.1.4 spec/runnable_job_spec.rb