Sha256: a210c5622f34ea142c6532ec844411f7b5fdef0352357554dded448bbd12a55d

Contents?: true

Size: 1.03 KB

Versions: 8

Compression:

Stored size: 1.03 KB

Contents

# encoding: utf-8
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

  describe "redis connection" do
  	it "returns error without creating a connection if block is not given" do
      mock = MiniTest::Mock.new
      mock.expect :create, nil #Sidekiq::RedisConnection, create
  		assert_raises(ArgumentError) {
  			Sidekiq.redis
  		}
      assert_raises(MockExpectationError, "create should not be called") do
        mock.verify
      end
  	end
  end

  describe "❨╯°□°❩╯︵┻━┻" do
    before { $stdout = StringIO.new }
    after  { $stdout = STDOUT }

    it "allows angry developers to express their emotional constitution and remedies it" do
      Sidekiq.❨╯°□°❩╯︵┻━┻
      assert_equal "Calm down, bro\n", $stdout.string
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
sidekiq-statsd-0.1.1 vendor/ruby/1.9.1/gems/sidekiq-2.11.2/test/test_sidekiq.rb
sidekiq-statsd-0.1.0 vendor/ruby/1.9.1/gems/sidekiq-2.11.2/test/test_sidekiq.rb
sidekiq-2.11.2 test/test_sidekiq.rb
sidekiq-2.11.1 test/test_sidekiq.rb
sidekiq-2.11.0 test/test_sidekiq.rb
sidekiq-2.10.1 test/test_sidekiq.rb
sidekiq-2.10.0 test/test_sidekiq.rb
sidekiq-2.9.0 test/test_sidekiq.rb