Skip to content

Commit d64f08e

Browse files
committed
Fix WindowMatcher and it's testfor app_class
1 parent 3a7703f commit d64f08e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/rbindkeys/window_matcher.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ class WindowMatcher
99
attr_reader :app_name, :title, :app_class
1010

1111
def initialize h
12-
@app_name = (h[:class] or h[:app_name])
13-
@app_class = (h[:app_class])
14-
@title = (h[:title] or h[:name])
12+
@app_name = h[:app_name]
13+
@app_class = h[:app_class] || h[:class]
14+
@title = h[:title] || h[:name]
1515

1616
if @app_name.nil? and @app_class.nil? and @title.nil?
1717
raise ArgumentError, 'expect to be given :class, :app_name,'+

spec/key_event_handler/handle_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@
187187
before do
188188
@window = double ActiveWindowX::Window
189189
allow(@window).to receive(:app_name) { 'qux' }
190+
allow(@window).to receive(:app_class) { 'Qux' }
190191
@resolver2 = double BindResolver
191192
allow(BindResolver).to receive(:new) { @resolver2 }
192193
end

0 commit comments

Comments
 (0)