Quit on `mod1+q' key binding
* Loop our runner until it is "stopped"; * Use the event dispatcher to stop the runner on `mod1+q' key press; * Tell the manager to grab the `q' key.
This commit is contained in:
6
features/actions/quit.feature
Normal file
6
features/actions/quit.feature
Normal file
@@ -0,0 +1,6 @@
|
||||
Feature: quit action
|
||||
|
||||
Scenario: quits on keybing press
|
||||
Given uhwm is running
|
||||
When I press the default quit key binding
|
||||
Then uhwm should terminate successfully
|
@@ -4,6 +4,15 @@ def uhwm_run options = nil
|
||||
@interactive = @process = run command.join ' '
|
||||
end
|
||||
|
||||
def uhwm_run_wait_ready
|
||||
uhwm_run
|
||||
uhwm_wait_output 'Connected to'
|
||||
end
|
||||
|
||||
Given /^uhwm is running$/ do
|
||||
uhwm_run_wait_ready
|
||||
end
|
||||
|
||||
When /^I start uhwm$/ do
|
||||
uhwm_run
|
||||
end
|
||||
@@ -15,3 +24,7 @@ end
|
||||
Then /^the exit status must be (\d+)$/ do |exit_status|
|
||||
assert_exit_status exit_status.to_i
|
||||
end
|
||||
|
||||
Then /^uhwm should terminate successfully$/ do
|
||||
assert_exit_status 0
|
||||
end
|
||||
|
@@ -1,3 +1,11 @@
|
||||
def x_key key
|
||||
fail "cannot simulate X key `#{key}'" unless system "xdotool key #{key}"
|
||||
end
|
||||
|
||||
When /^I press the default quit key binding$/ do
|
||||
x_key 'alt+q'
|
||||
end
|
||||
|
||||
Then /^it must connect to X display$/ do
|
||||
uhwm_wait_output 'Connected to'
|
||||
expect(`sockstat -u`.lines.grep /\s+ruby.+\s+#{@process.pid}/)
|
||||
|
Reference in New Issue
Block a user