summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorTom Black <[email protected]>2017-06-04 21:11:56 -0400
committerTom Black <[email protected]>2017-06-04 21:11:56 -0400
commit30c0f7ad8923ad1a90071234dcab7d4cc60268d4 (patch)
tree52a57d8e0856c40dd6f758c6b2e8121f5b3887d9 /test
parente87ee92576e6e9a1aec39c77d38a2e14f033c31d (diff)
downloadruby2d-30c0f7ad8923ad1a90071234dcab7d4cc60268d4.tar.gz
ruby2d-30c0f7ad8923ad1a90071234dcab7d4cc60268d4.zip
Test for bad event types
Diffstat (limited to 'test')
-rw-r--r--test/events_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/events_spec.rb b/test/events_spec.rb
index f0e5411..a5fa279 100644
--- a/test/events_spec.rb
+++ b/test/events_spec.rb
@@ -1,6 +1,13 @@
require 'ruby2d'
RSpec.describe Window do
+ describe 'on :bad_event' do
+ it "raises exception if a bad event type is given" do
+ window = Ruby2D::Window.new
+ expect { window.on(:bad_event) }.to raise_error(Ruby2D::Error)
+ end
+ end
+
[:key, :key_down, :key_held, :key_up].each do |key_event_type|
describe "on #{key_event_type}" do
it "allows binding of event" do