Sha256: 969a37fe31987f21a0fdcef9b1ca273b08481ca287336fe950ff9f5d48a14bab

Contents?: true

Size: 637 Bytes

Versions: 20

Compression:

Stored size: 637 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
      object.find_by_scheme('ISIN').should == 'US0123456789'
    end

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

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
pupa-0.1.11 spec/models/identifier_list_spec.rb
pupa-0.1.10 spec/models/identifier_list_spec.rb
pupa-0.1.9 spec/models/identifier_list_spec.rb
pupa-0.1.8 spec/models/identifier_list_spec.rb
pupa-0.1.7 spec/models/identifier_list_spec.rb
pupa-0.1.6 spec/models/identifier_list_spec.rb
pupa-0.1.5 spec/models/identifier_list_spec.rb
pupa-0.1.4 spec/models/identifier_list_spec.rb
pupa-0.1.3 spec/models/identifier_list_spec.rb
pupa-0.1.2 spec/models/identifier_list_spec.rb
pupa-0.1.1 spec/models/identifier_list_spec.rb
pupa-0.1.0 spec/models/identifier_list_spec.rb
pupa-0.0.13 spec/models/identifier_list_spec.rb
pupa-0.0.12 spec/models/identifier_list_spec.rb
pupa-0.0.11 spec/models/identifier_list_spec.rb
pupa-0.0.10 spec/models/identifier_list_spec.rb
pupa-0.0.9 spec/models/identifier_list_spec.rb
pupa-0.0.8 spec/models/identifier_list_spec.rb
pupa-0.0.7 spec/models/identifier_list_spec.rb
pupa-0.0.6 spec/models/identifier_list_spec.rb