Sha256: c4ca2e1d859bf4e3526e0534ac0c2a0d0a84688847ea2af7fcb41fa5f1cfa78f

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

Contents

require_relative 'spec_helper.rb'

describe 'Services' do
  describe '::Connection' do
    it 'should setup' do
      Services::Connection.new host: 'localhost'
    end

    it 'should fail without something to connect too' do
      expect { Services::Connection.new }.to raise_error
    end

    # chef functions in chef-spec specs ?
    # it "should accept a chef run_context" do
    #  Services::Connection.new(
    #    run_context: Chef::RunContext.new(
    #      Chef::Node.new,
    #      Chef::CookbookCollection.new,
    #      Chef::EventDispatch::Dispatcher.new
    #    )
    #  )
    # end
  end

  before(:each) do
    Services::Connection.new host: 'localhost'
  end

  it 'can set' do
    Services.set '/test/1', 1
  end

  it 'can get' do
    Services.get '/_etcd/machines'
  end

  describe '::Entity' do
    before(:each) do
      Services::Connection.new host: 'localhost'
    end

    it 'should raise when directly instanced' do
      expect { Services::Entity.new('foo') }.to  raise_error(RuntimeError)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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