Sha256: 8cca3fe2b2badb885d6e62364446a08cf5704509f802d64a30f0cb13d37411cd

Contents?: true

Size: 1.17 KB

Versions: 5

Compression:

Stored size: 1.17 KB

Contents

require File.dirname(__FILE__) + '/helper'
require 'fileutils'

class BaseTest < OpenX::TestCase

  def teardown
    Base.connection = nil
  end

  test "uses (shared) default connection" do
    assert_equal OpenX::Services.default_connection, Base.connection
    assert_equal Base.connection, Banner.connection
  end

  test "can use custom connection" do
    Base.establish_connection(OpenX.configuration)

    assert_not_equal OpenX::Services.default_connection, Base.connection
    assert_not_equal Base.connection, Banner.connection
  end

  test "can temporarily use a custom connection" do
    assert_equal OpenX::Services.default_connection, Base.connection
    assert_equal Base.connection, Banner.connection

    Base.with_connection(OpenX.configuration) do
      assert_not_equal OpenX::Services.default_connection, Base.connection
      assert_not_equal Base.connection, Banner.connection
    end

    assert_equal OpenX::Services.default_connection, Base.connection
    assert_equal Base.connection, Banner.connection
  end

  test "has remote client reference" do
    assert_instance_of OpenX::XmlrpcSessionClient, Base.remote
    assert_equal Banner.remote, Base.remote
  end

end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
krakatoa-openx-1.9.4 test/test_base.rb
bsm-openx-1.9.4 test/test_base.rb
bsm-openx-1.9.3 test/test_base.rb
bsm-openx-1.9.2 test/test_base.rb
bsm-openx-1.9.1 test/test_base.rb