Sha256: 47b46604117fedb7671ea7a99a789ddcd147da1fa1a0979c50feae9d97e8db31

Contents?: true

Size: 1.08 KB

Versions: 19

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

describe Dossier::Configuration do

  before :each do 
    Dossier.configure
    @config = Dossier.configuration
  end

  describe "defaults" do
    it "uses the rails configuration directory for the config path" do
      @config.config_path.should eq(Rails.root.join("config", "dossier.yml"))
    end
  end

  describe "client" do
    it "uses config/dossier.yml to setup the client" do
      options = YAML.load_file(Rails.root.join('config', 'dossier.yml'))[Rails.env].symbolize_keys
      Dossier::Client.should_receive(:new).with(options)
      Dossier.configure
    end

    it "will raise an exception if config/dossier.yml cannot be read" do
      config_path = Rails.root.join('config')
      FileUtils.mv config_path.join('dossier.yml'), config_path.join('dossier.yml.test')
      expect { Dossier.configure }.to raise_error(Dossier::ConfigurationMissingError)
      FileUtils.mv config_path.join('dossier.yml.test'), config_path.join('dossier.yml')
    end

    it "will setup the connection options" do
      @config.connection_options.should be_a(Hash)
    end
  end

end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
dossier-2.10.0 spec/dossier/configuration_spec.rb
dossier-2.9.3 spec/dossier/configuration_spec.rb
dossier-2.9.2 spec/dossier/configuration_spec.rb
dossier-2.9.1 spec/dossier/configuration_spec.rb
dossier-2.9.0 spec/dossier/configuration_spec.rb
dossier-2.8.0 spec/dossier/configuration_spec.rb
dossier-2.7.1 spec/dossier/configuration_spec.rb
dossier-2.7.0 spec/dossier/configuration_spec.rb
dossier-2.6.0 spec/dossier/configuration_spec.rb
dossier-2.5.2 spec/dossier/configuration_spec.rb
dossier-2.5.1 spec/dossier/configuration_spec.rb
dossier-2.5.0 spec/dossier/configuration_spec.rb
dossier-2.4.0 spec/dossier/configuration_spec.rb
dossier-2.3.0 spec/dossier/configuration_spec.rb
dossier-2.2.0 spec/dossier/configuration_spec.rb
dossier-2.1.1 spec/dossier/configuration_spec.rb
dossier-2.1.0 spec/dossier/configuration_spec.rb
dossier-2.0.1 spec/dossier/configuration_spec.rb
dossier-2.0.0 spec/dossier/configuration_spec.rb