Sha256: c5b5d4c292ca019b143104400568bab01c5f9dd9c3b7a9d6c6579ced823efbab

Contents?: true

Size: 859 Bytes

Versions: 10

Compression:

Stored size: 859 Bytes

Contents

# encoding: utf-8

require 'spec_helper'

describe Hyperdrive::Instrumenters::Memory do
  before do
    @instrumenter = Hyperdrive::Instrumenters::Memory.new
  end

  it "responds to instrument" do
    @instrumenter.respond_to?(:instrument).must_equal true
  end

  it "returns the result" do
    @instrumenter.instrument('instrumentation', 'measurement').must_equal 'measurement'
  end

  it "yields to the block and returns the result" do
    @instrumenter.instrument('instrumentation', 'measurement') { |payload| payload + '1' }.must_equal 'measurement1'
  end

  it "returns events that have been instrumented" do
    @instrumenter.instrument('instrumentation', 'measurement')
    event = @instrumenter.events.first
    event.name.must_equal 'instrumentation'
    event.payload.must_equal 'measurement'
    event.result.must_equal 'measurement'
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
hyperdrive-0.0.25 spec/hyperdrive/instrumenters/memory_spec.rb
hyperdrive-0.0.24 spec/hyperdrive/instrumenters/memory_spec.rb
hyperdrive-0.0.23 spec/hyperdrive/instrumenters/memory_spec.rb
hyperdrive-0.0.22 spec/hyperdrive/instrumenters/memory_spec.rb
hyperdrive-0.0.21 spec/hyperdrive/instrumenters/memory_spec.rb
hyperdrive-0.0.20 spec/hyperdrive/instrumenters/memory_spec.rb
hyperdrive-0.0.19 spec/hyperdrive/instrumenters/memory_spec.rb
hyperdrive-0.0.18 spec/hyperdrive/instrumenters/memory_spec.rb
hyperdrive-0.0.17 spec/hyperdrive/instrumenters/memory_spec.rb
hyperdrive-0.0.16 spec/hyperdrive/instrumenters/memory_spec.rb