Sha256: f14f43b999c5f2f7dc8f8f74093cdac3b67653c26b9659a83b9d0557244e0f02

Contents?: true

Size: 1.43 KB

Versions: 5

Compression:

Stored size: 1.43 KB

Contents

require 'spec_helper'

describe Restfulie::Common::Error do
  describe Restfulie::Common::Error::RestfulieError do
    it "RestfulieError should have StandardError as ancestors class" do
      msg = "Restfulie Error test"
      Restfulie::Common::Error::RestfulieError.ancestors.should be_include StandardError
      lambda {
        raise Restfulie::Common::Error::RestfulieError.new(msg)
      }.should raise_error(Restfulie::Common::Error::RestfulieError, msg)
    end
  end

  describe Restfulie::Common::Error::MarshallingError do
    it "MarshallingError should have RestfulieError as ancestors class" do
      msg = "Restfulie Marshalling Error test"
      Restfulie::Common::Error::MarshallingError.ancestors.should be_include Restfulie::Common::Error::RestfulieError
      lambda {
        raise Restfulie::Common::Error::MarshallingError.new(msg)
      }.should raise_error(Restfulie::Common::Error::MarshallingError, msg)
    end
  end

  describe Restfulie::Common::Error::UndefinedMarshallingError do
    it "UndefinedMarshallingError should have MarshallingError as ancestors class" do
      msg = "Restfulie Marshalling Error test"
      Restfulie::Common::Error::UndefinedMarshallingError.ancestors.should be_include Restfulie::Common::Error::MarshallingError
      lambda {
        raise Restfulie::Common::Error::UndefinedMarshallingError.new(msg)
      }.should raise_error(Restfulie::Common::Error::UndefinedMarshallingError, msg)
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
restfulie-nosqlite-1.0.4 spec/unit/common/errors_spec.rb
restfulie-1.1.1 spec/unit/common/errors_spec.rb
restfulie-1.1.0 spec/unit/common/errors_spec.rb
restfulie-nosqlite-1.0.3 spec/unit/common/errors_spec.rb
restfulie-1.0.3 spec/unit/common/errors_spec.rb