Sha256: f174613647f3ed516198a3a266ae2dfae9947b4305199bc437565d99d5296a66

Contents?: true

Size: 786 Bytes

Versions: 2

Compression:

Stored size: 786 Bytes

Contents

require 'spec_helper'

module PostcodeAnywhere::EmailValidation
  describe ValidationError do
    subject { described_class.new('An error') }

    it { should be_kind_of(StandardError) }

    it { should respond_to :message }
    it { should respond_to :code }
    it { should respond_to :cause }
    it { should respond_to :resolution }

    its(:to_s) { should eql('An error') }

    context 'with metadata' do
      subject do
        described_class.new('An error',
                            code:       '0',
                            cause:      'A cause',
                            resolution: 'A resolution')
      end

      its(:code) { should eql('0') }
      its(:cause) { should eql('A cause') }
      its(:resolution) { should eql('A resolution') }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
postcode_anywhere-email_validation-0.0.4 spec/lib/postcode_anywhere/email_validation/validation_error_spec.rb
postcode_anywhere-email_validation-0.0.2 spec/lib/postcode_anywhere/email_validation/validation_error_spec.rb