Translate common key names in `key' RC keyword

This commit is contained in:
Thibault Jouan
2015-04-14 22:14:10 +00:00
parent f53ad53806
commit 56197c85f8
3 changed files with 31 additions and 3 deletions

View File

@@ -52,15 +52,20 @@ module Uh
describe '#key' do
let(:code) { -> { :keybind_code } }
before { rc.key :f, &code }
it 'registers a key binding in the env' do
rc.key :f, &code
expect(env.keybinds.keys).to include :f
end
it 'registers given block with the key binding' do
rc.key :f, &code
expect(env.keybinds[:f].call).to eq :keybind_code
end
it 'translates common key names to equivalent X keysym' do
rc.key :enter, &code
expect(env.keybinds.keys).to include :Return
end
end
end
end