Skip to content

Commit

Permalink
Update MultiJson delegate methods to coincide with their future API and
Browse files Browse the repository at this point in the history
add supporting test.
  • Loading branch information
brandonhilkert committed Dec 2, 2012
1 parent 3c9e0d6 commit d4df84e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ def self.server_middleware
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
Expand Down
14 changes: 14 additions & 0 deletions test/test_sidekiq.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d4df84e

Please sign in to comment.