Sha256: 068c36b24a8f0763c3b68a9e589b557d1d72e8f8f57c133d6c74a747f9f17d60

Contents?: true

Size: 514 Bytes

Versions: 3

Compression:

Stored size: 514 Bytes

Contents

require "spec_helper"

describe UsesOtherYml do
  before do
    ActiveRecord::Base.send(:include, MultiConfig::ORMs::ActiveRecord)
    UsesOtherYml.config_file = 'other'
  end

  it "connects to the default database" do
    UsesOtherYml.connection.instance_variable_get(:@config)[:database].split('/').last.should == "other_db"
  end

  it "stores an entry in @@_multi_config_db_configs" do
    UsesOtherYml.send(:class_variable_get, :'@@_multi_config_db_configs').should == {"other" => ["UsesOtherYml"]}
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
multi_config-1.0.0 spec/models/uses_other_yml_spec.rb
multi_config-0.2.2 spec/models/uses_other_yml_spec.rb
multi_config-0.2.0 spec/models/uses_other_yml_spec.rb