Fail when another window manager is already running
This commit is contained in:
8
features/manager/check_other_wm.feature
Normal file
8
features/manager/check_other_wm.feature
Normal file
@@ -0,0 +1,8 @@
|
||||
Feature: checking if another window manager is running
|
||||
|
||||
@other_wm_running
|
||||
Scenario: fails when another window manager is running
|
||||
Given another window manager is running
|
||||
When I start uhwm
|
||||
Then the exit status must be 70
|
||||
And the current output must match /error.+other.+window.+manager/i
|
@@ -2,7 +2,7 @@ def uhwm_wait_output message, timeout: 1
|
||||
Timeout.timeout(timeout) do
|
||||
loop do
|
||||
break if case message
|
||||
when Regexp then @process.read_stdout =~ message
|
||||
when Regexp then @process.stdout + @process.stderr =~ message
|
||||
when String then assert_partial_output_interactive message
|
||||
end
|
||||
sleep 0.1
|
||||
@@ -28,6 +28,10 @@ options:
|
||||
eoh
|
||||
end
|
||||
|
||||
Then /^the output must match \/([^\/]+)\/([a-z]*)$/ do |pattern, options|
|
||||
expect(@process.stdout).to match Regexp.new(pattern, options)
|
||||
end
|
||||
|
||||
Then /^the current output must match \/([^\/]+)\/([a-z]*)$/ do |pattern, options|
|
||||
uhwm_wait_output Regexp.new(pattern, options)
|
||||
end
|
||||
|
@@ -9,6 +9,10 @@ def uhwm_run_wait_ready
|
||||
uhwm_wait_output 'Connected to'
|
||||
end
|
||||
|
||||
Given /^another window manager is running$/ do
|
||||
expect(@other_wm).to be_alive
|
||||
end
|
||||
|
||||
Given /^uhwm is running$/ do
|
||||
uhwm_run_wait_ready
|
||||
end
|
||||
|
@@ -14,3 +14,10 @@ Headless.new.start
|
||||
After do |scenario|
|
||||
@process and @process.terminate
|
||||
end
|
||||
|
||||
Around '@other_wm_running' do |scenario, block|
|
||||
@other_wm = ChildProcess.build('twm')
|
||||
@other_wm.start
|
||||
block.call
|
||||
@other_wm.stop
|
||||
end
|
||||
|
Reference in New Issue
Block a user