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,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module Exlibris
|
3
|
+
module Aleph
|
4
|
+
module API
|
5
|
+
describe Base do
|
6
|
+
subject(:base) { Base.new }
|
7
|
+
it { should be_a Base }
|
8
|
+
describe '#client' do
|
9
|
+
subject { base.send(:client) }
|
10
|
+
it 'should raise a RuntimeError' do
|
11
|
+
expect { subject }.to raise_error RuntimeError
|
12
|
+
end
|
13
|
+
end
|
14
|
+
describe '#reader' do
|
15
|
+
subject { base.send(:reader) }
|
16
|
+
it 'should raise a RuntimeError' do
|
17
|
+
expect { subject }.to raise_error RuntimeError
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module Exlibris
|
3
|
+
module Aleph
|
4
|
+
module API
|
5
|
+
module Client
|
6
|
+
describe Base do
|
7
|
+
let(:view) { 'full' }
|
8
|
+
let(:query) { { view: view } }
|
9
|
+
subject(:base) { Base.new(query) }
|
10
|
+
it { should be_a Base }
|
11
|
+
describe Base::VALID_VIEWS do
|
12
|
+
subject { Base::VALID_VIEWS }
|
13
|
+
it { should be_an Array }
|
14
|
+
it { should eq ['full', 'brief'] }
|
15
|
+
end
|
16
|
+
context 'when initialized without a "query" argument' do
|
17
|
+
subject(:base) { Base.new }
|
18
|
+
it { should be_a Base }
|
19
|
+
end
|
20
|
+
context 'when initialized with a "query" argument' do
|
21
|
+
context 'but the "query" argument is invalid' do
|
22
|
+
let(:query) { "invalid" }
|
23
|
+
it 'should raise an ArgumentError' do
|
24
|
+
expect { subject }.to raise_error ArgumentError
|
25
|
+
end
|
26
|
+
end
|
27
|
+
context 'and the "query" argument is valid' do
|
28
|
+
context 'but the view is invalid' do
|
29
|
+
let(:view) { 'invalid' }
|
30
|
+
it 'should raise an ArgumentError' do
|
31
|
+
expect { subject }.to raise_error ArgumentError
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module Exlibris
|
3
|
+
module Aleph
|
4
|
+
module API
|
5
|
+
module Client
|
6
|
+
class Patron
|
7
|
+
describe Address, vcr: {cassette_name: 'patron', record: :new_episodes} do
|
8
|
+
let(:patron_id) { 'BOR_ID' }
|
9
|
+
subject(:address) { Address.new(patron_id) }
|
10
|
+
it { should be_a Address }
|
11
|
+
describe '#patron_id' do
|
12
|
+
subject { address.patron_id }
|
13
|
+
it { should eq patron_id }
|
14
|
+
end
|
15
|
+
describe '#reply_code' do
|
16
|
+
subject { address.reply_code }
|
17
|
+
it { should eq '0000' }
|
18
|
+
end
|
19
|
+
describe '#reply_text' do
|
20
|
+
subject { address.reply_text }
|
21
|
+
it { should eq 'ok' }
|
22
|
+
end
|
23
|
+
describe '#error?' do
|
24
|
+
subject { address.error? }
|
25
|
+
it { should be_false }
|
26
|
+
end
|
27
|
+
describe '#to_h' do
|
28
|
+
subject { address.to_h }
|
29
|
+
it { should be_a Hash }
|
30
|
+
end
|
31
|
+
describe '#to_xml' do
|
32
|
+
subject { address.to_xml }
|
33
|
+
it { should be_a String }
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,101 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module Exlibris
|
3
|
+
module Aleph
|
4
|
+
module API
|
5
|
+
module Client
|
6
|
+
class Patron
|
7
|
+
class Record
|
8
|
+
class Item
|
9
|
+
class CreateHold
|
10
|
+
describe Parameters do
|
11
|
+
let(:pickup_location) do
|
12
|
+
Exlibris::Aleph::PickupLocation.new('BOBST', 'NYU Bobst')
|
13
|
+
end
|
14
|
+
let(:last_interest_date) { '20140915' }
|
15
|
+
let(:start_interest_date) { '20140915' }
|
16
|
+
let(:sub_author) { 'Sub Author' }
|
17
|
+
let(:sub_title) { 'Sub Title' }
|
18
|
+
let(:pages) { 'Pages' }
|
19
|
+
let(:note_1) { 'Note 1' }
|
20
|
+
let(:note_2) { 'Note 2' }
|
21
|
+
let(:rush) { 'N' }
|
22
|
+
let(:input_parameters) do
|
23
|
+
{
|
24
|
+
pickup_location: pickup_location,
|
25
|
+
last_interest_date: last_interest_date,
|
26
|
+
start_interest_date: start_interest_date,
|
27
|
+
sub_author: sub_author,
|
28
|
+
sub_title: sub_title,
|
29
|
+
pages: pages,
|
30
|
+
note_1: note_1,
|
31
|
+
note_2: note_2,
|
32
|
+
rush: rush
|
33
|
+
}
|
34
|
+
end
|
35
|
+
subject(:parameters) { Parameters.new(input_parameters) }
|
36
|
+
it { should be_a Parameters }
|
37
|
+
describe '#pickup_location' do
|
38
|
+
subject { parameters.pickup_location }
|
39
|
+
it { should eq pickup_location }
|
40
|
+
end
|
41
|
+
describe '#last_interest_date' do
|
42
|
+
subject { parameters.last_interest_date }
|
43
|
+
it { should eq last_interest_date }
|
44
|
+
end
|
45
|
+
describe '#start_interest_date' do
|
46
|
+
subject { parameters.start_interest_date }
|
47
|
+
it { should eq start_interest_date }
|
48
|
+
end
|
49
|
+
describe '#sub_author' do
|
50
|
+
subject { parameters.sub_author }
|
51
|
+
it { should eq sub_author }
|
52
|
+
end
|
53
|
+
describe '#sub_title' do
|
54
|
+
subject { parameters.sub_title }
|
55
|
+
it { should eq sub_title }
|
56
|
+
end
|
57
|
+
describe '#pages' do
|
58
|
+
subject { parameters.pages }
|
59
|
+
it { should eq pages }
|
60
|
+
end
|
61
|
+
describe '#note_1' do
|
62
|
+
subject { parameters.note_1 }
|
63
|
+
it { should eq note_1 }
|
64
|
+
end
|
65
|
+
describe '#note_2' do
|
66
|
+
subject { parameters.note_2 }
|
67
|
+
it { should eq note_2 }
|
68
|
+
end
|
69
|
+
describe '#rush' do
|
70
|
+
subject { parameters.rush }
|
71
|
+
it { should eq rush }
|
72
|
+
end
|
73
|
+
context 'when the input parameters is not a Hash' do
|
74
|
+
let(:input_parameters) { 'invalid' }
|
75
|
+
it 'should raise an ArgumentError' do
|
76
|
+
expect { subject }.to raise_error ArgumentError
|
77
|
+
end
|
78
|
+
end
|
79
|
+
context 'when the input parameters is a Hash' do
|
80
|
+
context 'but the pickup location is not a PickupLocation' do
|
81
|
+
let(:pickup_location) { 'invalid' }
|
82
|
+
it 'should raise an ArgumentError' do
|
83
|
+
expect { subject }.to raise_error ArgumentError
|
84
|
+
end
|
85
|
+
end
|
86
|
+
context 'and the pickup location is nil' do
|
87
|
+
let(:pickup_location) { nil }
|
88
|
+
it 'should not raise an ArgumentError' do
|
89
|
+
expect { subject }.not_to raise_error
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
@@ -0,0 +1,102 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module Exlibris
|
3
|
+
module Aleph
|
4
|
+
module API
|
5
|
+
module Client
|
6
|
+
class Patron
|
7
|
+
class Record
|
8
|
+
class Item
|
9
|
+
describe Hold, vcr: {cassette_name: 'patron'} do
|
10
|
+
let(:patron_id) { 'BOR_ID' }
|
11
|
+
let(:record_id) { 'NYU01002296594' }
|
12
|
+
let(:item_id) { 'NYU50002296594000010' }
|
13
|
+
let(:pickup_location) do
|
14
|
+
Exlibris::Aleph::PickupLocation.new('BOBST', 'NYU Bobst')
|
15
|
+
end
|
16
|
+
let(:parameters) do
|
17
|
+
CreateHold::Parameters.new({pickup_location: pickup_location})
|
18
|
+
end
|
19
|
+
subject(:create_hold) do
|
20
|
+
CreateHold.new(patron_id, record_id, item_id, parameters)
|
21
|
+
end
|
22
|
+
describe '#patron_id' do
|
23
|
+
subject { create_hold.patron_id }
|
24
|
+
it { should eq patron_id }
|
25
|
+
end
|
26
|
+
describe '#record_id' do
|
27
|
+
subject { create_hold.record_id }
|
28
|
+
it { should eq record_id }
|
29
|
+
end
|
30
|
+
describe '#item_id' do
|
31
|
+
subject { create_hold.item_id }
|
32
|
+
it { should eq item_id }
|
33
|
+
end
|
34
|
+
describe '#reply_code' do
|
35
|
+
subject { create_hold.reply_code }
|
36
|
+
it { should eq '0000' }
|
37
|
+
end
|
38
|
+
describe '#reply_text' do
|
39
|
+
subject { create_hold.reply_text }
|
40
|
+
it { should eq 'ok' }
|
41
|
+
end
|
42
|
+
describe '#error?' do
|
43
|
+
subject { create_hold.error? }
|
44
|
+
it { should be_false }
|
45
|
+
end
|
46
|
+
describe '#to_h' do
|
47
|
+
subject { create_hold.to_h }
|
48
|
+
it { should be_a Hash }
|
49
|
+
end
|
50
|
+
describe '#to_xml' do
|
51
|
+
subject { create_hold.to_xml }
|
52
|
+
it { should be_a String }
|
53
|
+
end
|
54
|
+
context 'when the patron does not have permissions place a hold on the item' do
|
55
|
+
let(:patron_id) { 'BOR_ID_WITHOUT_HOLD_PERMISSION' }
|
56
|
+
describe '#patron_id' do
|
57
|
+
subject { create_hold.patron_id }
|
58
|
+
it { should eq patron_id }
|
59
|
+
end
|
60
|
+
describe '#record_id' do
|
61
|
+
subject { create_hold.record_id }
|
62
|
+
it { should eq record_id }
|
63
|
+
end
|
64
|
+
describe '#item_id' do
|
65
|
+
subject { create_hold.item_id }
|
66
|
+
it { should eq item_id }
|
67
|
+
end
|
68
|
+
describe '#reply_code' do
|
69
|
+
subject { create_hold.reply_code }
|
70
|
+
it { should eq '0025' }
|
71
|
+
end
|
72
|
+
describe '#reply_text' do
|
73
|
+
subject { create_hold.reply_text }
|
74
|
+
it { should eq 'Failed to create request' }
|
75
|
+
end
|
76
|
+
describe '#error?' do
|
77
|
+
subject { create_hold.error? }
|
78
|
+
it { should be_true }
|
79
|
+
end
|
80
|
+
describe '#to_h' do
|
81
|
+
subject { create_hold.to_h }
|
82
|
+
it { should be_a Hash }
|
83
|
+
end
|
84
|
+
describe '#to_xml' do
|
85
|
+
subject { create_hold.to_xml }
|
86
|
+
it { should be_a String }
|
87
|
+
end
|
88
|
+
end
|
89
|
+
context 'when the parameters argument is not a Parameters' do
|
90
|
+
let(:parameters) { 'invalid' }
|
91
|
+
it 'should raise an ArgumentError' do
|
92
|
+
expect { subject }.to raise_error ArgumentError
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
end
|
101
|
+
end
|
102
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module Exlibris
|
3
|
+
module Aleph
|
4
|
+
module API
|
5
|
+
module Client
|
6
|
+
class Patron
|
7
|
+
class Record
|
8
|
+
class Item
|
9
|
+
describe Hold, vcr: {cassette_name: 'patron'} do
|
10
|
+
let(:patron_id) { 'BOR_ID' }
|
11
|
+
let(:record_id) { 'NYU01000864162' }
|
12
|
+
let(:item_id) { 'NYU50000864162000010' }
|
13
|
+
subject(:hold) { Hold.new(patron_id, record_id, item_id) }
|
14
|
+
it { should be_a Hold }
|
15
|
+
describe '#patron_id' do
|
16
|
+
subject { hold.patron_id }
|
17
|
+
it { should eq patron_id }
|
18
|
+
end
|
19
|
+
describe '#record_id' do
|
20
|
+
subject { hold.record_id }
|
21
|
+
it { should eq record_id }
|
22
|
+
end
|
23
|
+
describe '#item_id' do
|
24
|
+
subject { hold.item_id }
|
25
|
+
it { should eq item_id }
|
26
|
+
end
|
27
|
+
describe '#reply_code' do
|
28
|
+
subject { hold.reply_code }
|
29
|
+
it { should eq '0000' }
|
30
|
+
end
|
31
|
+
describe '#reply_text' do
|
32
|
+
subject { hold.reply_text }
|
33
|
+
it { should eq 'ok' }
|
34
|
+
end
|
35
|
+
describe '#error?' do
|
36
|
+
subject { hold.error? }
|
37
|
+
it { should be_false }
|
38
|
+
end
|
39
|
+
describe '#to_h' do
|
40
|
+
subject { hold.to_h }
|
41
|
+
it { should be_a Hash }
|
42
|
+
end
|
43
|
+
describe '#to_xml' do
|
44
|
+
subject { hold.to_xml }
|
45
|
+
it { should be_a String }
|
46
|
+
end
|
47
|
+
context 'when the patron does not have permissions place a hold on the item' do
|
48
|
+
let(:patron_id) { 'BOR_ID_WITHOUT_HOLD_PERMISSION' }
|
49
|
+
describe '#patron_id' do
|
50
|
+
subject { hold.patron_id }
|
51
|
+
it { should eq patron_id }
|
52
|
+
end
|
53
|
+
describe '#record_id' do
|
54
|
+
subject { hold.record_id }
|
55
|
+
it { should eq record_id }
|
56
|
+
end
|
57
|
+
describe '#item_id' do
|
58
|
+
subject { hold.item_id }
|
59
|
+
it { should eq item_id }
|
60
|
+
end
|
61
|
+
describe '#reply_code' do
|
62
|
+
subject { hold.reply_code }
|
63
|
+
it { should eq '0000' }
|
64
|
+
end
|
65
|
+
describe '#reply_text' do
|
66
|
+
subject { hold.reply_text }
|
67
|
+
it { should eq 'ok' }
|
68
|
+
end
|
69
|
+
describe '#error?' do
|
70
|
+
subject { hold.error? }
|
71
|
+
it { should be_false }
|
72
|
+
end
|
73
|
+
describe '#to_h' do
|
74
|
+
subject { hold.to_h }
|
75
|
+
it { should be_a Hash }
|
76
|
+
end
|
77
|
+
describe '#to_xml' do
|
78
|
+
subject { hold.to_xml }
|
79
|
+
it { should be_a String }
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module Exlibris
|
3
|
+
module Aleph
|
4
|
+
module API
|
5
|
+
module Client
|
6
|
+
class Patron
|
7
|
+
class Record
|
8
|
+
describe Item, vcr: {cassette_name: 'patron', record: :new_episodes} do
|
9
|
+
let(:patron_id) { 'BOR_ID' }
|
10
|
+
let(:record_id) { 'NYU01000980206' }
|
11
|
+
let(:id) { 'NYU50001951476001220' }
|
12
|
+
subject(:item) { Item.new(patron_id, record_id, id) }
|
13
|
+
it { should be_a Item }
|
14
|
+
describe '#patron_id' do
|
15
|
+
subject { item.patron_id }
|
16
|
+
it { should eq patron_id }
|
17
|
+
end
|
18
|
+
describe '#record_id' do
|
19
|
+
subject { item.record_id }
|
20
|
+
it { should eq record_id }
|
21
|
+
end
|
22
|
+
describe '#id' do
|
23
|
+
subject { item.id }
|
24
|
+
it { should eq id }
|
25
|
+
end
|
26
|
+
describe '#reply_code' do
|
27
|
+
subject { item.reply_code }
|
28
|
+
it { should eq '0000' }
|
29
|
+
end
|
30
|
+
describe '#reply_text' do
|
31
|
+
subject { item.reply_text }
|
32
|
+
it { should eq 'ok' }
|
33
|
+
end
|
34
|
+
describe '#error?' do
|
35
|
+
subject { item.error? }
|
36
|
+
it { should be_false }
|
37
|
+
end
|
38
|
+
describe '#to_h' do
|
39
|
+
subject { item.to_h }
|
40
|
+
it { should be_a Hash }
|
41
|
+
end
|
42
|
+
describe '#to_xml' do
|
43
|
+
subject { item.to_xml }
|
44
|
+
it { should be_a String }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|