Cross Reference:
xref
: /
ontohub
/
test
/
unit
/
language_population_test.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
language_population_test.rb revision 08f68f06aa74dfc9ee458eccf4ac0c86e8d91eeb
1516
N/A
require
'test_helper'
39
N/A
39
N/A
# Tests a triple store
39
N/A
#
39
N/A
# Author: Daniel Couto Vale <danielvale@uni-bremen.de>
39
N/A
#
39
N/A
class
TripleStoreTest
<
ActiveSupport
::
TestCase
39
N/A
39
N/A
# The triple store
39
N/A
@
store
39
N/A
39
N/A
context
'Empty Triple List:'
do
39
N/A
setup
do
39
N/A
@
store
=
TripleStore.new
[]
39
N/A
@
languageReader
=
LanguagePopulation.new
@
store
;
39
N/A
end
39
N/A
39
N/A
should
"make empty list"
do
39
N/A
assert_equal
[], @
languageReader.list
39
N/A
end
39
N/A
end
926
N/A
926
N/A
context
'File Load:'
do
3158
N/A
setup
do
926
N/A
type
=
'
http://www.w3.org/1999/02/22-rdf-syntax-ns
#type'
39
N/A
label
=
'
http://www.w3.org/2000/01/rdf-schema
#label'
2453
N/A
comment
=
'
http://www.w3.org/2000/01/rdf-schema
#comment'
342
N/A
defined
=
'
http://www.w3.org/2000/01/rdf-schema
#isDefinedBy'
3041
N/A
languageType
=
'
http://purl.net/dol/1.0/rdf
#OntologyLanguage'
1516
N/A
language
=
'
http://ontohub.org/CommonLanguage
'
1636
N/A
@
store
=
TripleStore.new
[
3041
N/A
[
language
,
type
,
languageType
],
1386
N/A
[
language
,
label
,
'Common Language'
],
2910
N/A
[
language
,
comment
,
'A language with all operators'
],
2639
N/A
[
language
,
defined
,
'
http://ontohub.org/CommonLanguage.rdf
'
]
39
N/A
]
51
N/A
@
languageReader
=
LanguagePopulation.new
@
store
2073
N/A
end
2910
N/A
3110
N/A
should
"make one-element list"
do
2144
N/A
list
= @
languageReader.list
;
1066
N/A
assert_equal
1
,
list.length
1231
N/A
language
=
list
[
0
]
2453
N/A
assert_equal
'
http://ontohub.org/CommonLanguage
'
,
language.iri
1352
N/A
assert_equal
'Common Language'
,
language.name
1890
N/A
assert_equal
'A language with all operators'
,
language.description
296
N/A
assert_equal
'
http://ontohub.org/CommonLanguage.rdf
'
,
language.defined
_by
2876
N/A
end
39
N/A
end
3041
N/A
3041
N/A
end
3041
N/A