stub_spec.rb revision bd5b3ce7cee084159d9beb6b64a5b2892683bff5
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksarequire 'spec_helper'
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksadescribe 'LogicgraphParser Stub' do
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa def save_language(language)
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa language.user_id = user.id
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa language.save!
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa end
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa def save_logic(logic)
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa logic.user_id = user.id
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa logic.save!
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa end
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa def save_support(support)
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa support.save!
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa end
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa def save_logic_mapping(comorphism)
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa end
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa context "LogicgraphParser" do
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa context 'parsing stub' do
7c7a19761235efff584ee65a1c6dc4aa1735ff64Eugen Kuksa let!(:user) { create :admin }
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa it 'should set up without an error' do
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa expect do
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa LogicgraphParser.parse open_fixture('LogicGraph.xml'),
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa logic: Proc.new{ |h| save_logic(h) },
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa language: Proc.new{ |h| save_language(h) },
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa support: Proc.new{ |h| save_support(h) },
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa logic_mapping: Proc.new{ |h| save_logic_mapping(h) }
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa end.not_to raise_error
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa end
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa end
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa end
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa def open_fixture(name)
bd5b3ce7cee084159d9beb6b64a5b2892683bff5Eugen Kuksa File.open(fixture_file(name))
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksa end
bb3af9fc8fc792fbf1cbd4a101555b47388033a2Eugen Kuksaend