Sha256: 49670e434181d0223f0ce577ba0dc60332b3f13c422586c98b4c64b385112687

Contents?: true

Size: 896 Bytes

Versions: 4

Compression:

Stored size: 896 Bytes

Contents

RSpec.describe Dryad::Cluster do
  before do
    @portal = Dryad::Core::Portal.new(
      schema: Dryad::Core::Schema::HTTP,
      port: 3000,
      pattern: '/*',
      non_certifications: ['/*']
    )
    @service = Dryad::Consul::Service.new(
      name: 'rails',
      address: '127.0.0.1',
      group: 'staging',
      portals: [@portal],
      priority: 10,
      load_balancing: [Dryad::Core::LoadBalancing::URL_HASH]
    )
  end

  it "has a version number" do
    expect(Dryad::Cluster::VERSION).not_to be nil
  end

  it "rounds robin" do
    Dryad::Consul::ServiceRegistry.register(@service)
    service_instance = Dryad::Cluster.round_robin(
      Dryad::Core::Schema::HTTP,
      @service.name
    )
    expect(service_instance.name).to eq(@service.name)
    expect(service_instance.address).to eq(@service.address)
    Dryad::Consul::ServiceRegistry.deregister(@service)
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dryad-0.2.1 dryad-cluster/spec/dryad/cluster_spec.rb
dryad-0.2.0 dryad-cluster/spec/dryad/cluster_spec.rb
dryad-0.1.1 dryad-cluster/spec/dryad/cluster_spec.rb
dryad-0.1.0 dryad-cluster/spec/dryad/cluster_spec.rb