Sha256: 26f8bb4315c88275558a1297bee28949eb18b6f8bad1e31a87f19bdb1b58079c

Contents?: true

Size: 751 Bytes

Versions: 23

Compression:

Stored size: 751 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

23 entries across 23 versions & 1 rubygems

Version Path
activerecord-turntable-2.5.0 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.4.0 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.3.3 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.3.2 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.3.1 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.3.0 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.2.2 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.2.1 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.2.0 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.1.1 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.1.0 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.1.0.rc2 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.1.0.rc1 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.1.0.beta2 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.1.0.beta1 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.0.6 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.0.5 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.0.4 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.0.3 spec/active_record/turntable/shard_spec.rb
activerecord-turntable-2.0.2 spec/active_record/turntable/shard_spec.rb