Cross Reference:
xref
: /
ontohub
/
test
/
unit
/
axiom_test.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
axiom_test.rb revision 47af79449dbcf7c6cab59225258818277b8bbfda
require
'test_helper'
class
SentenceTest
<
ActiveSupport
::
TestCase
context
'Associations'
do
should
belong_to
:
ontology
should
have_and_belong_to_many
:
entities
end
context
'OntologyInstance'
do
setup
do
@
ontology
=
Factory
:
ontology
end
context
'creating Sentences'
do
setup
do
@
sentence_hash
=
{
'name'
=>
'... (if exists)'
,
'range'
=>
'
Examples
/
Reichel
:40.9'
}
@
ontology.sentences.update
_or_create_from_hash
@
sentence_hash
end
context
'correct attribute'
do
setup
do
@
sentence
= @
ontology.sentences.first
end
%w[
name
range
].
each
do
|
attr
|
should
"be #{attr}"
do
assert_equal
@
sentence_hash
[
attr
],
eval
(
"@sentence.#{attr}"
)
end
end
end
end
end
end