fedux_org-stdlib 0.9.1 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/fedux_org_stdlib/app_config.rb +4 -0
- data/lib/fedux_org_stdlib/version.rb +1 -1
- data/spec/app_config_spec.rb +36 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3370153c7c20104e20c60b2078a36f7e12e1b976
|
|
4
|
+
data.tar.gz: 6470d7d0ed4329c1a84504ba0eb8adc4bbf57658
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5ca591fdc32795bd8e0cfb27e1dcab2c22221fc28386fd7080df617245aabf1874c2c1e51b6c589b717364aefa8de48a1613eaa259577136392071e40b645cf2
|
|
7
|
+
data.tar.gz: c952c86471ff8c5e26590c8dc6280d585ec58aaec26bbf60a207cb37bbfe5898574d7b129221f3a864d30af8fd06ae12078c43cabaf7100dca9f1c5db081aa1f
|
data/Gemfile.lock
CHANGED
data/spec/app_config_spec.rb
CHANGED
|
@@ -479,4 +479,40 @@ RSpec.describe AppConfig do
|
|
|
479
479
|
expect(config.class.known_options).to eq config.known_options
|
|
480
480
|
end
|
|
481
481
|
end
|
|
482
|
+
|
|
483
|
+
context '#to_yaml' do
|
|
484
|
+
it 'dumps configuration to yaml' do
|
|
485
|
+
config_klass = Class.new(AppConfig) do
|
|
486
|
+
option :opt1, 'test1'
|
|
487
|
+
|
|
488
|
+
option :opt2, [
|
|
489
|
+
'test2',
|
|
490
|
+
'test2',
|
|
491
|
+
]
|
|
492
|
+
|
|
493
|
+
option :opt3, {
|
|
494
|
+
test3: 'value3'
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
def _class_name
|
|
498
|
+
'TestConfig'
|
|
499
|
+
end
|
|
500
|
+
|
|
501
|
+
def _module_name
|
|
502
|
+
'MyApplication'
|
|
503
|
+
end
|
|
504
|
+
end
|
|
505
|
+
|
|
506
|
+
config = config_klass.new
|
|
507
|
+
expect(config.to_yaml).to eq <<-EOS.strip_heredoc
|
|
508
|
+
---
|
|
509
|
+
opt1: test1
|
|
510
|
+
opt2:
|
|
511
|
+
- test2
|
|
512
|
+
- test2
|
|
513
|
+
opt3:
|
|
514
|
+
:test3: value3
|
|
515
|
+
EOS
|
|
516
|
+
end
|
|
517
|
+
end
|
|
482
518
|
end
|