File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,10 +21,7 @@ class << self
2121 def config
2222 @_config ||= Alchemy ::Configurations ::Main . new
2323 end
24-
25- def configure ( &blk )
26- yield config
27- end
24+ delegate :configure , to : :config
2825
2926 enable_searchable_deprecation_msg = "Use `Alchemy.config.show_page_searchable_checkbox` instead."
3027 def enable_searchable = config . show_page_searchable_checkbox
Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ def set(configuration_hash)
3939
4040 alias_method :get , :send
4141 alias_method :[] , :get
42+ alias_method :configure , :tap
4243
4344 def show = self
4445
Original file line number Diff line number Diff line change 5050 expect ( configuration . fetch ( "auto_logout_time" , 20 ) ) . to eq ( 40 )
5151 end
5252 end
53+
54+ describe "#configure" do
55+ it "yields self" do
56+ configuration . configure do |conf |
57+ conf . auto_logout_time = 15
58+ end
59+ expect ( configuration . auto_logout_time ) . to eq ( 15 )
60+ end
61+ end
5362 end
5463
5564 context "setting with the wrong type" do
You can’t perform that action at this time.
0 commit comments