Sha256: 58d4fa96b6f9e4b37d0ac1512ab039a617600784a837fc10bf4a2e0884ac77e6
Contents?: true
Size: 1.42 KB
Versions: 24
Compression:
Stored size: 1.42 KB
Contents
require 'spec_helper' describe SimpleDeploy::Misc::AttributeMerger do include_context 'stubbed config' before do @mapper_mock = mock 'mapper' @stacks = ['stack1', 'stack2'] @options = { :environment => 'default', :attributes => [ { 'attrib1' => 'val1' } ], :input_stacks => @stacks, :template => '/tmp/file.json' } SimpleDeploy::Stack::OutputMapper.should_receive(:new). with(:environment => @options[:environment]). and_return @mapper_mock @merger = SimpleDeploy::Misc::AttributeMerger.new end it "should return the consolidated list of attributes" do @mapper_mock.should_receive(:map_outputs_from_stacks). with(:stacks => @options[:input_stacks], :template => @options[:template]). and_return [ { 'attrib2' => 'val2' } ] @merger.merge(@options).should == [ { 'attrib1' => 'val1' }, { 'attrib2' => 'val2' } ] end it "should return provided attributes over outputs" do @mapper_mock.should_receive(:map_outputs_from_stacks). with(:stacks => @options[:input_stacks], :template => @options[:template]). and_return [ { 'attrib1' => 'val2' } ] @merger.merge(@options).should == [ { 'attrib1' => 'val1' } ] end end
Version data entries
24 entries across 24 versions & 1 rubygems