Sha256: b6b4ba901bed527520a9cc68d156f28f3afdf28edc81bf56790e757e735a383d

Contents?: true

Size: 1.02 KB

Versions: 8

Compression:

Stored size: 1.02 KB

Contents

# encoding: utf-8
require 'helper'

class TestSidekiq < Minitest::Test
  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 & 1 rubygems

Version Path
sidekiq-2.14.1 test/test_sidekiq.rb
sidekiq-2.14.0 test/test_sidekiq.rb
sidekiq-2.13.1 test/test_sidekiq.rb
sidekiq-2.13.0 test/test_sidekiq.rb
sidekiq-2.12.4 test/test_sidekiq.rb
sidekiq-2.12.3 test/test_sidekiq.rb
sidekiq-2.12.1 test/test_sidekiq.rb
sidekiq-2.12.0 test/test_sidekiq.rb