Sha256: c61bb8ea0b9f3b2345dcaa0581a2c4298e1c17a7f016286b258da5d6ea06524a

Contents?: true

Size: 733 Bytes

Versions: 17

Compression:

Stored size: 733 Bytes

Contents

# frozen_string_literal: true

require "rails_helper"
require ::File.expand_path("../../../lib/cornucopia/util/report_table", File.dirname(__FILE__))

describe Cornucopia::Util::ReportTable::ReportTableException do
  let(:inner_error) { Exception.new("This is an error") }
  let(:subject) { Cornucopia::Util::ReportTable::ReportTableException.new(inner_error) }

  it "returns the #error" do
    expect(subject.error.to_s).to be == "This is an error"
  end

  it "passes the backtrace to the inner error" do
    expect(inner_error).to receive(:backtrace).and_call_original
    subject.backtrace
  end

  it "passes the to_s to the inner error" do
    expect(inner_error).to receive(:to_s).and_call_original
    subject.to_s
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
cornucopia-0.2.0 spec/lib/util/report_table_exception_spec.rb
cornucopia-0.1.56 spec/lib/util/report_table_exception_spec.rb
cornucopia-0.1.55 spec/lib/util/report_table_exception_spec.rb
cornucopia-0.1.54 spec/lib/util/report_table_exception_spec.rb
cornucopia-0.1.53 spec/lib/util/report_table_exception_spec.rb
cornucopia-0.1.52 spec/lib/util/report_table_exception_spec.rb
cornucopia-0.1.51 spec/lib/util/report_table_exception_spec.rb
cornucopia-0.1.50 spec/lib/util/report_table_exception_spec.rb
cornucopia-0.1.49 spec/lib/util/report_table_exception_spec.rb
cornucopia-0.1.48 spec/lib/util/report_table_exception_spec.rb
cornucopia-0.1.47 spec/lib/util/report_table_exception_spec.rb
cornucopia-0.1.46 spec/lib/util/report_table_exception_spec.rb
cornucopia-0.1.45 spec/lib/util/report_table_exception_spec.rb
cornucopia-0.1.44 spec/lib/util/report_table_exception_spec.rb
cornucopia-0.1.43 spec/lib/util/report_table_exception_spec.rb
cornucopia-0.1.42 spec/lib/util/report_table_exception_spec.rb
cornucopia-0.1.41 spec/lib/util/report_table_exception_spec.rb