Sha256: 564915d1e9b9605c719c822cb3b2d02f40f52f8ea444ef1e0d9d1d833cece7aa

Contents?: true

Size: 752 Bytes

Versions: 5

Compression:

Stored size: 752 Bytes

Contents

require 'spec_helper'

describe ActiveRecord::Turntable::Shard do
  before(:all) do
    reload_turntable!(File.join(File.dirname(__FILE__), "../../config/turntable.yml"))
  end

  context "When initialized" do
    before do
      establish_connection_to("test")
      truncate_shard
    end

    subject {
      ActiveRecord::Turntable::Shard.new(ActiveRecord::Base.turntable_config[:clusters][:user_cluster][:shards][0])
    }
    its(:name) { should == ActiveRecord::Base.turntable_config[:clusters][:user_cluster][:shards][0][:connection] }
    its(:connection) { should be_instance_of(ActiveRecord::ConnectionAdapters::Mysql2Adapter) }
    its(:connection_pool) { should be_instance_of(ActiveRecord::ConnectionAdapters::ConnectionPool) }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
activerecord-turntable-1.1.2 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-1.1.1 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-1.1.0 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-1.0.1 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-1.0.0 spec/active_record/turntable/shard_spec.rb