exlibris-aleph 1.1.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.md +199 -82
- data/Rakefile +8 -14
- data/lib/exlibris-aleph.rb +0 -3
- data/lib/exlibris/aleph/admin_library.rb +27 -0
- data/lib/exlibris/aleph/api/base.rb +27 -0
- data/lib/exlibris/aleph/api/client/base.rb +86 -0
- data/lib/exlibris/aleph/api/client/patron.rb +20 -0
- data/lib/exlibris/aleph/api/client/patron/address.rb +22 -0
- data/lib/exlibris/aleph/api/client/patron/record.rb +23 -0
- data/lib/exlibris/aleph/api/client/patron/record/item.rb +26 -0
- data/lib/exlibris/aleph/api/client/patron/record/item/create_hold.rb +31 -0
- data/lib/exlibris/aleph/api/client/patron/record/item/create_hold/parameters.rb +55 -0
- data/lib/exlibris/aleph/api/client/patron/record/item/hold.rb +29 -0
- data/lib/exlibris/aleph/api/client/patron/status.rb +22 -0
- data/lib/exlibris/aleph/api/client/record.rb +21 -0
- data/lib/exlibris/aleph/api/client/record/filters.rb +23 -0
- data/lib/exlibris/aleph/api/client/record/holding.rb +23 -0
- data/lib/exlibris/aleph/api/client/record/holdings.rb +23 -0
- data/lib/exlibris/aleph/api/client/record/item.rb +23 -0
- data/lib/exlibris/aleph/api/client/record/items.rb +23 -0
- data/lib/exlibris/aleph/api/reader/base.rb +15 -0
- data/lib/exlibris/aleph/api/reader/patron.rb +19 -0
- data/lib/exlibris/aleph/api/reader/patron/address.rb +90 -0
- data/lib/exlibris/aleph/api/reader/patron/record.rb +38 -0
- data/lib/exlibris/aleph/api/reader/patron/record/item.rb +77 -0
- data/lib/exlibris/aleph/api/reader/patron/record/item/create_hold.rb +33 -0
- data/lib/exlibris/aleph/api/reader/patron/record/item/hold.rb +56 -0
- data/lib/exlibris/aleph/api/reader/patron/status.rb +33 -0
- data/lib/exlibris/aleph/api/reader/record.rb +10 -0
- data/lib/exlibris/aleph/api/reader/record/item.rb +45 -0
- data/lib/exlibris/aleph/collection.rb +26 -0
- data/lib/exlibris/aleph/config.rb +17 -57
- data/lib/exlibris/aleph/holding.rb +59 -0
- data/lib/exlibris/aleph/holding/metadata.rb +28 -0
- data/lib/exlibris/aleph/holdings.rb +51 -0
- data/lib/exlibris/aleph/item.rb +138 -0
- data/lib/exlibris/aleph/item/call_number.rb +14 -0
- data/lib/exlibris/aleph/item/circulation_policy.rb +30 -0
- data/lib/exlibris/aleph/item/circulation_policy/display.rb +16 -0
- data/lib/exlibris/aleph/item/circulation_policy/identifier.rb +34 -0
- data/lib/exlibris/aleph/item/circulation_policy/privileges.rb +72 -0
- data/lib/exlibris/aleph/item/circulation_status.rb +31 -0
- data/lib/exlibris/aleph/item/display_mask.rb +19 -0
- data/lib/exlibris/aleph/item/opac_note.rb +17 -0
- data/lib/exlibris/aleph/item/processing_status.rb +23 -0
- data/lib/exlibris/aleph/item/queue.rb +32 -0
- data/lib/exlibris/aleph/item/status.rb +23 -0
- data/lib/exlibris/aleph/items.rb +51 -0
- data/lib/exlibris/aleph/metadata.rb +25 -0
- data/lib/exlibris/aleph/patron.rb +18 -82
- data/lib/exlibris/aleph/patron/address.rb +56 -0
- data/lib/exlibris/aleph/patron/circulation_policy.rb +26 -0
- data/lib/exlibris/aleph/patron/circulation_policy/identifier.rb +29 -0
- data/lib/exlibris/aleph/patron/circulation_policy/privileges.rb +56 -0
- data/lib/exlibris/aleph/patron/record.rb +39 -0
- data/lib/exlibris/aleph/patron/record/circulation_policy.rb +18 -0
- data/lib/exlibris/aleph/patron/record/circulation_policy/privileges.rb +42 -0
- data/lib/exlibris/aleph/patron/record/item.rb +63 -0
- data/lib/exlibris/aleph/patron/record/item/circulation_policy.rb +21 -0
- data/lib/exlibris/aleph/patron/record/item/circulation_policy/privileges.rb +39 -0
- data/lib/exlibris/aleph/patron/record/item/create_hold.rb +43 -0
- data/lib/exlibris/aleph/patron/record/item/hold.rb +41 -0
- data/lib/exlibris/aleph/patron/status.rb +19 -0
- data/lib/exlibris/aleph/pickup_location.rb +12 -0
- data/lib/exlibris/aleph/record.rb +14 -43
- data/lib/exlibris/aleph/record/metadata.rb +8 -0
- data/lib/exlibris/aleph/sub_library.rb +30 -0
- data/lib/exlibris/aleph/table/base.rb +22 -0
- data/lib/exlibris/aleph/table/collections.rb +17 -0
- data/lib/exlibris/aleph/table/item/circulation_policies.rb +65 -0
- data/lib/exlibris/aleph/table/item/display_masks.rb +19 -0
- data/lib/exlibris/aleph/table/patron/circulation_policies.rb +47 -0
- data/lib/exlibris/aleph/table/patron/statuses.rb +19 -0
- data/lib/exlibris/aleph/table/reader/base.rb +57 -0
- data/lib/exlibris/aleph/table/reader/collections.rb +35 -0
- data/lib/exlibris/aleph/table/reader/item_circulation_policies.rb +50 -0
- data/lib/exlibris/aleph/table/reader/item_display_masks.rb +19 -0
- data/lib/exlibris/aleph/table/reader/matcher/base.rb +30 -0
- data/lib/exlibris/aleph/table/reader/matcher/collections.rb +17 -0
- data/lib/exlibris/aleph/table/reader/matcher/item_circulation_policies.rb +17 -0
- data/lib/exlibris/aleph/table/reader/matcher/item_display_masks.rb +17 -0
- data/lib/exlibris/aleph/table/reader/matcher/patron_circulation_policies.rb +17 -0
- data/lib/exlibris/aleph/table/reader/matcher/patron_statuses.rb +17 -0
- data/lib/exlibris/aleph/table/reader/matcher/sub_libraries.rb +17 -0
- data/lib/exlibris/aleph/table/reader/patron_circulation_policies.rb +51 -0
- data/lib/exlibris/aleph/table/reader/patron_statuses.rb +19 -0
- data/lib/exlibris/aleph/table/reader/row/base.rb +25 -0
- data/lib/exlibris/aleph/table/reader/row/collections.rb +13 -0
- data/lib/exlibris/aleph/table/reader/row/item_circulation_policies.rb +17 -0
- data/lib/exlibris/aleph/table/reader/row/item_display_masks.rb +13 -0
- data/lib/exlibris/aleph/table/reader/row/patron_circulation_policies.rb +20 -0
- data/lib/exlibris/aleph/table/reader/row/patron_statuses.rb +13 -0
- data/lib/exlibris/aleph/table/reader/row/sub_libraries.rb +13 -0
- data/lib/exlibris/aleph/table/reader/sub_libraries.rb +32 -0
- data/lib/exlibris/aleph/table/sub_libraries.rb +11 -0
- data/lib/exlibris/aleph/tables_manager.rb +66 -0
- data/lib/exlibris/aleph/version.rb +1 -1
- data/spec/exlibris/aleph/admin_library_spec.rb +83 -0
- data/spec/exlibris/aleph/api/base_spec.rb +23 -0
- data/spec/exlibris/aleph/api/client/base_spec.rb +40 -0
- data/spec/exlibris/aleph/api/client/patron/address_spec.rb +40 -0
- data/spec/exlibris/aleph/api/client/patron/record/item/create_hold/parameters_spec.rb +101 -0
- data/spec/exlibris/aleph/api/client/patron/record/item/create_hold_spec.rb +102 -0
- data/spec/exlibris/aleph/api/client/patron/record/item/hold_spec.rb +89 -0
- data/spec/exlibris/aleph/api/client/patron/record/item_spec.rb +52 -0
- data/spec/exlibris/aleph/api/client/patron/record_spec.rb +45 -0
- data/spec/exlibris/aleph/api/client/patron/status_spec.rb +40 -0
- data/spec/exlibris/aleph/api/client/patron_spec.rb +38 -0
- data/spec/exlibris/aleph/api/client/record/filters_spec.rb +46 -0
- data/spec/exlibris/aleph/api/client/record/holding_spec.rb +41 -0
- data/spec/exlibris/aleph/api/client/record/holdings_spec.rb +46 -0
- data/spec/exlibris/aleph/api/client/record/item_spec.rb +41 -0
- data/spec/exlibris/aleph/api/client/record/items_spec.rb +46 -0
- data/spec/exlibris/aleph/api/client/record_spec.rb +43 -0
- data/spec/exlibris/aleph/api/reader/base_spec.rb +18 -0
- data/spec/exlibris/aleph/api/reader/patron/address_spec.rb +151 -0
- data/spec/exlibris/aleph/api/reader/patron/record/item/create_hold_spec.rb +65 -0
- data/spec/exlibris/aleph/api/reader/patron/record/item/hold_spec.rb +145 -0
- data/spec/exlibris/aleph/api/reader/patron/record/item_spec.rb +266 -0
- data/spec/exlibris/aleph/api/reader/patron/record_spec.rb +98 -0
- data/spec/exlibris/aleph/api/reader/patron/status_spec.rb +57 -0
- data/spec/exlibris/aleph/api/reader/patron_spec.rb +28 -0
- data/spec/exlibris/aleph/api/reader/record/item_spec.rb +178 -0
- data/spec/exlibris/aleph/collection_spec.rb +95 -0
- data/spec/exlibris/aleph/config_spec.rb +17 -0
- data/spec/exlibris/aleph/holding/metadata_spec.rb +57 -0
- data/spec/exlibris/aleph/holding_spec.rb +53 -0
- data/spec/exlibris/aleph/holdings_spec.rb +59 -0
- data/spec/exlibris/aleph/item/call_number_spec.rb +20 -0
- data/spec/exlibris/aleph/item/circulation_policy/display_spec.rb +33 -0
- data/spec/exlibris/aleph/item/circulation_policy/identifier_spec.rb +154 -0
- data/spec/exlibris/aleph/item/circulation_policy/privileges_spec.rb +183 -0
- data/spec/exlibris/aleph/item/circulation_policy_spec.rb +146 -0
- data/spec/exlibris/aleph/item/circulation_status_spec.rb +83 -0
- data/spec/exlibris/aleph/item/display_mask_spec.rb +72 -0
- data/spec/exlibris/aleph/item/opac_note_spec.rb +19 -0
- data/spec/exlibris/aleph/item/processing_status_spec.rb +75 -0
- data/spec/exlibris/aleph/item/queue_spec.rb +31 -0
- data/spec/exlibris/aleph/item/status_spec.rb +80 -0
- data/spec/exlibris/aleph/item_spec.rb +97 -0
- data/spec/exlibris/aleph/items_spec.rb +59 -0
- data/spec/exlibris/aleph/metadata_spec.rb +118 -0
- data/spec/exlibris/aleph/patron/address_spec.rb +68 -0
- data/spec/exlibris/aleph/patron/circulation_policy/identifier_spec.rb +115 -0
- data/spec/exlibris/aleph/patron/circulation_policy/privileges_spec.rb +128 -0
- data/spec/exlibris/aleph/patron/circulation_policy_spec.rb +119 -0
- data/spec/exlibris/aleph/patron/record/circulation_policy/privileges_spec.rb +88 -0
- data/spec/exlibris/aleph/patron/record/circulation_policy_spec.rb +37 -0
- data/spec/exlibris/aleph/patron/record/item/circulation_policy/privileges_spec.rb +76 -0
- data/spec/exlibris/aleph/patron/record/item/circulation_policy_spec.rb +52 -0
- data/spec/exlibris/aleph/patron/record/item/create_hold_spec.rb +49 -0
- data/spec/exlibris/aleph/patron/record/item/hold_spec.rb +41 -0
- data/spec/exlibris/aleph/patron/record/item_spec.rb +64 -0
- data/spec/exlibris/aleph/patron/record_spec.rb +30 -0
- data/spec/exlibris/aleph/patron/status_spec.rb +72 -0
- data/spec/exlibris/aleph/patron_spec.rb +28 -0
- data/spec/exlibris/aleph/pickup_location_spec.rb +19 -0
- data/spec/exlibris/aleph/record/metadata_spec.rb +120 -0
- data/spec/exlibris/aleph/record_spec.rb +44 -0
- data/spec/exlibris/aleph/sub_library_spec.rb +110 -0
- data/spec/exlibris/aleph/table/base_spec.rb +17 -0
- data/spec/exlibris/aleph/table/collections_spec.rb +24 -0
- data/spec/exlibris/aleph/table/item/circulation_policies_spec.rb +65 -0
- data/spec/exlibris/aleph/table/item/display_masks_spec.rb +26 -0
- data/spec/exlibris/aleph/table/patron/circulation_policies_spec.rb +47 -0
- data/spec/exlibris/aleph/table/patron/statuses_spec.rb +26 -0
- data/spec/exlibris/aleph/table/reader/base_spec.rb +28 -0
- data/spec/exlibris/aleph/table/reader/collections_spec.rb +33 -0
- data/spec/exlibris/aleph/table/reader/item_circulation_policies_spec.rb +33 -0
- data/spec/exlibris/aleph/table/reader/item_display_masks_spec.rb +27 -0
- data/spec/exlibris/aleph/table/reader/matcher/base_spec.rb +32 -0
- data/spec/exlibris/aleph/table/reader/matcher/collections_spec.rb +39 -0
- data/spec/exlibris/aleph/table/reader/matcher/item_circulation_policies_spec.rb +39 -0
- data/spec/exlibris/aleph/table/reader/matcher/item_display_masks_spec.rb +40 -0
- data/spec/exlibris/aleph/table/reader/matcher/patron_circulation_policies_spec.rb +40 -0
- data/spec/exlibris/aleph/table/reader/matcher/patron_statuses_spec.rb +40 -0
- data/spec/exlibris/aleph/table/reader/matcher/sub_libraries_spec.rb +40 -0
- data/spec/exlibris/aleph/table/reader/patron_circulation_policies_spec.rb +27 -0
- data/spec/exlibris/aleph/table/reader/patron_statuses_spec.rb +27 -0
- data/spec/exlibris/aleph/table/reader/row/base_spec.rb +20 -0
- data/spec/exlibris/aleph/table/reader/row/collections_spec.rb +37 -0
- data/spec/exlibris/aleph/table/reader/row/item_circulation_policies_spec.rb +89 -0
- data/spec/exlibris/aleph/table/reader/row/item_display_masks_spec.rb +29 -0
- data/spec/exlibris/aleph/table/reader/row/patron_circulation_policies_spec.rb +115 -0
- data/spec/exlibris/aleph/table/reader/row/patron_statuses_spec.rb +29 -0
- data/spec/exlibris/aleph/table/reader/row/sub_libraries_spec.rb +41 -0
- data/spec/exlibris/aleph/table/reader/sub_libraries_spec.rb +36 -0
- data/spec/exlibris/aleph/table/sub_libraries_spec.rb +19 -0
- data/spec/exlibris/aleph/tables_manager_spec.rb +120 -0
- data/spec/exlibris/aleph_spec.rb +5 -0
- data/spec/spec_helper.rb +27 -0
- data/spec/support/mnt/aleph_tab/adm50/tab/filename +0 -0
- data/{test → spec/support}/mnt/aleph_tab/alephe/tab/tab_sub_library.eng +0 -0
- data/{test → spec/support}/mnt/aleph_tab/nyu50/tab/pc_tab_exp_field_extended.eng +0 -0
- data/{test/mnt/aleph_tab → spec/support/mnt/aleph_tab/nyu50/tab}/tab15.eng +2 -0
- data/{test → spec/support}/mnt/aleph_tab/nyu50/tab/tab16 +0 -0
- data/{test → spec/support}/mnt/aleph_tab/nyu50/tab/tab31 +0 -0
- data/{test → spec/support}/mnt/aleph_tab/nyu50/tab/tab37 +0 -0
- data/{test → spec/support}/mnt/aleph_tab/nyu50/tab/tab40.eng +0 -0
- data/{test → spec/support}/mnt/aleph_tab/nyu50/tab/tab_www_item_desc.eng +0 -0
- data/{test → spec/support}/mnt/aleph_tab/nyu51/tab/pc_tab_exp_field_extended.eng +0 -0
- data/{test → spec/support}/mnt/aleph_tab/nyu51/tab/tab15.eng +0 -0
- data/{test → spec/support}/mnt/aleph_tab/nyu51/tab/tab16 +0 -0
- data/{test → spec/support}/mnt/aleph_tab/nyu51/tab/tab31 +0 -0
- data/{test → spec/support}/mnt/aleph_tab/nyu51/tab/tab37 +0 -0
- data/{test → spec/support}/mnt/aleph_tab/nyu51/tab/tab40.eng +0 -0
- data/{test → spec/support}/mnt/aleph_tab/nyu51/tab/tab_www_item_desc.eng +0 -0
- data/spec/vcr_cassettes/patron.yml +1443 -0
- data/spec/vcr_cassettes/record.yml +763 -0
- metadata +351 -165
- data/lib/exlibris/aleph/abstract.rb +0 -28
- data/lib/exlibris/aleph/rest/base.rb +0 -56
- data/lib/exlibris/aleph/tab_helper.rb +0 -303
- data/lib/exlibris/aleph/tabs_parser/base.rb +0 -49
- data/lib/exlibris/aleph/tabs_parser/pc_tab_exp_field_extended.rb +0 -20
- data/lib/exlibris/aleph/tabs_parser/sub_library.rb +0 -32
- data/lib/exlibris/aleph/tabs_parser/tab15_by_item_process_status.rb +0 -33
- data/lib/exlibris/aleph/tabs_parser/tab15_by_item_status.rb +0 -33
- data/lib/exlibris/aleph/tabs_parser/tab31.rb +0 -39
- data/lib/exlibris/aleph/tabs_parser/tab37.rb +0 -63
- data/lib/exlibris/aleph/tabs_parser/tab40.rb +0 -20
- data/lib/exlibris/aleph/tabs_parser/tab_sub_library.rb +0 -21
- data/lib/exlibris/aleph/tabs_parser/tab_www_item_desc.rb +0 -20
- data/lib/exlibris/aleph/task_installer.rb +0 -25
- data/lib/exlibris/aleph/write_attributes.rb +0 -38
- data/lib/exlibris/aleph/xml_util.rb +0 -50
- data/lib/exlibris/aleph/xservice/bor_auth.rb +0 -47
- data/lib/tasks/exlibris-aleph_tasks.rake +0 -48
- data/test/config/aleph/alephe/sub_libraries.yml +0 -801
- data/test/config/aleph/nyu50/collections.yml +0 -1168
- data/test/config/aleph/nyu50/item_permissions_by_item_process_status.yml +0 -61876
- data/test/config/aleph/nyu50/item_permissions_by_item_status.yml +0 -17319
- data/test/config/aleph/nyu50/items.yml +0 -617
- data/test/config/aleph/nyu50/patron_permissions.yml +0 -19720
- data/test/config/aleph/nyu50/patrons.yml +0 -249
- data/test/config/aleph/nyu50/pickup_locations.yml +0 -2910
- data/test/config/aleph/nyu51/collections.yml +0 -41
- data/test/config/aleph/nyu51/item_permissions_by_item_process_status.yml +0 -7689
- data/test/config/aleph/nyu51/item_permissions_by_item_status.yml +0 -430
- data/test/config/aleph/nyu51/items.yml +0 -617
- data/test/config/aleph/nyu51/patron_permissions.yml +0 -6588
- data/test/config/aleph/nyu51/patrons.yml +0 -237
- data/test/config/aleph/nyu51/pickup_locations.yml +0 -456
- data/test/config_test.rb +0 -24
- data/test/exlibris-aleph_test.rb +0 -7
- data/test/mnt/aleph_tab/nyu50/tab/tab15.eng +0 -4742
- data/test/mnt/aleph_tab/pc_tab_exp_field_extended.eng +0 -158
- data/test/mnt/aleph_tab/tab16 +0 -3792
- data/test/mnt/aleph_tab/tab31 +0 -998
- data/test/mnt/aleph_tab/tab37 +0 -405
- data/test/mnt/aleph_tab/tab40.eng +0 -335
- data/test/mnt/aleph_tab/tab_sub_library.eng +0 -378
- data/test/mnt/aleph_tab/tab_www_item_desc.eng +0 -208
- data/test/patron_test.rb +0 -98
- data/test/record_benchmarks.rb +0 -26
- data/test/record_test.rb +0 -64
- data/test/support/config.yml +0 -2
- data/test/tab_helper_benchmarks.rb +0 -53
- data/test/tab_helper_test.rb +0 -192
- data/test/test_helper.rb +0 -46
- data/test/vcr_cassettes/bor_auth.yml +0 -42
- data/test/vcr_cassettes/patron.yml +0 -142
- data/test/vcr_cassettes/patron_address.yml +0 -45
- data/test/vcr_cassettes/patron_bogus_url.yml +0 -731
- data/test/vcr_cassettes/patron_error.yml +0 -93
- data/test/vcr_cassettes/record.yml +0 -146
- data/test/vcr_cassettes/record_bogus_url.yml +0 -690
- data/test/xservice/bor_auth_test.rb +0 -28
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
module Exlibris
|
|
3
|
+
module Aleph
|
|
4
|
+
describe Record, vcr: {cassette_name: 'record', record: :new_episodes} do
|
|
5
|
+
let(:id) { 'NYU01000864162' }
|
|
6
|
+
subject(:record) { Record.new(id) }
|
|
7
|
+
describe '#id' do
|
|
8
|
+
subject { record.id }
|
|
9
|
+
it { should eq id }
|
|
10
|
+
end
|
|
11
|
+
describe '#metadata' do
|
|
12
|
+
subject { record.metadata }
|
|
13
|
+
it { should be_a Record::Metadata }
|
|
14
|
+
end
|
|
15
|
+
describe '#items' do
|
|
16
|
+
subject { record.items }
|
|
17
|
+
it { should be_an Array }
|
|
18
|
+
it { should_not be_empty }
|
|
19
|
+
end
|
|
20
|
+
describe '#holdings' do
|
|
21
|
+
subject { record.holdings }
|
|
22
|
+
it { should be_an Array }
|
|
23
|
+
it { should_not be_empty }
|
|
24
|
+
end
|
|
25
|
+
context 'when the record does not exist' do
|
|
26
|
+
let(:id) { 'NYU01000000000' }
|
|
27
|
+
describe '#metadata' do
|
|
28
|
+
subject { record.metadata }
|
|
29
|
+
it { should be_nil }
|
|
30
|
+
end
|
|
31
|
+
describe '#items' do
|
|
32
|
+
subject { record.items }
|
|
33
|
+
it { should be_an Array }
|
|
34
|
+
it { should be_empty }
|
|
35
|
+
end
|
|
36
|
+
describe '#holdings' do
|
|
37
|
+
subject { record.holdings }
|
|
38
|
+
it { should be_an Array }
|
|
39
|
+
it { should be_empty }
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
module Exlibris
|
|
3
|
+
module Aleph
|
|
4
|
+
describe SubLibrary do
|
|
5
|
+
let(:code) { 'SUB' }
|
|
6
|
+
let(:display) { 'Sub Library' }
|
|
7
|
+
let(:admin_library) { AdminLibrary.new('ADM50') }
|
|
8
|
+
subject(:sub_library) { SubLibrary.new(code, display, admin_library) }
|
|
9
|
+
it { should be_a SubLibrary }
|
|
10
|
+
describe '#code' do
|
|
11
|
+
subject { sub_library.code }
|
|
12
|
+
it { should eq code }
|
|
13
|
+
end
|
|
14
|
+
describe '#display' do
|
|
15
|
+
subject { sub_library.display }
|
|
16
|
+
it { should eq display }
|
|
17
|
+
end
|
|
18
|
+
describe '#admin_library' do
|
|
19
|
+
subject { sub_library.admin_library }
|
|
20
|
+
it { should be_an AdminLibrary }
|
|
21
|
+
it { should eq admin_library }
|
|
22
|
+
end
|
|
23
|
+
describe '#to_s' do
|
|
24
|
+
subject { sub_library.to_s }
|
|
25
|
+
it { should eq display }
|
|
26
|
+
end
|
|
27
|
+
describe '#==' do
|
|
28
|
+
subject { sub_library == other_object }
|
|
29
|
+
context 'when the other object is an Exlibris::Aleph::SubLibrary' do
|
|
30
|
+
context 'and the code is the same' do
|
|
31
|
+
let(:other_object) { SubLibrary.new(code, display, admin_library) }
|
|
32
|
+
it { should be_true }
|
|
33
|
+
end
|
|
34
|
+
context 'but the code is different' do
|
|
35
|
+
let(:other_object) { SubLibrary.new('SUB1', display, admin_library) }
|
|
36
|
+
it { should be_false }
|
|
37
|
+
end
|
|
38
|
+
context 'and the code is the same' do
|
|
39
|
+
context 'but the admin library is different' do
|
|
40
|
+
let(:other_object) { SubLibrary.new(code, display, AdminLibrary.new('ADM51')) }
|
|
41
|
+
it { should be_false }
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
context 'when the other object is not an Exlibris::Aleph::SubLibrary' do
|
|
46
|
+
let(:other_object) { "string" }
|
|
47
|
+
it { should be_false }
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
describe '#===' do
|
|
51
|
+
subject { sub_library === other_object }
|
|
52
|
+
context 'when the other object is an Exlibris::Aleph::SubLibrary' do
|
|
53
|
+
context 'and the code is the same' do
|
|
54
|
+
let(:other_object) { SubLibrary.new(code, display, admin_library) }
|
|
55
|
+
it { should be_true }
|
|
56
|
+
end
|
|
57
|
+
context 'but the code is different' do
|
|
58
|
+
let(:other_object) { SubLibrary.new('SUB1', display, admin_library) }
|
|
59
|
+
it { should be_false }
|
|
60
|
+
end
|
|
61
|
+
context 'and the code is the same' do
|
|
62
|
+
context 'but the admin library is different' do
|
|
63
|
+
let(:other_object) { SubLibrary.new(code, display, AdminLibrary.new('ADM51')) }
|
|
64
|
+
it { should be_false }
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
context 'when the other object is not an Exlibris::Aleph::SubLibrary' do
|
|
69
|
+
let(:other_object) { "string" }
|
|
70
|
+
it { should be_false }
|
|
71
|
+
end
|
|
72
|
+
end
|
|
73
|
+
describe '#eql?' do
|
|
74
|
+
subject { sub_library.eql?(other_object) }
|
|
75
|
+
context 'when the other object is an Exlibris::Aleph::SubLibrary' do
|
|
76
|
+
context 'and the code is the same' do
|
|
77
|
+
let(:other_object) { SubLibrary.new(code, display, admin_library) }
|
|
78
|
+
it { should be_true }
|
|
79
|
+
end
|
|
80
|
+
context 'but the code is different' do
|
|
81
|
+
let(:other_object) { SubLibrary.new('SUB1', display, admin_library) }
|
|
82
|
+
it { should be_false }
|
|
83
|
+
end
|
|
84
|
+
context 'and the code is the same' do
|
|
85
|
+
context 'but the admin library is different' do
|
|
86
|
+
let(:other_object) { SubLibrary.new(code, display, AdminLibrary.new('ADM51')) }
|
|
87
|
+
it { should be_false }
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
end
|
|
91
|
+
context 'when the other object is not an Exlibris::Aleph::SubLibrary' do
|
|
92
|
+
let(:other_object) { "string" }
|
|
93
|
+
it { should be_false }
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
describe '#hash' do
|
|
97
|
+
subject { sub_library.hash }
|
|
98
|
+
it { should eq code.hash }
|
|
99
|
+
end
|
|
100
|
+
context 'when initialized with an "admin_library" argument' do
|
|
101
|
+
context 'but the "admin_library" argument is not an AdminLibrary' do
|
|
102
|
+
let(:admin_library) { "invalid" }
|
|
103
|
+
it 'should raise an ArgumentError' do
|
|
104
|
+
expect { subject }.to raise_error ArgumentError
|
|
105
|
+
end
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
|
110
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
module Exlibris
|
|
3
|
+
module Aleph
|
|
4
|
+
module Table
|
|
5
|
+
describe Base do
|
|
6
|
+
subject(:base) { Base.new }
|
|
7
|
+
it { should be_a Base }
|
|
8
|
+
describe '#all' do
|
|
9
|
+
subject { base.all }
|
|
10
|
+
it 'should raise a RuntimeError' do
|
|
11
|
+
expect { subject }.to raise_error RuntimeError
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
module Exlibris
|
|
3
|
+
module Aleph
|
|
4
|
+
module Table
|
|
5
|
+
describe Collections do
|
|
6
|
+
subject(:collections) { Collections.new }
|
|
7
|
+
describe '#all' do
|
|
8
|
+
subject { collections.all }
|
|
9
|
+
it { should be_an Hash }
|
|
10
|
+
it { should_not be_empty }
|
|
11
|
+
end
|
|
12
|
+
describe '#each' do
|
|
13
|
+
subject { collections.each }
|
|
14
|
+
it { should be_an Enumerable }
|
|
15
|
+
end
|
|
16
|
+
describe '#[]' do
|
|
17
|
+
let(:admin_library) { AdminLibrary.new('NYU50') }
|
|
18
|
+
subject { collections[admin_library] }
|
|
19
|
+
it { should be_an Array }
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
module Exlibris
|
|
3
|
+
module Aleph
|
|
4
|
+
module Table
|
|
5
|
+
module Item
|
|
6
|
+
describe CirculationPolicies do
|
|
7
|
+
subject(:item_circulation_policies) { CirculationPolicies.new }
|
|
8
|
+
describe '#all' do
|
|
9
|
+
subject { item_circulation_policies.all }
|
|
10
|
+
it { should be_an Hash }
|
|
11
|
+
it { should_not be_empty }
|
|
12
|
+
end
|
|
13
|
+
describe '#each' do
|
|
14
|
+
subject { item_circulation_policies.each }
|
|
15
|
+
it { should be_an Enumerable }
|
|
16
|
+
end
|
|
17
|
+
describe '#find_by_identifier' do
|
|
18
|
+
subject { item_circulation_policies.find_by_identifier(identifier) }
|
|
19
|
+
context 'when the identifier is not an Item::CirculationPolicies::Identifier' do
|
|
20
|
+
let(:identifier) { 'identifier' }
|
|
21
|
+
it 'should raise an ArgumentError' do
|
|
22
|
+
expect { subject }.to raise_error ArgumentError
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
context 'when the identifier is an Item::CirculationPolicies::Identifier' do
|
|
26
|
+
let(:item_status) { Aleph::Item::Status.new('01') }
|
|
27
|
+
let(:item_processing_status) { Aleph::Item::ProcessingStatus.new('BD') }
|
|
28
|
+
let(:admin_library) { AdminLibrary.new('NYU50') }
|
|
29
|
+
let(:sub_library) { SubLibrary.new('BOBST', 'NYU Bobst', admin_library) }
|
|
30
|
+
let(:identifier) { Aleph::Item::CirculationPolicy::Identifier.new(item_status, item_processing_status, sub_library) }
|
|
31
|
+
context "and the identifier exactly matches a CirculationPolicy's Identifier" do
|
|
32
|
+
it { should_not be_nil }
|
|
33
|
+
it { should be_a Aleph::Item::CirculationPolicy }
|
|
34
|
+
end
|
|
35
|
+
context "but the identifier does not exactly match any CirculationPolicy's Identifier" do
|
|
36
|
+
context 'because the item status does not match' do
|
|
37
|
+
let(:item_processing_status) { Aleph::Item::Status.new('ACK') }
|
|
38
|
+
context 'and the item process status does not match' do
|
|
39
|
+
let(:item_processing_status) { Aleph::Item::ProcessingStatus.new('ACK') }
|
|
40
|
+
it { should_not be_nil }
|
|
41
|
+
it { should be_a Aleph::Item::CirculationPolicy }
|
|
42
|
+
end
|
|
43
|
+
context 'but the item process status does match' do
|
|
44
|
+
context 'and there is a generic row that matches' do
|
|
45
|
+
let(:item_processing_status) { Aleph::Item::ProcessingStatus.new('DP') }
|
|
46
|
+
it { should_not be_nil }
|
|
47
|
+
it { should be_a Aleph::Item::CirculationPolicy }
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
context 'because the item status does match' do
|
|
52
|
+
context 'but the item process status does not match' do
|
|
53
|
+
let(:item_processing_status) { Aleph::Item::ProcessingStatus.new('ACK') }
|
|
54
|
+
it { should_not be_nil }
|
|
55
|
+
it { should be_a Aleph::Item::CirculationPolicy }
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
module Exlibris
|
|
3
|
+
module Aleph
|
|
4
|
+
module Table
|
|
5
|
+
module Item
|
|
6
|
+
describe DisplayMasks do
|
|
7
|
+
subject(:display_masks) { DisplayMasks.new }
|
|
8
|
+
describe '#all' do
|
|
9
|
+
subject { display_masks.all }
|
|
10
|
+
it { should be_an Hash }
|
|
11
|
+
it { should_not be_empty }
|
|
12
|
+
end
|
|
13
|
+
describe '#each' do
|
|
14
|
+
subject { display_masks.each }
|
|
15
|
+
it { should be_an Enumerable }
|
|
16
|
+
end
|
|
17
|
+
describe '#[]' do
|
|
18
|
+
let(:admin_library) { AdminLibrary.new('NYU50') }
|
|
19
|
+
subject { display_masks[admin_library] }
|
|
20
|
+
it { should be_an Array }
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
module Exlibris
|
|
3
|
+
module Aleph
|
|
4
|
+
module Table
|
|
5
|
+
module Patron
|
|
6
|
+
describe CirculationPolicies do
|
|
7
|
+
subject(:circulation_policies) { CirculationPolicies.new }
|
|
8
|
+
describe '#all' do
|
|
9
|
+
subject { circulation_policies.all }
|
|
10
|
+
it { should be_an Hash }
|
|
11
|
+
it { should_not be_empty }
|
|
12
|
+
end
|
|
13
|
+
describe '#each' do
|
|
14
|
+
subject { circulation_policies.each }
|
|
15
|
+
it { should be_an Enumerable }
|
|
16
|
+
end
|
|
17
|
+
describe '#find_by_identifier' do
|
|
18
|
+
subject { circulation_policies.find_by_identifier(identifier) }
|
|
19
|
+
context 'when the identifier is not an Item::CirculationPolicies::Identifier' do
|
|
20
|
+
let(:identifier) { 'identifier' }
|
|
21
|
+
it 'should raise an ArgumentError' do
|
|
22
|
+
expect { subject }.to raise_error ArgumentError
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
context 'when the identifier is an Item::CirculationPolicies::Identifier' do
|
|
26
|
+
let(:patron_status) { Aleph::Patron::Status.new('50', 'NYU Full Time Faculty') }
|
|
27
|
+
let(:admin_library) { AdminLibrary.new('NYU50') }
|
|
28
|
+
let(:sub_library) { SubLibrary.new('BOBST', 'NYU Bobst', admin_library) }
|
|
29
|
+
let(:identifier) { Aleph::Patron::CirculationPolicy::Identifier.new(patron_status, sub_library) }
|
|
30
|
+
context "and the identifier exactly matches a CirculationPolicy's Identifier" do
|
|
31
|
+
it { should_not be_nil }
|
|
32
|
+
it { should be_a Aleph::Patron::CirculationPolicy }
|
|
33
|
+
end
|
|
34
|
+
context "but the identifier does not exactly match any CirculationPolicy's Identifier" do
|
|
35
|
+
context 'because the patron status does not match' do
|
|
36
|
+
let(:patron_status) { Aleph::Patron::Status.new('ACK', 'Ack Attack') }
|
|
37
|
+
it { should_not be_nil }
|
|
38
|
+
it { should be_a Aleph::Patron::CirculationPolicy }
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
module Exlibris
|
|
3
|
+
module Aleph
|
|
4
|
+
module Table
|
|
5
|
+
module Patron
|
|
6
|
+
describe Statuses do
|
|
7
|
+
subject(:statuses) { Statuses.new }
|
|
8
|
+
describe '#all' do
|
|
9
|
+
subject { statuses.all }
|
|
10
|
+
it { should be_an Hash }
|
|
11
|
+
it { should_not be_empty }
|
|
12
|
+
end
|
|
13
|
+
describe '#each' do
|
|
14
|
+
subject { statuses.each }
|
|
15
|
+
it { should be_an Enumerable }
|
|
16
|
+
end
|
|
17
|
+
describe '#[]' do
|
|
18
|
+
let(:admin_library) { AdminLibrary.new('NYU50') }
|
|
19
|
+
subject { statuses[admin_library] }
|
|
20
|
+
it { should be_an Array }
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
module Exlibris
|
|
3
|
+
module Aleph
|
|
4
|
+
module Table
|
|
5
|
+
module Reader
|
|
6
|
+
describe Base do
|
|
7
|
+
let(:admin_library) { AdminLibrary.new('ADM50') }
|
|
8
|
+
let(:filename) { 'filename' }
|
|
9
|
+
subject(:base) { Base.new(admin_library, filename) }
|
|
10
|
+
describe '#admin_library' do
|
|
11
|
+
subject { base.admin_library }
|
|
12
|
+
it { should eq admin_library }
|
|
13
|
+
end
|
|
14
|
+
describe '#filename' do
|
|
15
|
+
subject { base.filename }
|
|
16
|
+
it { should eq filename }
|
|
17
|
+
end
|
|
18
|
+
describe '#all' do
|
|
19
|
+
subject { base.all }
|
|
20
|
+
it 'should raise a RuntimeError' do
|
|
21
|
+
expect { subject }.to raise_error RuntimeError
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
module Exlibris
|
|
3
|
+
module Aleph
|
|
4
|
+
module Table
|
|
5
|
+
module Reader
|
|
6
|
+
describe Collections do
|
|
7
|
+
let(:irrelevant_sub_library_codes) { Config.irrelevant_sub_libraries }
|
|
8
|
+
let(:admin_library) { AdminLibrary.new('NYU50') }
|
|
9
|
+
subject(:collections) { Collections.new(admin_library) }
|
|
10
|
+
describe '#filename' do
|
|
11
|
+
subject { collections.filename }
|
|
12
|
+
it { should eq 'tab40.eng' }
|
|
13
|
+
end
|
|
14
|
+
describe '#all' do
|
|
15
|
+
subject { collections.all }
|
|
16
|
+
it { should be_an Array }
|
|
17
|
+
it { should_not be_empty }
|
|
18
|
+
it 'should contain Collections' do
|
|
19
|
+
subject.each do |collection|
|
|
20
|
+
expect(collection).to be_a Collection
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
it 'should not include irrelevant codes' do
|
|
24
|
+
subject.find do |collection|
|
|
25
|
+
expect(irrelevant_sub_library_codes).not_to include(collection.sub_library.code)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
module Exlibris
|
|
3
|
+
module Aleph
|
|
4
|
+
module Table
|
|
5
|
+
module Reader
|
|
6
|
+
describe ItemCirculationPolicies do
|
|
7
|
+
let(:irrelevant_sub_library_codes) { Config.irrelevant_sub_libraries }
|
|
8
|
+
let(:admin_library) { AdminLibrary.new('NYU50') }
|
|
9
|
+
subject(:item_circulation_policies) { ItemCirculationPolicies.new(admin_library) }
|
|
10
|
+
describe '#filename' do
|
|
11
|
+
subject { item_circulation_policies.filename }
|
|
12
|
+
it { should eq 'tab15.eng' }
|
|
13
|
+
end
|
|
14
|
+
describe '#all' do
|
|
15
|
+
subject { item_circulation_policies.all }
|
|
16
|
+
it { should be_an Array }
|
|
17
|
+
it { should_not be_empty }
|
|
18
|
+
it 'should contain Collections' do
|
|
19
|
+
subject.each do |collection|
|
|
20
|
+
expect(collection).to be_a Aleph::Item::CirculationPolicy
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
it 'should not include irrelevant codes' do
|
|
24
|
+
subject.find do |item_circulation_policy|
|
|
25
|
+
expect(irrelevant_sub_library_codes).not_to include(item_circulation_policy.identifier.sub_library.code)
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|