Sha256: 23eab3958e48b8e07e75d84304bfaf57407c89bfccb0c76439090c67293efc37

Contents?: true

Size: 1.02 KB

Versions: 8

Compression:

Stored size: 1.02 KB

Contents

require 'test_helper'

class HarnessModuleTest < MiniTest::Unit::TestCase
  def test_can_set_the_adapter_with_a_symbol
    Harness.config.adapter = :memory

    assert_kind_of Harness::MemoryAdapter, Harness.config.adapter
  end

  def test_can_set_the_adapter_with_an_adapter_instance
    Harness.config.adapter = Harness::MemoryAdapter.new

    assert_kind_of Harness::MemoryAdapter, Harness.config.adapter
  end

  def test_can_set_the_queue_with_a_symbol
    Harness.config.queue = :synchronous

    assert_kind_of Harness::SynchronousQueue, Harness.config.queue
  end

  def test_can_set_the_queue_with_a_queue_instance
    Harness.config.queue = Harness::SynchronousQueue.new

    assert_kind_of Harness::SynchronousQueue, Harness.config.queue
  end

  def test_uses_method_missing_to_configure_adapters
    Harness.config.librato.email = 'foo'

    assert_equal 'foo', Harness.config.librato.email
  end

  def test_blows_up_when_calling_an_unknown_adapter
    assert_raises NoMethodError do
      Harness.config.foo_bar
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
harness-0.9.1 test/unit/harness_test.rb
harness-0.9.0 test/unit/harness_test.rb
harness-0.8.1 test/unit/harness_test.rb
harness-0.8.0 test/unit/harness_test.rb
harness-0.7.0 test/unit/harness_test.rb
harness-0.6.0 test/unit/harness_test.rb
harness-0.5.0 test/unit/harness_test.rb
harness-0.4.0 test/unit/harness_test.rb