Sha256: dea569367f13edc177a51c661129dc654a5cf83625cbc7a190da9c3fddbc0fce

Contents?: true

Size: 935 Bytes

Versions: 3

Compression:

Stored size: 935 Bytes

Contents

#!/usr/bin/ruby -w
#
# Unit test for English link grammar
# $Id$
#
# Copyright (c) 2003-2005 The FaerieMUD Consortium.
#

unless defined? Linguistics::TestCase
	testsdir = File::dirname( File::dirname(File::expand_path( __FILE__ )) )
	$LOAD_PATH.unshift testsdir unless $LOAD_PATH.include?( testsdir )

	require 'lingtestcase'
end

### This test case tests the English language link grammar extension of
### Linguistics::EN.
class LinkParserTestCase < Linguistics::TestCase

	Linguistics::use(:en)
	include Linguistics::EN

	### Overridden to skip tests if WordNet isn't installed.
	def run( result )
		return super if Linguistics::EN::has_link_parser?
		yield( STARTED, name )
		result.add_run
		yield( FINISHED, name )
	end


	def test_sentence_should_return_a_parsed_linkparser_sentence
		rval = nil

		assert_nothing_raised do
			rval = "He is a dog.".en.sentence
		end
		
		assert_instance_of LinkParser::Sentence, rval
	end

end

Version data entries

3 entries across 3 versions & 3 rubygems

Version Path
eviltrout-linguistics-1.0.6.1 tests/en/linkparser.tests.rb
markos_linguistics-1.0.8.3 tests/en/linkparser.tests.rb
linguistics-1.0.8 tests/en/linkparser.tests.rb