Sha256: 2f01d364e425d67e58dcb2eea0442157013b64fed8100d078b2c553bc16334bb

Contents?: true

Size: 1013 Bytes

Versions: 2

Compression:

Stored size: 1013 Bytes

Contents

require File.join(File.expand_path('../test_helper', __FILE__))

class WolverineTest < MiniTest::Unit::TestCase

  def test_redis
    Wolverine.config.redis = :redis
    assert_equal :redis, Wolverine.redis
  end

  def test_reset!
    dir = Wolverine.root_directory
    assert_equal Wolverine.root_directory, dir
    Wolverine.reset!
    refute_equal Wolverine.root_directory, dir
  end

  def test_instantiate_wolverine_with_config
    r = Struct.new(:Redis)
    config = Wolverine::Configuration.new(r, 'path')
    wolverine = Wolverine.new(config)

    assert_equal r, wolverine.config.redis
    assert_equal r, wolverine.redis
    assert_equal 'path', wolverine.config.script_path
  end

  def test_instantiate_without_config_dups_the_default_config
    Wolverine.config.redis = :redis
    wolverine = Wolverine.new
    assert_equal :redis, wolverine.config.redis
    wolverine.config.redis = :foobar
    assert_equal :foobar, wolverine.config.redis
    assert_equal :redis, Wolverine.config.redis
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wolverine-0.3.4 test/wolverine_test.rb
wolverine-0.3.3 test/wolverine_test.rb