File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -23,9 +23,13 @@ def self.load(paths = ARGV)
2323 return configuration
2424 end
2525
26+ def self . for ( *environments )
27+ self . new ( environments )
28+ end
29+
2630 # Initialize an empty configuration.
27- def initialize
28- @environments = [ ]
31+ def initialize ( environments = [ ] )
32+ @environments = environments
2933 end
3034
3135 attr :environments
Original file line number Diff line number Diff line change 66require 'async/service/configuration'
77
88describe Async ::Service ::Configuration do
9+ with '.for' do
10+ it "can create a new configuration" do
11+ environment = Async ::Service ::Environment . new
12+ configuration = subject . for ( environment )
13+
14+ expect ( configuration . environments ) . to be ( :include? , environment )
15+ end
16+ end
17+
918 with 'sleep service configuration file' do
1019 let ( :configuration_path ) { File . join ( __dir__ , '.configurations' , 'sleep.rb' ) }
1120 let ( :configuration_root ) { File . join ( File . realpath ( __dir__ ) , '.configurations' ) }
You can’t perform that action at this time.
0 commit comments