Sha256: 99d0c234b977b06bb3e08641e38f6fd4fe6ea752088b994b019e45860013ac41

Contents?: true

Size: 602 Bytes

Versions: 1

Compression:

Stored size: 602 Bytes

Contents

require_relative 'support/spec_helper'

require 'contextual_exceptions/class_refinement'

include ContextualExceptions
using ClassRefinement

class SubjectClass
  exceptions :subject_error
end

describe ClassRefinement do
  it '::with_context should work' do
    local_message = 'local message'
    full_context = nil
    begin
      raise
    rescue => full_context
    end
    patient = SubjectClass::SubjectError.with_context(local_message, full_context)

    patient.message.must_equal(local_message << ": #{full_context.message}")
    patient.backtrace.must_equal full_context.backtrace
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
contextual_exceptions-0.0.2 spec/class_refinement_spec.rb