Implement verbose mode
This commit is contained in:
@@ -1,7 +1,12 @@
|
||||
def uhwm_wait_output message, timeout: 1
|
||||
Timeout.timeout(timeout) do
|
||||
loop do
|
||||
break if assert_partial_output_interactive message
|
||||
break if case message
|
||||
when Regexp
|
||||
@process.read_stdout =~ message
|
||||
when String
|
||||
assert_partial_output_interactive message
|
||||
end
|
||||
sleep 0.1
|
||||
end
|
||||
end
|
||||
@@ -15,5 +20,10 @@ Usage: uhwm [options]
|
||||
|
||||
options:
|
||||
-h, --help print this message
|
||||
-v, --version enable verbose mode
|
||||
eoh
|
||||
end
|
||||
|
||||
Then /^the current output must match \/([^\/]+)\/([a-z]+)$/ do |pattern, options|
|
||||
uhwm_wait_output Regexp.new(pattern, options)
|
||||
end
|
||||
|
@@ -1,4 +1,4 @@
|
||||
def uhwm_run options = nil
|
||||
def uhwm_run options = '-v'
|
||||
command = %w[uhwm]
|
||||
command << options if options
|
||||
@interactive = @process = run command.join ' '
|
||||
|
Reference in New Issue
Block a user