File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,15 @@ module Service
1313 #
1414 # Environments are key-value maps with lazy value resolution. An environment can inherit from a parent environment, which can provide defaults
1515 class Configuration
16+ def self . build ( root : Dir . pwd , &block )
17+ configuration = self . new
18+
19+ loader = Loader . new ( configuration , root )
20+ loader . instance_eval ( &block )
21+
22+ return configuration
23+ end
24+
1625 def self . load ( paths = ARGV )
1726 configuration = self . new
1827
Original file line number Diff line number Diff line change 66require 'async/service/configuration'
77
88describe Async ::Service ::Configuration do
9+ with '.build' do
10+ it "can create a new configuration" do
11+ configuration = subject . build do
12+ service 'test' do
13+ name 'value'
14+ end
15+ end
16+
17+ expect ( configuration . environments ) . to have_attributes (
18+ size : be == 1
19+ )
20+ end
21+ end
22+
923 with '.for' do
1024 it "can create a new configuration" do
1125 environment = Async ::Service ::Environment . new
You can’t perform that action at this time.
0 commit comments