File: relationship__before_spec.rb

package info (click to toggle)
ruby-rspec-puppet 2.9.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,416 kB
  • sloc: ruby: 6,661; makefile: 6
file content (43 lines) | stat: -rw-r--r-- 2,384 bytes parent folder | download | duplicates (2)
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
43
require 'spec_helper'

describe 'relationships::before' do
  let(:facts) { {:operatingsystem => 'debian'} }
  it { should contain_notify('foo').that_comes_before('Notify[bar]') }
  it { should contain_notify('foo').that_comes_before('Notify[baz]') }
  it { should contain_notify('bar').that_comes_before('Notify[baz]') }

  it { should contain_notify('bar').that_requires('Notify[foo]') }
  it { should contain_notify('baz').that_requires('Notify[foo]') }
  it { should contain_notify('baz').that_requires('Notify[bar]') }

  it { should contain_notify('foo').that_comes_before(['Notify[bar]','Notify[baz]']) }
  it { should contain_notify('bar').that_comes_before(['Notify[baz]']) }

  it { should contain_notify('bar').that_requires(['Notify[foo]']) }
  it { should contain_notify('baz').that_requires(['Notify[foo]','Notify[bar]']) }

  it { should contain_class('relationships::before::pre').that_comes_before('Class[relationships::before::post]') }
  it { should contain_class('relationships::before::post').that_requires('Class[relationships::before::pre]') }

  it { should contain_notify('pre').that_comes_before(['Notify[post]']) }
  it { should contain_notify('post').that_requires(['Notify[pre]']) }

  it { should contain_file('/tmp/foo').that_comes_before(['File[/tmp/foo/bar]']) }
  it { should contain_file('/tmp/foo/bar').that_requires(['File[/tmp/foo]']) }

  it { should contain_notify('bazz').that_comes_before(['File[/tmp/foo/bar]']) }
  it { should contain_notify('qux').that_requires(['File[/tmp/foo]']) }
  it { should contain_notify('bazz').that_comes_before(['Notify[qux]']) }
  it { should contain_notify('qux').that_requires(['Notify[bazz]']) }

  it { should_not contain_notify('foo').that_comes_before('Notify[unknown]') }
  it { should_not contain_notify('bar').that_comes_before('Notify[unknown]') }
  it { should_not contain_notify('baz').that_comes_before('Notify[unknown]') }

  it { should_not contain_notify('foo').that_requires('Notify[unknown]') }
  it { should_not contain_notify('bar').that_requires('Notify[unknown]') }
  it { should_not contain_notify('baz').that_requires('Notify[unknown]') }

  it { should_not contain_class('relationships::before::pre').that_comes_before('Class[relationships::before::unknown]') }
  it { should_not contain_class('relationships::before::post').that_requires('Class[relationships::before::unknown]') }
end