Sha256: 8d7ff038f1f4392fbe2d58a89b80d721316bc461af0cac9c070f239511316f7d

Contents?: true

Size: 1.49 KB

Versions: 3

Compression:

Stored size: 1.49 KB

Contents

require 'spec_helper'
module Exlibris
  module Aleph
    module Table
      module Reader
        module Matcher
          describe ItemCirculationPolicies do
            let(:string) { 'BOBST ## DP L Depository                     Y Y C N Y Y N Y N 00 N A' }
            subject(:items) { ItemCirculationPolicies.new(string) }
            describe ItemCirculationPolicies::REGEXP do
              subject { ItemCirculationPolicies::REGEXP }
              it { should eq /^(.{5})\s([0-9#]{2})\s([A-Z#]{2})\s(L)\s(.{30})\s([YN])\s([YN])\s([YNCT])\s([YN])\s([YN])\s([YN])\s([YN])\s([YN])\s([YN])\s([0-9]{2})\s([YNC])\s([AOC])/ }
            end
            describe '#regexp' do
              subject { items.regexp }
              it { should be_a Regexp }
              it { should eq /^(.{5})\s([0-9#]{2})\s([A-Z#]{2})\s(L)\s(.{30})\s([YN])\s([YN])\s([YNCT])\s([YN])\s([YN])\s([YN])\s([YN])\s([YN])\s([YN])\s([0-9]{2})\s([YNC])\s([AOC])/ }
            end
            describe '#match_data' do
              subject { items.match_data }
              it { should be_a MatchData }
            end
            describe '#matches?' do
              subject { items.matches? }
              it { should be_true }
            end
            describe '#matched_data' do
              subject { items.matched_data }
              it { should be_an Array }
              it 'should have 17 matches' do
                expect(subject.size).to eq 17
              end
            end
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
exlibris-aleph-2.0.4 spec/exlibris/aleph/table/reader/matcher/item_circulation_policies_spec.rb
exlibris-aleph-2.0.3 spec/exlibris/aleph/table/reader/matcher/item_circulation_policies_spec.rb
exlibris-aleph-2.0.0 spec/exlibris/aleph/table/reader/matcher/item_circulation_policies_spec.rb