Sha256: bf9f1ef20d6b2fbe0b60c92f493ff0678251340c664c4ee44e84754a7a1b90af

Contents?: true

Size: 818 Bytes

Versions: 1

Compression:

Stored size: 818 Bytes

Contents

describe StatusCat::Checkers::SendHub do

  let( :checker ) { StatusCat::Checkers::SendHub.new.freeze }

  it_should_behave_like 'a status checker'

  describe '#initialize' do

    it 'sets the value' do
      expect( checker.value ).to eql( ENV[ 'SEND_HUB_NUMBER' ] )
    end

    context 'pass' do

      it 'passes if it can connect to SendHub' do
        expect( checker.status ).to be_nil
      end
    end

    context 'fail' do

      it 'fails if it receives nil' do
        expect( @send_hub ).to receive( :get_contacts ).and_return( nil )
        expect( checker.status ).to_not be_nil
      end

      it 'fails if there is an exception' do
        expect( @send_hub ).to receive( :get_contacts ).and_raise( 'This is only a test' )
        expect( checker.status ).to_not be_nil
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
status_cat-0.1.1 spec/lib/status_cat/checkers/send_hub_spec.rb