1
0
Fork 0
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:
James McCarthy 2017-07-29 13:26:44 +07:00 committed by Mike Perham
parent a60a91d3dd
commit 635e0628d2
2 changed files with 6 additions and 1 deletions

View file

@ -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?

View file

@ -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