Sha256: 415ac5ac4d7c9e3f5fec4c55ba54991d65853a8af11cc6cae11bef31f66a0e20

Contents?: true

Size: 613 Bytes

Versions: 6

Compression:

Stored size: 613 Bytes

Contents

module Matchers
  module Type
    def have_account_number( attribute, valid_hash = {} )
      HaveAccountNumberMatcher.new( attribute, valid_hash )
    end

    class HaveAccountNumberMatcher < TypeMatcher
      def initialize( attribute, valid_hash )
        super( attribute, valid_hash, 'account number', 1000, -1 )
        @expected_error = "Exception missing for invalid value #{ @invalid_value.inspect }".freeze
      end

      private

        def expected_type?
          @actual_type = @klass.schema[@attribute]
          @actual_type == Fortnox::API::Types::AccountNumber
        end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fortnox-api-0.5.2 spec/support/matchers/type/have_account_number_matcher.rb
fortnox-api-0.5.1 spec/support/matchers/type/have_account_number_matcher.rb
fortnox-api-0.5.0 spec/support/matchers/type/have_account_number_matcher.rb
fortnox-api-0.4.0 spec/support/matchers/type/have_account_number_matcher.rb
fortnox-api-0.3.0 spec/support/matchers/type/have_account_number_matcher.rb
fortnox-api-0.2.0 spec/support/matchers/type/have_account_number_matcher.rb