Sha256: bedd5981366712b1581a69010fefbe4b83170c337793c6de65b14e11cb92cee8

Contents?: true

Size: 846 Bytes

Versions: 3

Compression:

Stored size: 846 Bytes

Contents

RSpec.describe Dryad do
  it "has a valid version number" do
    version = File.read(File.expand_path("../../DRYAD_VERSION", __dir__)).strip
    expect(Dryad::Core::VERSION).to eq(version)
  end

  it "can be configured with config file" do
    environment = ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "default"
    default_consul_config = YAML.load(ERB.new(File.read(ENV['DRYAD_CONFIG_FILE'])).result)[environment]["consul"]
    expect(Dryad.configuration.consul[:host]).to eq(default_consul_config["host"])
    expect(Dryad.configuration.consul[:port]).to eq(default_consul_config["port"])
  end

  it "can be configured with block" do
    consul_config = { host: "block.consul.example", port: 8500 }
    Dryad.configure do |config|
      config.consul = consul_config
    end

    expect(Dryad.configuration.consul).to eq(consul_config)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dryad-0.2.0 dryad-core/spec/dryad_spec.rb
dryad-0.1.1 dryad-core/spec/dryad_spec.rb
dryad-0.1.0 dryad-core/spec/dryad_spec.rb