Sha256: cdefe52a688494f1ffc4f6ee7c9983a861407a85ce4b1c1dffcaac3060225e74
Contents?: true
Size: 1.46 KB
Versions: 1
Compression:
Stored size: 1.46 KB
Contents
require 'test_helper' module Vedeu module API describe Keymap do describe '#key' do it 'raises an exception when a block is not given' do proc { Vedeu.keys do key 'q' end }.must_raise(InvalidSyntax) end it 'raises an exception when a key is not given' do proc { Vedeu.keys do key('') { :some_action } end }.must_raise(InvalidSyntax) end it 'returns the instance of API::Keymap' do Vedeu.keys do key('f') { :some_action } end.must_be_instance_of(API::Keymap) end it 'returns a collection of the keypresses' do Keymap.new.key('v', 'd', 'u') do :some_action end.must_equal(['v', 'd', 'u']) end end describe '#interface' do it 'returns the instance of API::Keymap' do Vedeu.keys do key('d') { :some_action } interface 'neodymium' end.must_be_instance_of(API::Keymap) end it 'returns the instance of API::Keymap' do Vedeu.keys do key('e') { :some_action } interface ['neodymium', 'californium'] end.must_be_instance_of(API::Keymap) end it 'returnsa collection of the interfaces' do Keymap.new.interface('americium').must_equal(['americium']) end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
vedeu-0.2.1 | test/lib/vedeu/api/keymap_test.rb |