Sha256: 993ed0651f650f05ab8cefb52ca7ded87d5115d635ca6abdcd4b132bbe1877a0

Contents?: true

Size: 943 Bytes

Versions: 9

Compression:

Stored size: 943 Bytes

Contents

# coding: UTF-8
require 'spec_helper'

describe Rescue do

  describe "define_error_class :RescueStandardError" do
    let(:name) { :RescueStandardError }
    before     { Rescue::Bind.define_error_class name }

    it "expects to define an exception class" do
      expect(Object.const_defined? name).to be_true
    end

    it "expects to define an exception class that is a kind of StandardError" do
      expect(Object.const_get(name).new).to be_a_kind_of StandardError
    end
  end

  describe "define_error_class :RescueScriptError, ScriptError" do
    let(:name) { :RescueScriptError }
    before     { Rescue::Bind.define_error_class name, ScriptError }

    it "expects to define an exception class" do
      expect(Object.const_defined? name).to be_true
    end

    it "expects to define an exception class that is a kind of StandardError" do
      expect(Object.const_get(name).new).to be_a_kind_of ScriptError
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rescue-dog-0.3.8 spec/rescue_spec.rb
rescue-dog-0.3.7 spec/rescue_spec.rb
rescue-dog-0.3.5 spec/rescue_spec.rb
rescue-dog-0.3.4 spec/rescue_spec.rb
rescue-dog-0.3.2 spec/rescue_spec.rb
rescue-dog-0.3.1 spec/rescue_spec.rb
rescue-dog-0.3.0 spec/rescue_spec.rb
rescue-dog-0.2.1 spec/rescue_spec.rb
rescue-dog-0.2.0 spec/rescue_spec.rb