Sha256: 23a8040764b2e8ca020757a8f7d653fc0351a7827cffe9cab8745475c83ff43e

Contents?: true

Size: 1007 Bytes

Versions: 6

Compression:

Stored size: 1007 Bytes

Contents

require File::expand_path('../../spec_helper', __FILE__)
require 'opbeat'
require 'faraday'

http = Faraday.new do |builder|
  builder.adapter :test do |stub|
    stub.get('/') { |env| [ 200, {}, 'foo' ]}
  end
end

describe Opbeat::Client do
  before do
    @configuration = Opbeat::Configuration.new
    @configuration.environments = ["test"]
    @configuration.current_environment = :test
    @configuration.secret_token = 'test'
    @configuration.organization_id = 'test'
    @configuration.app_id = 'test'
    @client = Opbeat::Client.new(@configuration)
    allow(@client).to receive(:send)
  end

  it 'send_release should send' do
    message = "Test message"
    expect(@client).to receive(:send).with("/releases/", message)
    @client.send_release(message)
  end

  it 'send_message should send' do
    event = Opbeat::Event.new :message => "my message"
    req = http.get '/'
    expect(@client).to receive(:send).with("/errors/", event).and_return(req)
    @client.send_event(event)
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
kuende-opbeat-2.0.4 spec/opbeat/client_spec.rb
kuende-opbeat-2.0.3 spec/opbeat/client_spec.rb
kuende-opbeat-2.0.2 spec/opbeat/client_spec.rb
kuende-opbeat-2.0.1 spec/opbeat/client_spec.rb
opbeat-2.0.0 spec/opbeat/client_spec.rb
opbeat-1.1.1 spec/opbeat/client_spec.rb