Sha256: bafb2bca6ed0afc5b39519c2695b299258f7469dfd3ddf9173f6c245f7d389c6

Contents?: true

Size: 1021 Bytes

Versions: 25

Compression:

Stored size: 1021 Bytes

Contents

require File.expand_path("../spec_helper", __dir__)

RSpec.describe SearchFlip::NullInstrumenter do
  subject { described_class.new }

  describe "#instrument" do
    it "calls start" do
      allow(subject).to receive(:start)

      subject.instrument("name", { key: "value" }) { true }

      expect(subject).to have_received(:start)
    end

    it "calls finish" do
      allow(subject).to receive(:finish)

      subject.instrument("name", { key: "value" }) { true }

      expect(subject).to have_received(:finish)
    end

    it "yields and passes the payload" do
      yielded_payload = nil

      subject.instrument("name", { key: "value" }) { |payload| yielded_payload = payload }

      expect(yielded_payload).to eq(key: "value")
    end
  end

  describe "#start" do
    it "returns true" do
      expect(subject.start("name", { key: "value" })).to eq(true)
    end
  end

  describe "#finish" do
    it "returns true" do
      expect(subject.finish("name", { key: "value" })).to eq(true)
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
search_flip-3.9.0 spec/search_flip/null_instrumenter_spec.rb
search_flip-4.0.0.beta16 spec/search_flip/null_instrumenter_spec.rb
search_flip-4.0.0.beta15 spec/search_flip/null_instrumenter_spec.rb
search_flip-4.0.0.beta14 spec/search_flip/null_instrumenter_spec.rb
search_flip-3.8.0 spec/search_flip/null_instrumenter_spec.rb
search_flip-4.0.0.beta13 spec/search_flip/null_instrumenter_spec.rb
search_flip-3.7.2 spec/search_flip/null_instrumenter_spec.rb
search_flip-4.0.0.beta12 spec/search_flip/null_instrumenter_spec.rb
search_flip-3.7.1 spec/search_flip/null_instrumenter_spec.rb
search_flip-4.0.0.beta11 spec/search_flip/null_instrumenter_spec.rb
search_flip-3.7.0 spec/search_flip/null_instrumenter_spec.rb
search_flip-4.0.0.beta10 spec/search_flip/null_instrumenter_spec.rb
search_flip-3.6.0 spec/search_flip/null_instrumenter_spec.rb
search_flip-3.5.0 spec/search_flip/null_instrumenter_spec.rb
search_flip-4.0.0.beta9 spec/search_flip/null_instrumenter_spec.rb
search_flip-4.0.0.beta8 spec/search_flip/null_instrumenter_spec.rb
search_flip-3.4.0 spec/search_flip/null_instrumenter_spec.rb
search_flip-3.3.0 spec/search_flip/null_instrumenter_spec.rb
search_flip-4.0.0.beta7 spec/search_flip/null_instrumenter_spec.rb
search_flip-4.0.0.beta6 spec/search_flip/null_instrumenter_spec.rb