Allow worker configuration with run control file
This commit is contained in:
parent
9ea43ee69a
commit
5ab463cde5
9
features/run_control/worker.feature
Normal file
9
features/run_control/worker.feature
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
Feature: `worker' run control keyword
|
||||||
|
|
||||||
|
Scenario: configures the modifier key
|
||||||
|
Given a run control file with:
|
||||||
|
"""
|
||||||
|
worker :mux
|
||||||
|
"""
|
||||||
|
And I start uhwm
|
||||||
|
Then the output must match /work.+event.+mux/i
|
@ -32,6 +32,10 @@ module Uh
|
|||||||
@env.keybinds[translate_keysym keysym] = block
|
@env.keybinds[translate_keysym keysym] = block
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def worker type, **options
|
||||||
|
@env.worker = [type, options]
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
@ -80,6 +80,18 @@ module Uh
|
|||||||
expect(env.keybinds.keys).to include %i[f shift]
|
expect(env.keybinds.keys).to include %i[f shift]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe '#worker' do
|
||||||
|
it 'sets the worker type in the env' do
|
||||||
|
rc.worker :some_worker
|
||||||
|
expect(env.worker[0]).to eq :some_worker
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'sets the worker options in the env' do
|
||||||
|
rc.worker :some_worker, some: :option
|
||||||
|
expect(env.worker[1]).to eq({ some: :option })
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user