зеркало из https://github.com/github/ruby.git
[ruby/rdoc] test: Add tests for RDoc::TokenStream#add_tokens, add_token ,collect_tokens and pop_token
https://github.com/ruby/rdoc/commit/9ed530b8f9
This commit is contained in:
Родитель
c388784943
Коммит
193ebc3c3a
|
@ -39,6 +39,42 @@ class TestRDocTokenStream < RDoc::TestCase
|
|||
assert_equal '', RDoc::TokenStream.to_html([])
|
||||
end
|
||||
|
||||
def test_add_tokens
|
||||
foo = Class.new do
|
||||
include RDoc::TokenStream
|
||||
end.new
|
||||
foo.collect_tokens
|
||||
foo.add_tokens([:token])
|
||||
assert_equal [:token], foo.token_stream
|
||||
end
|
||||
|
||||
def test_add_token
|
||||
foo = Class.new do
|
||||
include RDoc::TokenStream
|
||||
end.new
|
||||
foo.collect_tokens
|
||||
foo.add_token(:token)
|
||||
assert_equal [:token], foo.token_stream
|
||||
end
|
||||
|
||||
def test_collect_tokens
|
||||
foo = Class.new do
|
||||
include RDoc::TokenStream
|
||||
end.new
|
||||
foo.collect_tokens
|
||||
assert_equal [], foo.token_stream
|
||||
end
|
||||
|
||||
def test_pop_token
|
||||
foo = Class.new do
|
||||
include RDoc::TokenStream
|
||||
end.new
|
||||
foo.collect_tokens
|
||||
foo.add_token(:token)
|
||||
foo.pop_token
|
||||
assert_equal [], foo.token_stream
|
||||
end
|
||||
|
||||
def test_token_stream
|
||||
foo = Class.new do
|
||||
include RDoc::TokenStream
|
||||
|
|
Загрузка…
Ссылка в новой задаче