exlibris-aleph 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,146 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module Exlibris
|
3
|
+
module Aleph
|
4
|
+
class Item
|
5
|
+
describe CirculationPolicy do
|
6
|
+
let(:status_code) { '##' }
|
7
|
+
let(:status) { Status.new(status_code) }
|
8
|
+
let(:processing_status_code) { 'DP' }
|
9
|
+
let(:processing_status) { ProcessingStatus.new(processing_status_code) }
|
10
|
+
let(:admin_library) { AdminLibrary.new('ADM50') }
|
11
|
+
let(:sub_library) { SubLibrary.new('SUB', 'Sub Library', admin_library) }
|
12
|
+
let(:identifier) { CirculationPolicy::Identifier.new(status, processing_status, sub_library) }
|
13
|
+
let(:display) { CirculationPolicy::Display.new('Display') }
|
14
|
+
let(:row) { double }
|
15
|
+
let(:loanable) { 'Y' }
|
16
|
+
let(:renewable) { 'Y' }
|
17
|
+
let(:requestable) { 'Y' }
|
18
|
+
let(:photocopyable) { 'Y' }
|
19
|
+
let(:displayable) { 'Y' }
|
20
|
+
let(:specific_item) { 'Y' }
|
21
|
+
let(:limit_hold) { 'Y' }
|
22
|
+
let(:recallable) { 'Y' }
|
23
|
+
let(:rush_recallable) { 'Y' }
|
24
|
+
let(:reloaning_limit) { '00' }
|
25
|
+
let(:bookable) { 'Y' }
|
26
|
+
let(:booking_hours) { 'A' }
|
27
|
+
let(:privileges) { CirculationPolicy::Privileges.new(row) }
|
28
|
+
before do
|
29
|
+
allow(row).to receive(:loanable).and_return(loanable)
|
30
|
+
allow(row).to receive(:renewable).and_return(renewable)
|
31
|
+
allow(row).to receive(:requestable).and_return(requestable)
|
32
|
+
allow(row).to receive(:photocopyable).and_return(photocopyable)
|
33
|
+
allow(row).to receive(:displayable).and_return(displayable)
|
34
|
+
allow(row).to receive(:specific_item).and_return(specific_item)
|
35
|
+
allow(row).to receive(:limit_hold).and_return(limit_hold)
|
36
|
+
allow(row).to receive(:recallable).and_return(recallable)
|
37
|
+
allow(row).to receive(:rush_recallable).and_return(photocopyable)
|
38
|
+
allow(row).to receive(:reloaning_limit).and_return(rush_recallable)
|
39
|
+
allow(row).to receive(:bookable).and_return(bookable)
|
40
|
+
allow(row).to receive(:booking_hours).and_return(booking_hours)
|
41
|
+
end
|
42
|
+
subject(:circulation_policy) { CirculationPolicy.new(identifier, display, privileges) }
|
43
|
+
it { should be_a CirculationPolicy }
|
44
|
+
describe '#identifier' do
|
45
|
+
subject { circulation_policy.identifier }
|
46
|
+
it { should eq identifier }
|
47
|
+
end
|
48
|
+
describe '#display' do
|
49
|
+
subject { circulation_policy.display }
|
50
|
+
it { should eq display }
|
51
|
+
end
|
52
|
+
describe '#privileges' do
|
53
|
+
subject { circulation_policy.privileges }
|
54
|
+
it { should eq privileges }
|
55
|
+
end
|
56
|
+
describe '#==' do
|
57
|
+
subject { circulation_policy == other_object }
|
58
|
+
context 'when the other object is an Item::CirculationPolicy' do
|
59
|
+
let(:other_identifier) { identifier }
|
60
|
+
let(:other_display) { display }
|
61
|
+
let(:other_privileges) { privileges }
|
62
|
+
let(:other_object) { CirculationPolicy.new(other_identifier, other_display, other_privileges) }
|
63
|
+
context 'but the identifier of the other object is different' do
|
64
|
+
let(:other_status) { Status.new('01') }
|
65
|
+
let(:other_identifier) { CirculationPolicy::Identifier.new(other_status, processing_status, sub_library) }
|
66
|
+
it { should be_false }
|
67
|
+
end
|
68
|
+
context 'and the identifier of the other object is the same' do
|
69
|
+
it { should be_true }
|
70
|
+
end
|
71
|
+
end
|
72
|
+
context 'when the other object is not an Item::CirculationPolicy' do
|
73
|
+
let(:other_object) { "invalid" }
|
74
|
+
it { should be_false }
|
75
|
+
end
|
76
|
+
end
|
77
|
+
describe '#===' do
|
78
|
+
subject { circulation_policy === other_object }
|
79
|
+
context 'when the other object is an Item::CirculationPolicy' do
|
80
|
+
let(:other_identifier) { identifier }
|
81
|
+
let(:other_display) { display }
|
82
|
+
let(:other_privileges) { privileges }
|
83
|
+
let(:other_object) { CirculationPolicy.new(other_identifier, other_display, other_privileges) }
|
84
|
+
context 'but the identifier of the other object is different' do
|
85
|
+
let(:other_status) { Status.new('01') }
|
86
|
+
let(:other_identifier) { CirculationPolicy::Identifier.new(other_status, processing_status, sub_library) }
|
87
|
+
it { should be_false }
|
88
|
+
end
|
89
|
+
context 'and the identifier of the other object is the same' do
|
90
|
+
it { should be_true }
|
91
|
+
end
|
92
|
+
end
|
93
|
+
context 'when the other object is not an Item::CirculationPolicy' do
|
94
|
+
let(:other_object) { "invalid" }
|
95
|
+
it { should be_false }
|
96
|
+
end
|
97
|
+
end
|
98
|
+
describe '#eql?' do
|
99
|
+
subject { circulation_policy.eql?(other_object) }
|
100
|
+
context 'when the other object is an Item::CirculationPolicy' do
|
101
|
+
let(:other_identifier) { identifier }
|
102
|
+
let(:other_display) { display }
|
103
|
+
let(:other_privileges) { privileges }
|
104
|
+
let(:other_object) { CirculationPolicy.new(other_identifier, other_display, other_privileges) }
|
105
|
+
context 'but the identifier of the other object is different' do
|
106
|
+
let(:other_status) { Status.new('01') }
|
107
|
+
let(:other_identifier) { CirculationPolicy::Identifier.new(other_status, processing_status, sub_library) }
|
108
|
+
it { should be_false }
|
109
|
+
end
|
110
|
+
context 'and the identifier of the other object is the same' do
|
111
|
+
it { should be_true }
|
112
|
+
end
|
113
|
+
end
|
114
|
+
context 'when the other object is not an Item::CirculationPolicy' do
|
115
|
+
let(:other_object) { "invalid" }
|
116
|
+
it { should be_false }
|
117
|
+
end
|
118
|
+
end
|
119
|
+
context 'when initialized with arguments' do
|
120
|
+
context 'but the "identifier" argument is not an Item::CirculationPolicy::Identifier' do
|
121
|
+
let(:identifier) { "invalid" }
|
122
|
+
it 'should raise an ArgumentError' do
|
123
|
+
expect { subject }.to raise_error ArgumentError
|
124
|
+
end
|
125
|
+
end
|
126
|
+
context 'and the "identifier" argument is an Item::CirculationPolicy::Identifier' do
|
127
|
+
context 'but the "display" argument is not an Item::CirculationPolicy::Display' do
|
128
|
+
let(:display) { "invalid" }
|
129
|
+
it 'should raise an ArgumentError' do
|
130
|
+
expect { subject }.to raise_error ArgumentError
|
131
|
+
end
|
132
|
+
end
|
133
|
+
context 'and the "display" argument is an Item::CirculationPolicy::Display' do
|
134
|
+
context 'but the "privileges" argument is not a Item::CirculationPolicy::Privileges' do
|
135
|
+
let(:privileges) { "invalid" }
|
136
|
+
it 'should raise an ArgumentError' do
|
137
|
+
expect { subject }.to raise_error ArgumentError
|
138
|
+
end
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
@@ -0,0 +1,83 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module Exlibris
|
3
|
+
module Aleph
|
4
|
+
class Item
|
5
|
+
describe CirculationStatus do
|
6
|
+
let(:value) { 'On Shelf' }
|
7
|
+
subject(:circulation_status) { CirculationStatus.new(value) }
|
8
|
+
it { should be_a CirculationStatus }
|
9
|
+
describe '#value' do
|
10
|
+
subject { circulation_status.value }
|
11
|
+
it { should eq value }
|
12
|
+
end
|
13
|
+
describe '#due_date' do
|
14
|
+
subject { circulation_status.due_date }
|
15
|
+
it { should be_nil }
|
16
|
+
context 'when the value is "05/31/14"' do
|
17
|
+
let(:value) { '05/31/14' }
|
18
|
+
it { should eq '05/31/14' }
|
19
|
+
end
|
20
|
+
context 'when the value is "Recalled due date: 05/31/14"' do
|
21
|
+
let(:value) { 'Recalled due date: 05/31/14' }
|
22
|
+
it { should eq '05/31/14' }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
describe '#to_s' do
|
26
|
+
subject { circulation_status.to_s }
|
27
|
+
it { should eq value }
|
28
|
+
end
|
29
|
+
describe '#==' do
|
30
|
+
subject { circulation_status == other_object }
|
31
|
+
context 'when the other object is an Exlibris::Aleph::Item::DisplayMask' do
|
32
|
+
context 'and the value is the same' do
|
33
|
+
let(:other_object) { CirculationStatus.new(value) }
|
34
|
+
it { should be_true }
|
35
|
+
end
|
36
|
+
context 'but the value is different' do
|
37
|
+
let(:other_object) { CirculationStatus.new('Reshelving') }
|
38
|
+
it { should be_false }
|
39
|
+
end
|
40
|
+
end
|
41
|
+
context 'when the other object is not an Exlibris::Aleph::Item::DisplayMask' do
|
42
|
+
let(:other_object) { "string" }
|
43
|
+
it { should be_false }
|
44
|
+
end
|
45
|
+
end
|
46
|
+
describe '#===' do
|
47
|
+
subject { circulation_status === other_object }
|
48
|
+
context 'when the other object is an Exlibris::Aleph::Item::DisplayMask' do
|
49
|
+
context 'and the value is the same' do
|
50
|
+
let(:other_object) { CirculationStatus.new(value) }
|
51
|
+
it { should be_true }
|
52
|
+
end
|
53
|
+
context 'but the value is different' do
|
54
|
+
let(:other_object) { CirculationStatus.new('Reshelving') }
|
55
|
+
it { should be_false }
|
56
|
+
end
|
57
|
+
end
|
58
|
+
context 'when the other object is not an Exlibris::Aleph::Item::DisplayMask' do
|
59
|
+
let(:other_object) { "string" }
|
60
|
+
it { should be_false }
|
61
|
+
end
|
62
|
+
end
|
63
|
+
describe '#eql?' do
|
64
|
+
subject { circulation_status.eql?(other_object) }
|
65
|
+
context 'when the other object is an Exlibris::Aleph::Item::DisplayMask' do
|
66
|
+
context 'and the value is the same' do
|
67
|
+
let(:other_object) { CirculationStatus.new(value) }
|
68
|
+
it { should be_true }
|
69
|
+
end
|
70
|
+
context 'but the value is different' do
|
71
|
+
let(:other_object) { CirculationStatus.new('Reshelving') }
|
72
|
+
it { should be_false }
|
73
|
+
end
|
74
|
+
end
|
75
|
+
context 'when the other object is not an Exlibris::Aleph::Item::DisplayMask' do
|
76
|
+
let(:other_object) { "string" }
|
77
|
+
it { should be_false }
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module Exlibris
|
3
|
+
module Aleph
|
4
|
+
class Item
|
5
|
+
describe DisplayMask do
|
6
|
+
let(:value) { 'Display' }
|
7
|
+
let(:mask) { 'Display Mask' }
|
8
|
+
subject(:display_mask ) { DisplayMask.new(value, mask) }
|
9
|
+
it { should be_a DisplayMask }
|
10
|
+
describe '#value' do
|
11
|
+
subject { display_mask.value }
|
12
|
+
it { should eq value }
|
13
|
+
end
|
14
|
+
describe '#mask' do
|
15
|
+
subject { display_mask.mask }
|
16
|
+
it { should eq mask }
|
17
|
+
end
|
18
|
+
describe '#==' do
|
19
|
+
subject { display_mask == other_object }
|
20
|
+
context 'when the other object is an Exlibris::Aleph::Item::DisplayMask' do
|
21
|
+
context 'and the value is the same' do
|
22
|
+
let(:other_object) { DisplayMask.new(value, mask) }
|
23
|
+
it { should be_true }
|
24
|
+
end
|
25
|
+
context 'but the value is different' do
|
26
|
+
let(:other_object) { DisplayMask.new('Display 1', 'Display 1 Mask') }
|
27
|
+
it { should be_false }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
context 'when the other object is not an Exlibris::Aleph::Item::DisplayMask' do
|
31
|
+
let(:other_object) { "string" }
|
32
|
+
it { should be_false }
|
33
|
+
end
|
34
|
+
end
|
35
|
+
describe '#===' do
|
36
|
+
subject { display_mask === other_object }
|
37
|
+
context 'when the other object is an Exlibris::Aleph::Item::DisplayMask' do
|
38
|
+
context 'and the value is the same' do
|
39
|
+
let(:other_object) { DisplayMask.new(value, mask) }
|
40
|
+
it { should be_true }
|
41
|
+
end
|
42
|
+
context 'but the value is different' do
|
43
|
+
let(:other_object) { DisplayMask.new('Display 1', 'Display 1 Mask') }
|
44
|
+
it { should be_false }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
context 'when the other object is not an Exlibris::Aleph::Item::DisplayMask' do
|
48
|
+
let(:other_object) { "string" }
|
49
|
+
it { should be_false }
|
50
|
+
end
|
51
|
+
end
|
52
|
+
describe '#eql?' do
|
53
|
+
subject { display_mask.eql?(other_object) }
|
54
|
+
context 'when the other object is an Exlibris::Aleph::Item::DisplayMask' do
|
55
|
+
context 'and the value is the same' do
|
56
|
+
let(:other_object) { DisplayMask.new(value, mask) }
|
57
|
+
it { should be_true }
|
58
|
+
end
|
59
|
+
context 'but the value is different' do
|
60
|
+
let(:other_object) { DisplayMask.new('Display 1', 'Display 1 Mask') }
|
61
|
+
it { should be_false }
|
62
|
+
end
|
63
|
+
end
|
64
|
+
context 'when the other object is not an Exlibris::Aleph::Item::DisplayMask' do
|
65
|
+
let(:other_object) { "string" }
|
66
|
+
it { should be_false }
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module Exlibris
|
3
|
+
module Aleph
|
4
|
+
class Item
|
5
|
+
describe OpacNote do
|
6
|
+
let(:value) { "Library's copy is predominantly out of order Advertising and Covers from 1936." }
|
7
|
+
subject(:opac_note) { OpacNote.new(value) }
|
8
|
+
describe '#value' do
|
9
|
+
subject { opac_note.value }
|
10
|
+
it { should eq value }
|
11
|
+
end
|
12
|
+
describe '#to_s' do
|
13
|
+
subject { opac_note.to_s }
|
14
|
+
it { should eq value }
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module Exlibris
|
3
|
+
module Aleph
|
4
|
+
class Item
|
5
|
+
describe ProcessingStatus do
|
6
|
+
let(:code) { 'DP' }
|
7
|
+
subject(:processing_status) { ProcessingStatus.new(code) }
|
8
|
+
it { should be_a ProcessingStatus }
|
9
|
+
describe '#code' do
|
10
|
+
subject { processing_status.code }
|
11
|
+
it { should eq code }
|
12
|
+
end
|
13
|
+
describe '#display' do
|
14
|
+
subject { processing_status.display }
|
15
|
+
it { should be_nil }
|
16
|
+
end
|
17
|
+
describe '#to_s' do
|
18
|
+
subject { processing_status.to_s }
|
19
|
+
it { should eq code }
|
20
|
+
end
|
21
|
+
describe '#==' do
|
22
|
+
subject { processing_status == other_object }
|
23
|
+
context 'when the other object is an Item::ProcessingStatus' do
|
24
|
+
context 'and the code is the same' do
|
25
|
+
let(:other_object) { ProcessingStatus.new(code) }
|
26
|
+
it { should be_true }
|
27
|
+
end
|
28
|
+
context 'but the code is different' do
|
29
|
+
let(:other_object) { ProcessingStatus.new('##') }
|
30
|
+
it { should be_false }
|
31
|
+
end
|
32
|
+
end
|
33
|
+
context 'when the other object is not an Item::ProcessingStatus' do
|
34
|
+
let(:other_object) { "string" }
|
35
|
+
it { should be_false }
|
36
|
+
end
|
37
|
+
end
|
38
|
+
describe '#===' do
|
39
|
+
subject { processing_status === other_object }
|
40
|
+
context 'when the other object is an Item::ProcessingStatus' do
|
41
|
+
context 'and the code is the same' do
|
42
|
+
let(:other_object) { ProcessingStatus.new(code) }
|
43
|
+
it { should be_true }
|
44
|
+
end
|
45
|
+
context 'but the code is different' do
|
46
|
+
let(:other_object) { ProcessingStatus.new('##') }
|
47
|
+
it { should be_false }
|
48
|
+
end
|
49
|
+
end
|
50
|
+
context 'when the other object is not an Item::ProcessingStatus' do
|
51
|
+
let(:other_object) { "string" }
|
52
|
+
it { should be_false }
|
53
|
+
end
|
54
|
+
end
|
55
|
+
describe '#eql?' do
|
56
|
+
subject { processing_status.eql?(other_object) }
|
57
|
+
context 'when the other object is an Item::ProcessingStatus' do
|
58
|
+
context 'and the code is the same' do
|
59
|
+
let(:other_object) { ProcessingStatus.new(code) }
|
60
|
+
it { should be_true }
|
61
|
+
end
|
62
|
+
context 'but the code is different' do
|
63
|
+
let(:other_object) { ProcessingStatus.new('##') }
|
64
|
+
it { should be_false }
|
65
|
+
end
|
66
|
+
end
|
67
|
+
context 'when the other object is not an Item::ProcessingStatus' do
|
68
|
+
let(:other_object) { "string" }
|
69
|
+
it { should be_false }
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
end
|
75
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module Exlibris
|
3
|
+
module Aleph
|
4
|
+
class Item
|
5
|
+
describe Queue do
|
6
|
+
let(:value) { "1 request(s) of 1 items." }
|
7
|
+
subject(:queue) { Queue.new(value) }
|
8
|
+
describe '#value' do
|
9
|
+
subject { queue.value }
|
10
|
+
it { should eq value }
|
11
|
+
end
|
12
|
+
describe '#to_s' do
|
13
|
+
subject { queue.to_s }
|
14
|
+
it { should eq value }
|
15
|
+
end
|
16
|
+
describe '#number_of_requests' do
|
17
|
+
subject { queue.number_of_requests }
|
18
|
+
it { should eq 1 }
|
19
|
+
context 'when the input value is nil' do
|
20
|
+
let(:value) { nil }
|
21
|
+
it { should eq 0 }
|
22
|
+
end
|
23
|
+
context 'when the input value is blank' do
|
24
|
+
let(:value) { '' }
|
25
|
+
it { should eq 0 }
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module Exlibris
|
3
|
+
module Aleph
|
4
|
+
class Item
|
5
|
+
describe Status do
|
6
|
+
let(:code) { '01' }
|
7
|
+
let(:display) { 'Regular loan' }
|
8
|
+
subject(:status) { Status.new(code, display) }
|
9
|
+
it { should be_a Status }
|
10
|
+
describe '#code' do
|
11
|
+
subject { status.code }
|
12
|
+
it { should eq code }
|
13
|
+
end
|
14
|
+
describe '#display' do
|
15
|
+
subject { status.display }
|
16
|
+
it { should eq display }
|
17
|
+
context 'when initialized without a display' do
|
18
|
+
let(:status) { Status.new(code) }
|
19
|
+
it { should be_nil }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
describe '#to_s' do
|
23
|
+
subject { status.to_s }
|
24
|
+
it { should eq display }
|
25
|
+
end
|
26
|
+
describe '#==' do
|
27
|
+
subject { status == other_object }
|
28
|
+
context 'when the other object is an Item::Status' do
|
29
|
+
context 'and the code is the same' do
|
30
|
+
let(:other_object) { Status.new(code) }
|
31
|
+
it { should be_true }
|
32
|
+
end
|
33
|
+
context 'but the code is different' do
|
34
|
+
let(:other_object) { Status.new('02') }
|
35
|
+
it { should be_false }
|
36
|
+
end
|
37
|
+
end
|
38
|
+
context 'when the other object is not an Item::Status' do
|
39
|
+
let(:other_object) { "string" }
|
40
|
+
it { should be_false }
|
41
|
+
end
|
42
|
+
end
|
43
|
+
describe '#===' do
|
44
|
+
subject { status === other_object }
|
45
|
+
context 'when the other object is an Item::Status' do
|
46
|
+
context 'and the code is the same' do
|
47
|
+
let(:other_object) { Status.new(code) }
|
48
|
+
it { should be_true }
|
49
|
+
end
|
50
|
+
context 'but the code is different' do
|
51
|
+
let(:other_object) { Status.new('02') }
|
52
|
+
it { should be_false }
|
53
|
+
end
|
54
|
+
end
|
55
|
+
context 'when the other object is not an Item::Status' do
|
56
|
+
let(:other_object) { "string" }
|
57
|
+
it { should be_false }
|
58
|
+
end
|
59
|
+
end
|
60
|
+
describe '#eql?' do
|
61
|
+
subject { status.eql?(other_object) }
|
62
|
+
context 'when the other object is an Item::Status' do
|
63
|
+
context 'and the code is the same' do
|
64
|
+
let(:other_object) { Status.new(code) }
|
65
|
+
it { should be_true }
|
66
|
+
end
|
67
|
+
context 'but the code is different' do
|
68
|
+
let(:other_object) { Status.new('02') }
|
69
|
+
it { should be_false }
|
70
|
+
end
|
71
|
+
end
|
72
|
+
context 'when the other object is not an Item::Status' do
|
73
|
+
let(:other_object) { "string" }
|
74
|
+
it { should be_false }
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
end
|
80
|
+
end
|