mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Ensure Sidekiq.enable_delay! does not break Psych.
This commit is contained in:
parent
a60a91d3dd
commit
635e0628d2
2 changed files with 6 additions and 1 deletions
|
@ -24,7 +24,7 @@ module Sidekiq
|
|||
|
||||
module PsychAutoload
|
||||
def resolve_class(klass_name)
|
||||
return klass_name unless klass_name
|
||||
return nil if !klass_name || klass_name.empty?
|
||||
# constantize
|
||||
names = klass_name.split('::')
|
||||
names.shift if names.empty? || names.first.empty?
|
||||
|
|
|
@ -110,6 +110,11 @@ class TestExtensions < Sidekiq::Test
|
|||
assert_equal 1, q.size
|
||||
end
|
||||
|
||||
it 'allows Psych to serialize anonymous structs' do
|
||||
obj = Struct.new(:attribute).new(my: 'data')
|
||||
|
||||
assert_equal obj.attribute, Psych.load(Psych.dump(obj)).attribute
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue