2013-02-12 16:07:18 +01:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2015-06-01 13:21:59 +02:00
|
|
|
describe 'concat' do
|
|
|
|
it { is_expected.not_to eq(nil) }
|
|
|
|
it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
|
|
|
|
it { is_expected.to run.with_params([1]).and_raise_error(Puppet::ParseError) }
|
|
|
|
it { is_expected.to run.with_params(1, [2]).and_raise_error(Puppet::ParseError) }
|
|
|
|
it { is_expected.to run.with_params([1], [2], [3]).and_return([1, 2, 3]) }
|
|
|
|
it { is_expected.to run.with_params(['1','2','3'],['4','5','6']).and_return(['1','2','3','4','5','6']) }
|
|
|
|
it { is_expected.to run.with_params(['1','2','3'],'4').and_return(['1','2','3','4']) }
|
|
|
|
it { is_expected.to run.with_params(['1','2','3'],[['4','5'],'6']).and_return(['1','2','3',['4','5'],'6']) }
|
|
|
|
it { is_expected.to run.with_params(['1','2'],['3','4'],['5','6']).and_return(['1','2','3','4','5','6']) }
|
|
|
|
it { is_expected.to run.with_params(['1','2'],'3','4',['5','6']).and_return(['1','2','3','4','5','6']) }
|
2014-02-21 15:32:32 +01:00
|
|
|
|
2013-11-20 05:11:08 +01:00
|
|
|
it "should leave the original array intact" do
|
2015-06-01 13:21:59 +02:00
|
|
|
argument1 = ['1','2','3']
|
|
|
|
original1 = argument1.dup
|
|
|
|
argument2 = ['4','5','6']
|
|
|
|
original2 = argument2.dup
|
|
|
|
result = subject.call([argument1,argument2])
|
|
|
|
expect(argument1).to eq(original1)
|
|
|
|
expect(argument2).to eq(original2)
|
2014-12-04 15:12:55 +01:00
|
|
|
end
|
2013-02-12 16:07:18 +01:00
|
|
|
end
|