File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,6 +180,8 @@ def plan_file(*files)
180180 # Add arbitrary configuration attributes to the configuration object.
181181 # Use this to add plan specific configuration options.
182182 def configure ( attribute , value = nil , &block )
183+ attribute , value = attribute . first if attribute . is_a? Hash
184+
183185 Configuration . add_attribute ( attribute )
184186 @config . public_send "#{ attribute } =" , value , &block
185187 end
Original file line number Diff line number Diff line change 3737 end
3838 end
3939 end
40+
41+ context 'DSL' do
42+ let ( :config ) { described_class . new }
43+ let ( :dsl ) { described_class ::DSL . new config , '' }
44+
45+ context '#configure' do
46+ it 'creates a method on the configuration object' do
47+ dsl . configure ( :test )
48+
49+ expect ( config ) . to respond_to ( :test )
50+ end
51+
52+ it 'accepts a hash as the key: value' do
53+ dsl . configure ( test : 'foo' )
54+
55+ expect ( config . test ) . to eq 'foo'
56+ end
57+ end
58+ end
4059end
You can’t perform that action at this time.
0 commit comments