mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Raise error if required filed was not loaded
This commit is contained in:
parent
33f1e2a4ee
commit
8e8586108d
3 changed files with 4 additions and 10 deletions
|
@ -244,7 +244,10 @@ module Sidekiq
|
|||
end
|
||||
options[:tag] ||= default_tag
|
||||
else
|
||||
require options[:require] or raise ArgumentError, "#{options[:require]} was not required"
|
||||
not_required_message = "#{options[:require]} was not required, you should use an explicit path: " +
|
||||
"./#{options[:require]} or /path/to/#{options[:require]}"
|
||||
|
||||
require(options[:require]) || raise(ArgumentError, not_required_message)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
# Is used for testing purposes
|
|
@ -31,14 +31,6 @@ class TestCli < Sidekiq::Test
|
|||
assert @cli.valid?
|
||||
end
|
||||
|
||||
it 'does not require existing file' do
|
||||
@cli.parse(['sidekiq', '-r', 'sidekiq.rb'])
|
||||
|
||||
assert_raises ArgumentError do
|
||||
@cli.run
|
||||
end
|
||||
end
|
||||
|
||||
it 'does not boot rails' do
|
||||
refute defined?(::Rails::Application)
|
||||
@cli.parse(['sidekiq', '-r', './myapp'])
|
||||
|
|
Loading…
Add table
Reference in a new issue