Allow layout options configuration from run control

This commit is contained in:
Thibault Jouan
2015-04-26 02:49:39 +00:00
parent 70fe9bdb03
commit 7c2712924a
3 changed files with 34 additions and 9 deletions

View File

@@ -4,8 +4,12 @@ Feature: `layout' run control keyword
Given a file named my_layout.rb with:
"""
class MyLayout
def register *_
puts "testing_rc_layout"
def initialize **options
puts "testing_rc_layout_#{options.inspect}" if options.any?
end
def register *_, **options
puts "testing_rc_layout_register"
end
end
"""
@@ -16,7 +20,15 @@ Feature: `layout' run control keyword
layout MyLayout
"""
When I run uhwm with options -r./my_layout
Then the output must contain "testing_rc_layout"
Then the output must contain "testing_rc_layout_register"
Scenario: configures a layout class with options
Given a run control file with:
"""
layout MyLayout, foo: :bar
"""
When I run uhwm with options -r./my_layout
Then the output must contain "testing_rc_layout_{:foo=>:bar}"
Scenario: configures a layout instance
Given a run control file with:
@@ -24,4 +36,4 @@ Feature: `layout' run control keyword
layout MyLayout.new
"""
When I run uhwm with options -r./my_layout
Then the output must contain "testing_rc_layout"
Then the output must contain "testing_rc_layout_register"