Sha256: 2722ed0617d0c1409a130da44e6e2144fc8ce8c25f16567215590cb1ef4ff0c7

Contents?: true

Size: 691 Bytes

Versions: 4

Compression:

Stored size: 691 Bytes

Contents

require 'spec_helper'
require 'rake'

load 'tasks/crono_tasks.rake'
Rake::Task.define_task(:environment)

describe 'rake' do
  describe 'crono:clean' do
    it 'should clean unused tasks from DB' do
      Crono::CronoJob.create!(job_id: 'used_job')
      ENV['CRONOTAB'] = File.expand_path('../../assets/good_cronotab.rb', __FILE__)
      Rake::Task['crono:clean'].invoke
      expect(Crono::CronoJob.where(job_id: 'used_job')).not_to exist
    end
  end

  describe 'crono:check' do
    it 'should check cronotab syntax' do
      ENV['CRONOTAB'] = File.expand_path('../../assets/bad_cronotab.rb', __FILE__)
      expect { Rake::Task['crono:check'].invoke }.to raise_error
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
crono-2.1.0 spec/tasks/crono_tasks_spec.rb
crono-2.0.1 spec/tasks/crono_tasks_spec.rb
crono-2.0.0 spec/tasks/crono_tasks_spec.rb
crono-0.8.1 spec/tasks/crono_tasks_spec.rb