Sha256: 5401d67efee712689265781a4576222ec4a6fcfeeaec32bd908e592bd94faed4

Contents?: true

Size: 555 Bytes

Versions: 8

Compression:

Stored size: 555 Bytes

Contents

# frozen_string_literal: true

require 'spec_helper'

RSpec.describe Zoom::Error do
  let(:rescue?) { false }

  subject do
    begin
      raise Zoom::ParameterMissing, "msg"
    rescue Zoom::Error => error
      if rescue?
        true
      else
        raise error
      end
    end
  end

  it 'raises specific errors' do
    expect { subject }.to raise_error(Zoom::ParameterMissing, "msg")
  end

  context 'with errors rescued' do
    let(:rescue?) { true }

    it 'descends from Zoom::Error' do
      expect(subject).to be true
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
zoom_rb-1.1.11 spec/lib/zoom/errors_spec.rb
zoom_rb-1.1.10 spec/lib/zoom/errors_spec.rb
zoom_rb-1.1.9 spec/lib/zoom/errors_spec.rb
zoom_rb-1.1.8 spec/lib/zoom/errors_spec.rb
zoom_rb-1.1.7 spec/lib/zoom/errors_spec.rb
zoom_rb-1.1.6 spec/lib/zoom/errors_spec.rb
zoom_rb-1.1.5 spec/lib/zoom/errors_spec.rb
zoom_rb-1.1.4 spec/lib/zoom/errors_spec.rb