Sha256: 6adc0c331a3011d44e0245206c3dfbb420185d8bb45fa064e41240aadd14841f

Contents?: true

Size: 1.47 KB

Versions: 26

Compression:

Stored size: 1.47 KB

Contents

require 'rubygems'
require 'net/http'
require 'json'
require 'log4r'
require 'lib/depengine/helper/validations'
require 'lib/depengine/provider/cdb'
require 'lib/depengine/log/log'

$log       = Log::DeploymentLogger.new
$log.level = Log4r::ERROR

describe "the cdb backend" do
  include Provider
  path    = '/INT/dbde/dboverallsearch/port'
  version = 0
  it "should deliver a parameter from the cdb by path" do
    worker = Provider::CDB.new
    worker.protocol = 'http'
    worker.host     = 'localhost:4567'
    worker.context  = ''
    worker.env          = 'INT'

    result = worker.get_parameter('dbde/dboverallsearch/port', 0)
    result.should include("10123")
  end

  it "should deliver all parameters for an app from the cdb by path" do
    worker = Provider::CDB.new
    worker.protocol = 'http'
    worker.host     = 'localhost:4567'
    worker.context  = ''
    worker.env      = 'INT'

    result = worker.get_parameters('dbde/dboverallsearch', 0)
    
    result['env'].should include("INT")
    result['appname'].should include("dboverallsearch")
    result['port'].should be 10123
  end 

  it "should set a parameter in the cdb" do
    worker = Provider::CDB.new
    worker.protocol = 'http'
    worker.host     = 'localhost:4567'
    worker.context  = ''
    worker.env      = 'INT'

    worker.set_parameter('dbde/dboverallsearch', 'deployed_version', 123)
    result = worker.get_parameter('dbde/dboverallsearch/deployed_version', 0)

    result.should include("123")
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
depengine-0.0.27 spec/cdb_spec.rb
depengine-0.0.26 spec/cdb_spec.rb
depengine-0.0.25 spec/cdb_spec.rb
depengine-0.0.24 spec/cdb_spec.rb
depengine-0.0.23 spec/cdb_spec.rb
depengine-0.0.22 spec/cdb_spec.rb
depengine-0.0.21 spec/cdb_spec.rb
depengine-0.0.20 spec/cdb_spec.rb
depengine-0.0.19 spec/cdb_spec.rb
depengine-0.0.18 spec/cdb_spec.rb
depengine-0.0.17 spec/cdb_spec.rb
depengine-0.0.16 spec/cdb_spec.rb
depengine-0.0.15 spec/cdb_spec.rb
depengine-0.0.14 spec/cdb_spec.rb
depengine-0.0.13 spec/cdb_spec.rb
depengine-0.0.12 spec/cdb_spec.rb
depengine-0.0.11 spec/cdb_spec.rb
depengine-0.0.10 spec/cdb_spec.rb
depengine-0.0.9 spec/cdb_spec.rb
depengine-0.0.8 spec/cdb_spec.rb