Use test-unit assertions
This commit is contained in:
parent
1c9cb9da8f
commit
41e2ab88c3
Notes:
git
2021-07-30 03:26:28 +09:00
@ -10,31 +10,31 @@ class Reline::Windows
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_matches__with_no_arguments_raises_error
|
def test_matches__with_no_arguments_raises_error
|
||||||
assert_raises(ArgumentError) { @key.matches? }
|
assert_raise(ArgumentError) { @key.matches? }
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_matches_char_code
|
def test_matches_char_code
|
||||||
assert_true @key.matches?(char_code: 0x1)
|
assert @key.matches?(char_code: 0x1)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_matches_virtual_key_code
|
def test_matches_virtual_key_code
|
||||||
assert_true @key.matches?(virtual_key_code: 0x41)
|
assert @key.matches?(virtual_key_code: 0x41)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_matches_control_keys
|
def test_matches_control_keys
|
||||||
assert_true @key.matches?(control_keys: :CTRL)
|
assert @key.matches?(control_keys: :CTRL)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_doesnt_match_alt
|
def test_doesnt_match_alt
|
||||||
assert_false @key.matches?(control_keys: :ALT)
|
refute @key.matches?(control_keys: :ALT)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_doesnt_match_empty_control_key
|
def test_doesnt_match_empty_control_key
|
||||||
assert_false @key.matches?(control_keys: [])
|
refute @key.matches?(control_keys: [])
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_matches_control_keys_and_virtual_key_code
|
def test_matches_control_keys_and_virtual_key_code
|
||||||
assert_true @key.matches?(control_keys: :CTRL, virtual_key_code: 0x41)
|
assert @key.matches?(control_keys: :CTRL, virtual_key_code: 0x41)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user