-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2904d7
commit 10553ce
Showing
3 changed files
with
33 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,24 @@ | ||
# require 'test_helper' | ||
# class ConfigTest < Test::Unit::TestCase | ||
# def test_config | ||
# reset_aleph_configuration | ||
# Exlibris::Aleph.configure do |config| | ||
# config.base_url = "test_url" | ||
# config.institution = "TEST_INSTITUTION" | ||
# config.libraries = { "LIB_CODE1" => "Manually Library Decoded 1", "LIB_CODE2" => "Manually Library Decoded 2", | ||
# "LIB_CODE3" => "Manually Library Decoded 3" } | ||
# end | ||
# assert_equal "test_url", Exlibris::Primo::Config.base_url | ||
# assert_equal "TEST_INSTITUTION", Exlibris::Primo::Config.institution | ||
# assert_equal({ "LIB_CODE1" => "Manually Library Decoded 1", "LIB_CODE2" => "Manually Library Decoded 2", | ||
# "LIB_CODE3" => "Manually Library Decoded 3" }, Exlibris::Primo::Config.libraries) | ||
# reset_primo_configuration | ||
# end | ||
# | ||
# def test_config_from_yaml | ||
# reset_aleph_configuration | ||
# yaml_aleph_configuration | ||
# assert_equal "yaml_url", Exlibris::Primo::Config.base_url | ||
# assert_equal "YAML_INSTITUTION", Exlibris::Primo::Config.institution | ||
# assert_nil(Exlibris::Primo::Config.institutions) | ||
# assert_equal({ "LIB_CODE1" => "Library Decoded 1", "LIB_CODE2" => "Library Decoded 2", | ||
# "LIB_CODE3" => "Library Decoded 3" }, Exlibris::Primo::Config.libraries) | ||
# assert_equal({"processing"=>"In Processing", | ||
# "offsite"=>"Available Offsite", "in_transit"=>"In Processing", | ||
# "check_holdings"=>"Check Availability", "unavailable"=>"Unavailable", | ||
# "available"=>"Available", "requested"=>"Requested", "billed_as_lost"=>"Billed as Lost", | ||
# "request_ill"=>"Request ILL"}, Exlibris::Primo::Config.availability_statuses) | ||
# assert_equal({ | ||
# "aleph"=> {"class_name"=>"Aleph", "base_url"=>"http://aleph.library.edu", "rest_url"=>"http://aleph.library.edu:1891/rest-dlf", | ||
# "local_base"=>"LOCAL01", "requestable_statuses"=>["available"], "sub_library_codes"=> { | ||
# "LIB_CODE1"=>"AlephSubLibrary1", "LIB_CODE2"=>"AlephSubLibrary1", "LIB_CODE3"=>"AlephSubLibrary2"}}, | ||
# "source2"=> {"source_config2"=>"Some other source 2 config", "source_config1"=>"Some source 2 config"}, | ||
# "source1"=> {"source_config2"=>"Some other 1 source config", "source_config1"=>"Some source 1 config", | ||
# "class_name"=>"Source1ClassName"}}, Exlibris::Primo::Config.sources) | ||
# assert_nil(Exlibris::Primo::Config.facet_labels) | ||
# assert_nil(Exlibris::Primo::Config.facet_top_level) | ||
# assert_nil(Exlibris::Primo::Config.facet_collections) | ||
# assert_nil(Exlibris::Primo::Config.facet_resource_types) | ||
# reset_primo_configuration | ||
# end | ||
# | ||
# def test_config_attributes | ||
# reset_aleph_configuration | ||
# yaml_aleph_configuration | ||
# search = Exlibris::Primo::Search.new | ||
# assert_equal "yaml_url", search.base_url | ||
# assert_equal "YAML_INSTITUTION", search.institution | ||
# assert_equal({}, search.institutions) | ||
# assert_equal({ "LIB_CODE1" => "Library Decoded 1", "LIB_CODE2" => "Library Decoded 2", | ||
# "LIB_CODE3" => "Library Decoded 3" }, search.libraries) | ||
# assert_equal({"processing"=>"In Processing", | ||
# "offsite"=>"Available Offsite", "in_transit"=>"In Processing", | ||
# "check_holdings"=>"Check Availability", "unavailable"=>"Unavailable", | ||
# "available"=>"Available", "requested"=>"Requested", "billed_as_lost"=>"Billed as Lost", | ||
# "request_ill"=>"Request ILL"}, search.availability_statuses) | ||
# assert_equal({ | ||
# "aleph"=> {"class_name"=>"Aleph", "base_url"=>"http://aleph.library.edu", "rest_url"=>"http://aleph.library.edu:1891/rest-dlf", | ||
# "local_base"=>"LOCAL01", "requestable_statuses"=>["available"], "sub_library_codes"=> { | ||
# "LIB_CODE1"=>"AlephSubLibrary1", "LIB_CODE2"=>"AlephSubLibrary1", "LIB_CODE3"=>"AlephSubLibrary2"}}, | ||
# "source2"=> {"source_config2"=>"Some other source 2 config", "source_config1"=>"Some source 2 config"}, | ||
# "source1"=> {"source_config2"=>"Some other 1 source config", "source_config1"=>"Some source 1 config", | ||
# "class_name"=>"Source1ClassName"}}, search.sources) | ||
# assert_equal({}, search.facet_labels) | ||
# assert_equal({}, search.facet_top_level) | ||
# assert_equal({}, search.facet_collections) | ||
# assert_equal({}, search.facet_resource_types) | ||
# reset_primo_configuration | ||
# end | ||
# end | ||
require 'test_helper' | ||
class ConfigTest < Test::Unit::TestCase | ||
def test_config | ||
reset_aleph_configuration | ||
Exlibris::Aleph.configure do |config| | ||
config.base_url = "test_url" | ||
config.adms = ["ADM1", "ADM2"] | ||
end | ||
assert_equal "test_url", Exlibris::Aleph::Config.base_url | ||
assert_equal "test_url:1891/rest-dlf", Exlibris::Aleph::Config.rest_url | ||
assert_equal ["ADM1", "ADM2"], Exlibris::Aleph::Config.adms | ||
reset_aleph_configuration | ||
end | ||
|
||
def test_config_from_yaml | ||
reset_aleph_configuration | ||
yaml_aleph_configuration | ||
assert_equal "http://aleph.library.nyu.edu", Exlibris::Aleph::Config.base_url | ||
assert_equal "http://aleph.library.nyu.edu:1891/rest-dlf", Exlibris::Aleph::Config.rest_url | ||
assert_equal ["NYU50", "NYU51"], Exlibris::Aleph::Config.adms | ||
assert_nil(Exlibris::Aleph::Config.tab_path) | ||
reset_aleph_configuration | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
base_url: aleph.library.nyu.edu | ||
base_url: aleph.library.nyu.edu | ||
adms: ["NYU50", "NYU51"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters