File: kmod_alias_spec.rb

package info (click to toggle)
puppet-module-camptocamp-kmod 2.1.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 288 kB
  • sloc: ruby: 244; makefile: 12; sh: 11
file content (42 lines) | stat: -rw-r--r-- 1,250 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
require 'spec_helper'

describe 'kmod::alias', :type => :define do
  let(:title) { 'foo' }

  on_supported_os.each do |os, facts|
    context "on #{os}" do
      let(:facts) do
        facts.merge( {:augeasversion => '1.2.0'} )
      end

      let(:default_params) do { :source =>'bar', :file => '/baz' } end

      context 'when a file is specified' do
        let(:params) do default_params end
        it { should contain_kmod__alias('foo') }
        it { should contain_kmod__setting('kmod::alias foo') .with({
          'ensure'    => 'present',
          'module'    => 'foo',
          'file'      => '/baz',
          'category'  => 'alias',
          'option'    => 'modulename',
          'value'     => 'bar'
        }) }
      end

      context 'when a file is specified and an aliasname' do
        let(:params) do default_params.merge!({ :aliasname => 'tango' }) end
        it { should contain_kmod__alias('foo') }
        it { should contain_kmod__setting('kmod::alias foo') .with({
          'ensure'    => 'present',
          'module'    => 'tango',
          'file'      => '/baz',
          'category'  => 'alias',
          'option'    => 'modulename',
          'value'     => 'bar'
        }) }
      end

    end
  end
end