Sha256: e9c6329298b91a3c43992ec7ea3a4f3898e255879176f11b8653d62a82a0c17b

Contents?: true

Size: 657 Bytes

Versions: 6

Compression:

Stored size: 657 Bytes

Contents

require_relative '../test_helper'

class WolverineIntegrationTest < MiniTest::Unit::TestCase

  CONTENT = File.read(File.expand_path('../lua/util/mexists.lua', __FILE__))

  def mock_redis
    stub.tap do |redis|
      redis.expects(:evalsha).
        with('fe24f4dd4ba7881608cca4b846f009195e06d79a', 2, :a, :b).
        raises("NOSCRIPT")
      redis.expects(:eval).
        with(CONTENT, 2, :a, :b).
        returns([1, 0])
    end
  end

  def test_everything
    Wolverine.config.redis = mock_redis
    Wolverine.config.script_path = Pathname.new(File.expand_path('../lua', __FILE__))

    assert_equal [1, 0], Wolverine.util.mexists(:a, :b)
  end

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
wolverine-0.2.2 test/integration/wolverine_integration_test.rb
wolverine-0.2.1 test/integration/wolverine_integration_test.rb
wolverine-0.2.0 test/integration/wolverine_integration_test.rb
wolverine-0.1.3 test/integration/wolverine_integration_test.rb
wolverine-0.1.2 test/integration/wolverine_integration_test.rb
wolverine-0.1.1 test/integration/wolverine_integration_test.rb