cfhighlander 0.8.1.alpha.1550744133 → 0.8.1.alpha.1550752854

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ccc4ffea77c8c6df1a0470b4abbe90301c6e9dc4135c4dba47cfc8d04180a262
4
- data.tar.gz: 53b28fe8a437c6942bcc88995090efa8482751766be88aa6691c04b701bf6947
3
+ metadata.gz: 9abae95557c0b289f913b611ab307b8368ba1f42be75c1c9d97e97d6fb2cf1d5
4
+ data.tar.gz: 4bc02802a7f83175f165bd6d77fff16986864a94afdbea65ce2f79244e5c33e9
5
5
  SHA512:
6
- metadata.gz: 3c86cd26b001318aa36732c04b5214c81cf5cbeda2d6da52ed9010a702d964612f4b8edeaf67eec44e17d5ff4d812bb61e0c1366243e83bee921394d3339cda2
7
- data.tar.gz: 49391895bb907f1d8021dee707bd6e0e713d8f78637ca01e176a3a860c29827fcc4f55d26d9c9d2ec4a67f0544ea91ec3ebbf4a46b0fb1b0caded30f935487c8
6
+ metadata.gz: 9d68344d7af75908c23858ec2450c5d5c0c8c9e74bb76a9b0cbac297bd31772fc9fef8c4ea9ca57b98b6ac75cabc24297ca8a5e64b5428d91e86eb9295bc1bef
7
+ data.tar.gz: 554f5bd99753787cdddb64b73e5926a8082dec175d0c1e746428576c25197bfe6fefea2da7d2cfcddb1f702b88ca75732931a2ea850ea7562ff53d4449c648bc
@@ -1,5 +1,6 @@
1
1
  require 'yaml'
2
2
  require 'json'
3
+ require 'util/hash.util'
3
4
 
4
5
  module CfHighlander
5
6
  class Tests
@@ -27,16 +28,10 @@ module CfHighlander
27
28
  def get_cases
28
29
  @test_files.each do |file|
29
30
  test_case = load_test_case(file)
30
- default_config = load_defaut_config()
31
- test_config = merge_recursively(test_case,default_config)
32
- @cases << { metadata: test_case['test_metadata'], file: file, config: test_config }
31
+ @cases << { metadata: test_case['test_metadata'], file: file, config: test_case.deep_merge(load_defaut_config) }
33
32
  end
34
33
  end
35
34
 
36
- def merge_recursively(a, b)
37
- a.merge(b) {|key, a_item, b_item| merge_recursively(a_item, b_item) }
38
- end
39
-
40
35
  def load_defaut_config()
41
36
  begin
42
37
  YAML.load(File.read("#{@component_name}.config.yaml"))
@@ -0,0 +1,6 @@
1
+ class ::Hash
2
+ def deep_merge(second)
3
+ merger = proc {|key, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : Array === v1 && Array === v2 ? v1 | v2 : [:undefined, nil, :nil].include?(v2) ? v1 : v2}
4
+ self.merge(second.to_h, &merger)
5
+ end
6
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfhighlander
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1.alpha.1550744133
4
+ version: 0.8.1.alpha.1550752854
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nikola Tosic
@@ -278,6 +278,7 @@ files:
278
278
  - lib/cfhighlander.version.rb
279
279
  - lib/util/cloudformation.util.rb
280
280
  - lib/util/debug.util.rb
281
+ - lib/util/hash.util.rb
281
282
  - lib/util/zip.util.rb
282
283
  - templates/cfndsl.component.template.erb
283
284
  homepage: https://github.com/theonestack/cfhighlander/blob/master/README.md