Sha256: 32bea5c56f4dcb5406e71ceda162ef1c25189f47aa67bd968ff7622272ee4e58

Contents?: true

Size: 1.76 KB

Versions: 4

Compression:

Stored size: 1.76 KB

Contents

require 'spec_helper'

require 'deployml/configuration'

describe Configuration do
  it "should accept String keys" do
    config = Configuration.new('orm' => :datamapper)

    config.orm.should == :datamapper
  end

  it "should accept Symbol keys" do
    config = Configuration.new(:orm => :datamapper)

    config.orm.should == :datamapper
  end

  it "should parse 'dest' String URIs" do
    config = Configuration.new(
      :dest => 'ssh://user@www.example.com/srv/project'
    )

    config.dest.scheme.should == 'ssh'
    config.dest.user.should == 'user'
    config.dest.host.should == 'www.example.com'
    config.dest.path.should == '/srv/project'
  end

  it "should parse 'dest' Hash URIs" do
    config = Configuration.new(:dest => {
        'scheme' => 'ssh',
        'user' => 'user',
        'host' => 'www.example.com',
        'path' => '/srv/project'
    })

    config.dest.scheme.should == 'ssh'
    config.dest.user.should == 'user'
    config.dest.host.should == 'www.example.com'
    config.dest.path.should == '/srv/project'
  end

  it "should default the 'debug' option to false" do
    config = Configuration.new

    config.debug.should == false
  end

  it "should default the environment to nil" do
    config = Configuration.new

    config.environment.should be_nil
  end

  it "should accept a Symbol for the 'server' option" do
    config = Configuration.new(:server => :thin)

    config.server_name.should == :thin
    config.server_options.should be_empty
  end

  it "should accept a Hash for the 'server' option" do
    config = Configuration.new(
      :server => {
        :name => :thin,
        :options => {:address => '127.0.0.1'}
      }
    )

    config.server_name.should == :thin
    config.server_options.should == {:address => '127.0.0.1'}
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
deployml-0.4.2 spec/configuration_spec.rb
deployml-0.4.1 spec/configuration_spec.rb
deployml-0.4.0 spec/configuration_spec.rb
deployml-0.3.0 spec/configuration_spec.rb