Move TestJob to spec_helper.rb

This commit is contained in:
Dzmitry Plashchynski
2015-03-22 23:37:01 +02:00
parent fa97f573e0
commit 0c77c490bd
5 changed files with 11 additions and 26 deletions

View File

@@ -1,11 +1,6 @@
require 'spec_helper'
require 'crono/cli'
class TestJob
def perform
end
end
describe Crono::CLI do
let(:cli) { Crono::CLI.instance }

View File

@@ -1,16 +1,5 @@
require 'spec_helper'
class TestJob
def perform
end
end
class TestFailingJob
def perform
fail 'Some error'
end
end
describe Crono::Job do
let(:period) { Crono::Period.new(2.day) }
let(:job) { Crono::Job.new(TestJob, period) }

View File

@@ -1,10 +1,5 @@
require 'spec_helper'
class TestJob
def perform
end
end
describe Crono::PerformerProxy do
it 'should add job to schedule' do
expect(Crono.scheduler).to receive(:add_job).with(kind_of(Crono::Job))

View File

@@ -1,10 +1,5 @@
require 'spec_helper'
class TestJob
def perform
end
end
describe Crono::Scheduler do
before(:each) do
@scheduler = Crono::Scheduler.new

View File

@@ -13,3 +13,14 @@ ActiveRecord::Base.establish_connection(
ActiveRecord::Base.logger = Logger.new(STDOUT)
CreateCronoJobs.up
class TestJob
def perform
end
end
class TestFailingJob
def perform
fail 'Some error'
end
end