Cross Reference: stub_spec.rb
xref
: /
ontohub
/
spec
/
lib
/
logicgraph_parser
/
stub_spec.rb
Home
History
Annotate
Line#
Navigate
Download
Search
only in
./
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
require
'spec_helper'
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
describe
'LogicgraphParser Stub'
do
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
def
save_language
(
language
)
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
language.user
_id
=
user.id
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
language.save
!
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
end
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
def
save_logic
(
logic
)
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
logic.user
_id
=
user.id
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
logic.save
!
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
end
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
def
save_support
(
support
)
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
support.save
!
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
end
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
def
save_logic_mapping
(
comorphism
)
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
end
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
context
"LogicgraphParser"
do
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
context
'parsing stub'
do
7c7a19761235efff584ee65a1c6dc4aa1735ff64
Eugen Kuksa
let
!
(:
user
)
{
create
:
admin
}
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
it
'should set up without an error'
do
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
expect
do
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
LogicgraphParser.parse
open_fixture
(
'
LogicGraph.xml
'
)
,
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
logic
:
Proc.new
{ |h|
save_logic
(h)
},
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
language
:
Proc.new
{ |h|
save_language
(h)
},
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
support
:
Proc.new
{ |h|
save_support
(h)
},
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
logic_mapping
:
Proc.new
{ |h|
save_logic_mapping
(h)
}
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
end.not
_to
raise_error
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
end
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
end
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
end
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
def
open_fixture
(
name
)
bd5b3ce7cee084159d9beb6b64a5b2892683bff5
Eugen Kuksa
File.open
(
fixture_file
(
name
)
)
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
end
bb3af9fc8fc792fbf1cbd4a101555b47388033a2
Eugen Kuksa
end