Sha256: 527cca80ff19e62567e5071a97ff1331fdb896073f482e29645f1b60eec53cc6

Contents?: true

Size: 544 Bytes

Versions: 1

Compression:

Stored size: 544 Bytes

Contents

# frozen_string_literal: true

RSpec.describe BloodContracts::Instrumentation::FailedMatch do
  subject do
    begin
      1 / 0
    rescue StandardError => ex
      described_class.new(ex, context: validation_context)
    end
  end

  let(:validation_context) do
    { some: "data", exception: kind_of(ZeroDivisionError) }
  end

  it do
    is_expected.to be_invalid
    expect(subject.match).to eq(subject)
    expect(subject.exception).to match(kind_of(ZeroDivisionError))
    expect(subject.context).to match(validation_context)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
blood_contracts-instrumentation-0.1.1 spec/blood_contracts/instrumentation/failed_match_spec.rb