forked from ontoportal/ontologies_api_ruby_client
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate collection's find method in favor of get
- Loading branch information
Showing
3 changed files
with
39 additions
and
6 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
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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# frozen_string_literal: true | ||
|
||
require_relative '../test_case' | ||
|
||
class OntologyTest < LinkedData::Client::TestCase | ||
def test_find_by_acronym | ||
result = LinkedData::Client::Models::Ontology.find_by_acronym('SNOMEDCT') | ||
refute_empty result | ||
assert_instance_of Array, result | ||
assert_equal 1, result.length | ||
|
||
ont = result.first | ||
assert_instance_of LinkedData::Client::Models::Ontology, ont | ||
assert_equal 'https://data.bioontology.org/ontologies/SNOMEDCT', ont.id | ||
assert_equal 'SNOMEDCT', ont.acronym | ||
end | ||
|
||
def test_find | ||
ont = LinkedData::Client::Models::Ontology.find('SNOMEDCT') | ||
refute_nil ont | ||
assert_instance_of LinkedData::Client::Models::Ontology, ont | ||
assert_equal 'https://data.bioontology.org/ontologies/SNOMEDCT', ont.id | ||
assert_equal 'SNOMEDCT', ont.acronym | ||
|
||
ont = LinkedData::Client::Models::Ontology.find('BiositemapIM') | ||
refute_nil ont | ||
assert_instance_of LinkedData::Client::Models::Ontology, ont | ||
assert_equal 'https://data.bioontology.org/ontologies/BiositemapIM', ont.id | ||
assert_equal 'BiositemapIM', ont.acronym | ||
end | ||
end |