Sha256: fcd05d1623a95cbbe8c4b52b37a32fe64a5cdfc362f3323605e57c71a1ef5db6

Contents?: true

Size: 753 Bytes

Versions: 7

Compression:

Stored size: 753 Bytes

Contents

require 'spec_helper'
describe ConnectionManager::Using::Proxy do
  before(:each) do
    @proxy =  ConnectionManager::Using::Proxy.new(Fruit, OtherConnection)
  end

  describe '#connection' do
    it 'returns connection from connection_class' do
      expect(@proxy.connection.config).to eql(OtherConnection.connection.config)
    end
  end
  describe '#superclass' do
    it "should return the @klass's superclass" do
      expect(@proxy.superclass).to eql(Fruit.superclass)
    end
  end
  describe '#method_missing' do
    it "should direct to @klass" do
      expect(@proxy.table_name).to eql(Fruit.table_name)
    end
  end
  describe '#responds_to?' do
  	it "should direct to @klass" do
  		expect(@proxy).to respond_to(:where)
  	end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
connection_manager-2.0.0 spec/lib/using_proxy_spec.rb
connection_manager-1.1.5 spec/lib/using_proxy_spec.rb
connection_manager-1.1.4 spec/lib/using_proxy_spec.rb
connection_manager-1.1.3 spec/lib/using_proxy_spec.rb
connection_manager-1.1.2 spec/lib/using_proxy_spec.rb
connection_manager-1.1.1 spec/lib/using_proxy_spec.rb
connection_manager-1.1.0 spec/lib/using_proxy_spec.rb