Sha256: 73d49ad7bb9028b0aed78355a6bb93379f843132b439f70f58040f85e67e758b

Contents?: true

Size: 1.37 KB

Versions: 1

Compression:

Stored size: 1.37 KB

Contents

require 'rubygems'
require 'require_relative' if RUBY_VERSION < '1.9'

require_relative 'common.rb'

describe Deltacloud do

  before do
    Deltacloud::configure :cimi do |server|
      server.root_url '/cimi'
      server.version '1.0.2'
      server.klass 'CIMI'
      server.logger Logger
    end
  end

  it 'should return the servers configuration' do
    Deltacloud.config.must_be_kind_of Hash
    Deltacloud.config.keys.must_include :deltacloud
    Deltacloud.config.keys.must_include :cimi
    Deltacloud.config[:deltacloud].must_be_kind_of Deltacloud::Server
  end

  it 'should be able to require the correct frontned' do
    Deltacloud[:deltacloud].klass.must_equal Deltacloud::API
  end

  it 'should not require already required frontend' do
    Deltacloud.require_frontend!.must_equal false
  end

  describe Deltacloud::Server do

    it 'should provide the correct root_url' do
      Deltacloud.config[:deltacloud].root_url.must_equal '/api'
      Deltacloud.config[:cimi].root_url.must_equal '/cimi'
    end

    it 'should provide the correct version' do
      Deltacloud.config[:deltacloud].version.must_equal '1.0.2'
      Deltacloud.config[:cimi].version.must_equal '1.0.2'
    end

    it 'should provide the logger facility' do
      Deltacloud.config[:deltacloud].logger.must_equal Rack::DeltacloudLogger
      Deltacloud.config[:cimi].logger.must_equal Logger
    end

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
deltacloud-core-1.0.2 tests/deltacloud/rack_test.rb