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