Sha256: 50e54b0c8b6c68bd186c535fdb8769364b1e0afcf3bbe04a72ca75c65badc02c

Contents?: true

Size: 811 Bytes

Versions: 27

Compression:

Stored size: 811 Bytes

Contents

require 'spec_helper'

describe GH::Instrumentation do
  before do
    @events = []
    subject.instrumenter = proc { |*a, &b| @events << a and b[] }
    stub_request(:get, "https://api.github.com/").to_return :body => "{}"
  end

  it 'instruments http' do
    subject.http :get, '/'
    @events.size.should be == 1
    @events.first.should be == ['http.gh', {:verb => :get, :url => '/', :gh => subject}]
  end

  it 'instruments []' do
    subject['/']
    @events.size.should be == 2
    @events.should be == [
      ['access.gh', {:key => '/', :gh => subject}],
      ['http.gh', {:verb => :get, :url => '/', :gh => subject}]
    ]
  end

  it 'instruments load' do
    subject.load("[]")
    @events.size.should be == 1
    @events.first.should be == ['load.gh', {:data => "[]", :gh => subject}]
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
gh-0.13.0 spec/instrumentation_spec.rb
gh-0.12.4 spec/instrumentation_spec.rb
gh-0.12.3 spec/instrumentation_spec.rb
gh-0.12.2 spec/instrumentation_spec.rb
gh-0.12.1 spec/instrumentation_spec.rb
gh-0.12.0 spec/instrumentation_spec.rb
gh-0.11.3 spec/instrumentation_spec.rb
gh-0.11.2 spec/instrumentation_spec.rb
gh-0.11.1 spec/instrumentation_spec.rb
gh-0.11.0 spec/instrumentation_spec.rb
gh-0.10.3 spec/instrumentation_spec.rb
gh-0.10.2 spec/instrumentation_spec.rb
gh-0.10.1 spec/instrumentation_spec.rb
gh-0.10.0 spec/instrumentation_spec.rb
gh-0.9.2 spec/instrumentation_spec.rb
gh-0.9.1 spec/instrumentation_spec.rb
gh-0.9.0 spec/instrumentation_spec.rb
gh-0.8.0 spec/instrumentation_spec.rb
gh-0.7.3 spec/instrumentation_spec.rb
gh-0.7.1 spec/instrumentation_spec.rb