2015-12-31 18:33:35 -05:00
|
|
|
# frozen_string_literal: true
|
2015-07-14 00:55:24 -04:00
|
|
|
require_relative 'helper'
|
|
|
|
|
|
|
|
$HAS_AJ = true
|
|
|
|
begin
|
|
|
|
require 'active_job'
|
2015-07-14 01:00:22 -04:00
|
|
|
rescue LoadError
|
|
|
|
$HAS_AJ = false
|
2015-07-14 00:55:24 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
class TestRails < Sidekiq::Test
|
|
|
|
|
|
|
|
describe 'ActiveJob' do
|
|
|
|
it 'does not allow Sidekiq::Worker in AJ::Base classes' do
|
|
|
|
ex = assert_raises ArgumentError do
|
|
|
|
c = Class.new(ActiveJob::Base)
|
2015-07-14 01:45:52 -04:00
|
|
|
c.send(:include, Sidekiq::Worker)
|
2015-07-14 00:55:24 -04:00
|
|
|
end
|
|
|
|
assert_includes ex.message, "cannot include"
|
|
|
|
end if $HAS_AJ
|
|
|
|
end
|
|
|
|
end
|