Sha256: 883ab5941451addf89fe0f436dd807c039644aba751bdb3b947fca424ffecbd9

Contents?: true

Size: 647 Bytes

Versions: 5

Compression:

Stored size: 647 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe Pupa::IdentifierList do
  let :object do
    Pupa::IdentifierList.new([
      {
        identifier: '123456789',
        scheme: 'DUNS',
      },
      {
        identifier: 'US0123456789',
        scheme: 'ISIN',
      },
    ])
  end

  describe '#find_by_scheme' do
    it 'should return the first identifier matching the scheme' do
      expect(object.find_by_scheme('ISIN')).to eq('US0123456789')
    end

    it 'should return nil if no identifier matches the scheme' do
      expect(Pupa::IdentifierList.new.find_by_scheme('ISIN')).to eq(nil)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
pupa-0.2.4 spec/models/identifier_list_spec.rb
pupa-0.2.3 spec/models/identifier_list_spec.rb
pupa-0.2.2 spec/models/identifier_list_spec.rb
pupa-0.2.1 spec/models/identifier_list_spec.rb
pupa-0.2.0 spec/models/identifier_list_spec.rb