diff --git a/features/run_control/key.feature b/features/run_control/key.feature index 5731935..ec6408e 100644 --- a/features/run_control/key.feature +++ b/features/run_control/key.feature @@ -1,28 +1,25 @@ Feature: `key' run control keyword Scenario: defines code to run when given key is pressed - Given a run control file with: + Given uhwm is running with this run control file: """ key(:f) { puts 'trigger f key code' } """ - And uhwm is running When I press the alt+f keys Then the output must contain "trigger f key code" Scenario: translates common key names to their X equivalent - Given a run control file with: + Given uhwm is running with this run control file: """ key(:enter) { puts 'trigger return key code' } """ - And uhwm is running When I press the alt+Return keys Then the output must contain "trigger return key code" Scenario: translates upcased key names to combination with shift key - Given a run control file with: + Given uhwm is running with this run control file: """ key(:F) { puts 'trigger shift+f key code' } """ - And uhwm is running When I press the alt+shift+f keys Then the output must contain "trigger shift+f key code" diff --git a/features/steps/run_steps.rb b/features/steps/run_steps.rb index 3470126..5e25604 100644 --- a/features/steps/run_steps.rb +++ b/features/steps/run_steps.rb @@ -6,6 +6,11 @@ Given /^uhwm is running$/ do uhwm_run_wait_ready end +Given /^uhwm is running with this run control file:$/ do |rc| + write_file '.uhwmrc.rb', rc + uhwm_run_wait_ready +end + When /^I start uhwm$/ do uhwm_run end