Sha256: 84ac175ea84316cd988462e62f61baa4306e91cfe6f5a809ae1c92f14f32f00e

Contents?: true

Size: 1.19 KB

Versions: 3

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper'
module Exlibris
  module Aleph
    module Table
      module Reader
        module Matcher
          describe Collections do
            let(:string) { 'MAIN  BOBST L Main Collection' }
            subject(:collections) { Collections.new(string) }
            describe Collections::REGEXP do
              subject { Collections::REGEXP }
              it { should eq /^(.{5})\s(.{5})\s(L)\s(.+)/ }
            end
            describe '#regexp' do
              subject { collections.regexp }
              it { should be_a Regexp }
              it { should eq /^(.{5})\s(.{5})\s(L)\s(.+)/ }
            end
            describe '#match_data' do
              subject { collections.match_data }
              it { should be_a MatchData }
            end
            describe '#matches?' do
              subject { collections.matches? }
              it { should be_true }
            end
            describe '#matched_data' do
              subject { collections.matched_data }
              it { should be_an Array }
              it 'should have 4 matches' do
                expect(subject.size).to eq 4
              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/collections_spec.rb
exlibris-aleph-2.0.3 spec/exlibris/aleph/table/reader/matcher/collections_spec.rb
exlibris-aleph-2.0.0 spec/exlibris/aleph/table/reader/matcher/collections_spec.rb