Implement verbose mode
This commit is contained in:
5
features/cli/verbose.feature
Normal file
5
features/cli/verbose.feature
Normal file
@@ -0,0 +1,5 @@
|
||||
Feature: verbose CLI option
|
||||
|
||||
Scenario: raises the logger level to INFO
|
||||
When I run uhwm with option -v
|
||||
Then the current output must match /log.+info.+level/i
|
@@ -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