<commit_before>require 'spec_helper'

describe 'ironic::policy' do

  shared_examples_for 'ironic policies' do
    let :params do
      {
        :policy_path => '/etc/ironic/policy.json',
        :policies    => {
          'context_is_admin' => {
            'key'   => 'context_is_admin',
            'value' => 'foo:bar'
          }
        }
      }
    end

    it 'set up the policies' do
      is_expected.to contain_openstacklib__policy__base('context_is_admin').with({
        :key   => 'context_is_admin',
        :value => 'foo:bar'
      })
      is_expected.to contain_ironic_config('oslo_policy/policy_file').with_value('/etc/ironic/policy.json')
    end
  end

  on_supported_os({
    :supported_os   => OSDefaults.get_supported_os
  }).each do |os,facts|
    context "on #{os}" do
      let (:facts) do
        facts.merge!(OSDefaults.get_facts())
      end

      it_behaves_like 'ironic policies'
    end
  end

end
<commit_msg>oslo policy: check puppet resource instead of actual config in spec<commit_after>require 'spec_helper'

describe 'ironic::policy' do

  shared_examples_for 'ironic policies' do
    let :params do
      {
        :policy_path => '/etc/ironic/policy.json',
        :policies    => {
          'context_is_admin' => {
            'key'   => 'context_is_admin',
            'value' => 'foo:bar'
          }
        }
      }
    end

    it 'set up the policies' do
      is_expected.to contain_openstacklib__policy__base('context_is_admin').with({
        :key   => 'context_is_admin',
        :value => 'foo:bar'
      })
      is_expected.to contain_oslo__policy('ironic_config').with(
        :policy_file => '/etc/ironic/policy.json',
      )
    end
  end

  on_supported_os({
    :supported_os   => OSDefaults.get_supported_os
  }).each do |os,facts|
    context "on #{os}" do
      let (:facts) do
        facts.merge!(OSDefaults.get_facts())
      end

      it_behaves_like 'ironic policies'
    end
  end

end

{'fraction_non_alphanumeric': 0.12118126272912423, 'fraction_numerical': 0.0, 'mean_word_length': 2.308080808080808, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 20, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5376523', 'n_tokens_mistral': 667, 'n_tokens_neox': 647, 'n_words': 128}