Sha256: bc863da5b5053eca97e8c095b044629eb4df2c2f5faed84457eeb85a1804a3da

Contents?: true

Size: 1.06 KB

Versions: 5

Compression:

Stored size: 1.06 KB

Contents

require 'spec_helper'
require 'server_helper'

require 'kangaroo/util/configuration'

module Kangaroo
  module Util
    describe Configuration do
      include TestServerHelper

      def config_file
        File.join File.dirname(__FILE__), '..', 'test_env', 'test.yml'
      end

      it "configures Kangaroo by config file" do
        config = Kangaroo::Util::Configuration.new(config_file, Logger.new('/dev/null'))

        config.models.should == ['res.*']
        config.database.db_name.should == 'kangaroo_test_database'
        config.database.user.should == 'admin'
        config.database.password.should == 'admin'
      end

      it 'authorizes the configured user before model loading' do
        config = Kangaroo::Util::Configuration.new(config_file, Logger.new('/dev/null'))
        loader = mock('loader')
        loader.stub! :load!
        Loader.stub!(:new).and_return loader

        common_service.should_receive(:xmlrpc_call).
                        with('login', 'kangaroo_test_database', 'admin', 'admin')
        config.load_models
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kangaroo-0.1.0.alpha1 spec/util/configuration_spec.rb
kangaroo-0.0.3 spec/util/configuration_spec.rb
kangaroo-0.0.2 spec/util/configuration_spec.rb
kangaroo-0.0.1.pre2 spec/util/configuration_spec.rb
kangaroo-0.0.1.pre spec/util/configuration_spec.rb