mirror of
https://github.com/mperham/sidekiq.git
synced 2022-11-09 13:52:34 -05:00
Update MultiJson delegate methods to coincide with their future API and
add supporting test.
This commit is contained in:
parent
3c9e0d64b5
commit
d4df84e8b0
2 changed files with 16 additions and 2 deletions
|
@ -90,11 +90,11 @@ module Sidekiq
|
|||
end
|
||||
|
||||
def self.load_json(string)
|
||||
MultiJson.decode(string)
|
||||
MultiJson.load(string)
|
||||
end
|
||||
|
||||
def self.dump_json(object)
|
||||
MultiJson.encode(object)
|
||||
MultiJson.dump(object)
|
||||
end
|
||||
|
||||
def self.logger
|
||||
|
|
14
test/test_sidekiq.rb
Normal file
14
test/test_sidekiq.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
require 'helper'
|
||||
|
||||
class TestSidekiq < MiniTest::Unit::TestCase
|
||||
describe 'json processing' do
|
||||
it 'loads json' do
|
||||
assert_equal ({"foo" => "bar"}), Sidekiq.load_json("{\"foo\":\"bar\"}")
|
||||
end
|
||||
|
||||
it 'dumps json' do
|
||||
assert_equal "{\"foo\":\"bar\"}", Sidekiq.dump_json({ "foo" => "bar" })
|
||||
end
|
||||
end
|
||||
|
||||
end
|
Loading…
Reference in a new issue