lib/rspec/terraform/configuration/providers/in_memory.rb in rspec-terraform-0.1.0.pre.20 vs lib/rspec/terraform/configuration/providers/in_memory.rb in rspec-terraform-0.1.0.pre.21
- old
+ new
@@ -1,31 +1,23 @@
# frozen_string_literal: true
require 'ruby_terraform'
+require_relative '../merger'
module RSpec
module Terraform
module Configuration
module Providers
class InMemory
attr_reader(:configuration)
def initialize(configuration = {})
@configuration = configuration
+ @merger = Merger.new
end
def resolve(overrides = {})
- left_vars = configuration[:vars] || {}
- right_vars = overrides[:vars] || {}
- vars = left_vars.merge(right_vars)
-
- top_level_merge = configuration.merge(overrides)
-
- if left_vars == {} && right_vars == {}
- top_level_merge
- else
- top_level_merge.merge(vars: vars)
- end
+ @merger.merge(configuration, overrides)
end
end
end
end
end