Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shugo committed Jan 16, 2024
1 parent 7e080a1 commit a69ba04
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/textbringer/commands/test_help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

class TestHelp < Textbringer::TestCase
def test_describe_bindings
isearch_mode(true)
describe_bindings
s = Buffer.current.to_s
assert_match(/^<backspace> +\[backward_delete_char\]/, s)
assert_match(/^C-h +\[backward_delete_char\]/, s)
assert_match(/^C-x RET f +\[set_buffer_file_encoding\]/, s)
assert_match(/^C-s +\[isearch_repeat_forward\]/, s)
end

def test_describe_command
Expand All @@ -26,6 +28,20 @@ def test_describe_key
assert_match(/^describe_key\(key\)/, s)
end

def test_describe_class
describe_class("Array")
s = Buffer.current.to_s
assert_match(/^= Array < Object/, s)
assert_match(/^An Array is an ordered, integer-indexed collection of objects/, s)
end

def test_describe_method
describe_method("Array#length")
s = Buffer.current.to_s
assert_match(/^= Array#length/, s)
assert_match(/^Returns the count of elements/, s)
end

def test_help_commands
describe_bindings
re_search_forward(/enlarge_window/)
Expand Down

0 comments on commit a69ba04

Please sign in to comment.