Sha256: 1ddc55332d3539b13531611fff3fed7757d362ff3a23135063df2ceeafb70427

Contents?: true

Size: 570 Bytes

Versions: 7

Compression:

Stored size: 570 Bytes

Contents

require "spec_helper"

describe Arrthorizer::ArrthorizerException do
  describe :inner do
    let(:inner_exception) { Class.new(StandardError).new }

    context "when an ArrthorizerException is raised from a rescue block" do
      it "wraps the rescued exception and exposes it via the #inner method" do
        begin
          raise inner_exception
        rescue
          begin
            raise Arrthorizer::ArrthorizerException
          rescue Exception => e
            expect(e.inner).to be inner_exception
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
arrthorizer-0.4.2 spec/arrthorizer_exception/inner_spec.rb
arrthorizer-0.4.1 spec/arrthorizer_exception/inner_spec.rb
arrthorizer-0.3.2 spec/arrthorizer_exception/inner_spec.rb
arrthorizer-0.3.1 spec/arrthorizer_exception/inner_spec.rb
arrthorizer-0.3.0 spec/arrthorizer_exception/inner_spec.rb
arrthorizer-0.2.1 spec/arrthorizer_exception/inner_spec.rb
arrthorizer-0.2.0 spec/arrthorizer_exception/inner_spec.rb