Implement `log_separator' action keyword
This commit is contained in:
parent
85e5abac8d
commit
92dedd16e7
9
features/actions/log_separator.feature
Normal file
9
features/actions/log_separator.feature
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
Feature: `log_separator' action keyword
|
||||||
|
|
||||||
|
Scenario: logs a separator
|
||||||
|
Given uhwm is running with this run control file:
|
||||||
|
"""
|
||||||
|
key(:f) { log_separator }
|
||||||
|
"""
|
||||||
|
When I press the alt+f keys
|
||||||
|
Then the output must contain "- - - - - - - - - - - - - - - - - - - - - - -"
|
@ -38,6 +38,10 @@ module Uh
|
|||||||
Process.waitpid pid
|
Process.waitpid pid
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def log_separator
|
||||||
|
log '- ' * 24
|
||||||
|
end
|
||||||
|
|
||||||
def method_missing(m, *args, &block)
|
def method_missing(m, *args, &block)
|
||||||
if respond_to? m
|
if respond_to? m
|
||||||
meth = layout_method m
|
meth = layout_method m
|
||||||
|
@ -24,6 +24,13 @@ module Uh
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#log_separator' do
|
||||||
|
it 'logs a separator' do
|
||||||
|
expect(env).to receive(:log).with /(?:- ){20,}/
|
||||||
|
actions.log_separator
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe '#layout_*' do
|
describe '#layout_*' do
|
||||||
it 'delegates messages to the layout with handle_ prefix' do
|
it 'delegates messages to the layout with handle_ prefix' do
|
||||||
expect(env.layout).to receive :handle_screen_sel
|
expect(env.layout).to receive :handle_screen_sel
|
||||||
|
Loading…
x
Reference in New Issue
Block a user