diff options
Diffstat (limited to 'test/unit')
-rwxr-xr-x | test/unit/plugin.rb | 2 | ||||
-rw-r--r-- | test/unit/word_list.rb | 33 |
2 files changed, 10 insertions, 25 deletions
diff --git a/test/unit/plugin.rb b/test/unit/plugin.rb index ee3e2cc..678b883 100755 --- a/test/unit/plugin.rb +++ b/test/unit/plugin.rb @@ -31,7 +31,7 @@ class PluginScannerTest < Test::Unit::TestCase def test_load_all assert_instance_of Symbol, Plugins.load_all.first assert_operator Plugins.all_plugins.first, :<, Plugins::Plugin - assert_equal 'The Example', Plugins.all_titles.sort.first + assert_equal 'The Example', Plugins.all_plugins.map { |plugin| plugin.title }.sort.first end def test_default diff --git a/test/unit/word_list.rb b/test/unit/word_list.rb index 803e268..2d02d66 100644 --- a/test/unit/word_list.rb +++ b/test/unit/word_list.rb @@ -25,7 +25,7 @@ class WordListTest < Test::Unit::TestCase add(RESERVED_WORDS, :reserved). add(PREDEFINED_TYPES, :predefined_type). add(PREDEFINED_CONSTANTS, :predefined_constant) - + def test_word_list_example assert_equal :predefined_type, IDENT_KIND['void'] # assert_equal :predefined_constant, IDENT_KIND['...'] # not specified @@ -35,38 +35,23 @@ class WordListTest < Test::Unit::TestCase list = WordList.new(:ident).add(['foobar'], :reserved) assert_equal :reserved, list['foobar'] assert_equal :ident, list['FooBar'] + assert_equal 1, list.size end - - def test_word_list_cached - list = WordList.new(:ident, true).add(['foobar'], :reserved) - assert_equal :reserved, list['foobar'] - assert_equal :ident, list['FooBar'] - end - + def test_case_ignoring_word_list list = CaseIgnoringWordList.new(:ident).add(['foobar'], :reserved) assert_equal :ident, list['foo'] assert_equal :reserved, list['foobar'] assert_equal :reserved, list['FooBar'] - + assert_equal 1, list.size + list = CaseIgnoringWordList.new(:ident).add(['FooBar'], :reserved) assert_equal :ident, list['foo'] assert_equal :reserved, list['foobar'] assert_equal :reserved, list['FooBar'] + assert_equal 1, list.size end - - def test_case_ignoring_word_list_cached - list = CaseIgnoringWordList.new(:ident, true).add(['foobar'], :reserved) - assert_equal :ident, list['foo'] - assert_equal :reserved, list['foobar'] - assert_equal :reserved, list['FooBar'] - - list = CaseIgnoringWordList.new(:ident, true).add(['FooBar'], :reserved) - assert_equal :ident, list['foo'] - assert_equal :reserved, list['foobar'] - assert_equal :reserved, list['FooBar'] - end - + def test_dup list = WordList.new(:ident).add(['foobar'], :reserved) assert_equal :reserved, list['foobar'] @@ -75,5 +60,5 @@ class WordListTest < Test::Unit::TestCase assert_equal :keyword, list2['foobar'] assert_equal :reserved, list['foobar'] end - -end
\ No newline at end of file + +end |