puppet-horizon/spec/spec_helper.rb
Mathieu Gagné d63e437bdf Use concat to manage local_settings.py
Manage local_settings.py content with concat::fragment.

This adds the ability for anyone to add custom fragments
to local_settings.py without having to override the template.

Example on how to use concat::fragment:

  concat::fragment { 'local_settings.py:custom':
    target  => $::horizon::params::config_file,
    content => 'HORIZON_CONFIG["customization_module"] = "my_project.overrides"',
    order   => '90'
  }

The use of puppetlabs-concat does not break backward compatibility
for those establishing relationships with the file resource
that used to be local_settings.py. puppetlabs-concat still declares
a file resource matching the concat resource title when
a concat resource is created.

Closes-bug: #1383500
Change-Id: I97e747c967dddc04b62ff1d31440e42a26dcb3ff
2015-02-09 16:50:28 -05:00

13 lines
449 B
Ruby

require 'puppetlabs_spec_helper/module_spec_helper'
require 'shared_examples'
RSpec.configure do |c|
c.alias_it_should_behave_like_to :it_configures, 'configures'
c.alias_it_should_behave_like_to :it_raises, 'raises'
end
def verify_concat_fragment_contents(subject, title, expected_lines)
content = subject.resource('concat::fragment', title).send(:parameters)[:content]
(content.split("\n") & expected_lines).should == expected_lines
end