Sha256: d7899608678d626491e775e70bfbc1c1c3380f794a4836bb728c099216e348ac
Contents?: true
Size: 1009 Bytes
Versions: 9
Compression:
Stored size: 1009 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" }) {} expect(subject).to have_received(:start) end it "calls finish" do allow(subject).to receive(:finish) subject.instrument("name", { key: "value" }) {} 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
9 entries across 9 versions & 1 rubygems