Sha256: dc1f3df3f23c48f2ee3abf7271ce65b2b3c4b74e8783b8e8a53dee95712a682a

Contents?: true

Size: 732 Bytes

Versions: 2

Compression:

Stored size: 732 Bytes

Contents

require_relative 'spec_helper'
describe 'Services::Service' do
  let(:c) { Services::Connection.new host: 'localhost' }
  let(:m1) { Services::Member.new 'test_member', service: 'test', ip: '127.0.0.2', port: 80, weight: 20 }
  let(:m2) { Services::Member.new 'test_member2', service: 'test', ip: '127.0.0.3', port: 80, weight: 20 }

  it 'should load the test service' do
    Services::Connection.new host: 'localhost'
    members = Services::Service.new('test').members
    members.length.should eql 2
    members[0].to_hash.should eql m1.to_hash
    members[1].to_hash.should eql m2.to_hash
  end

  it 'should handle non-existant services' do
    expect { Services::Service.new 'should_not_exist' }.to_not raise_error
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
jn_services-1.0.1 spec/service_spec.rb
jn_services-1.0.0 spec/service_spec.rb