1 require 'spec_helper_acceptance'
3 describe 'concat::fragment order' do
5 @basedir = setup_test_directory
8 describe 'with reverse order, alphabetical' do
11 concat { '#{@basedir}/foo':
14 concat::fragment { '1':
15 target => '#{@basedir}/foo',
19 concat::fragment { '2':
20 target => '#{@basedir}/foo',
24 concat::fragment { '3':
25 target => '#{@basedir}/foo',
32 it 'idempotent, file matches' do
34 expect(file("#{@basedir}/foo")).to be_file
35 expect(file("#{@basedir}/foo").content).to match %r{string3string2string1}
39 describe 'with reverse order, numeric' do
42 concat { '#{@basedir}/foo':
45 concat::fragment { '1':
46 target => '#{@basedir}/foo',
50 concat::fragment { '2':
51 target => '#{@basedir}/foo',
55 concat::fragment { '3':
56 target => '#{@basedir}/foo',
63 it 'idempotent, file matches' do
65 expect(file("#{@basedir}/foo")).to be_file
66 expect(file("#{@basedir}/foo").content).to match %r{string3string2string1}
70 describe 'with normal order' do
73 concat { '#{@basedir}/foo': }
74 concat::fragment { '1':
75 target => '#{@basedir}/foo',
79 concat::fragment { '2':
80 target => '#{@basedir}/foo',
84 concat::fragment { '3':
85 target => '#{@basedir}/foo',
92 it 'idempotent, file matches' do
94 expect(file("#{@basedir}/foo")).to be_file
95 expect(file("#{@basedir}/foo").content).to match %r{string1string2string3}