File: puppet-syntax_spec.rb

package info (click to toggle)
ruby-puppet-syntax 4.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 312 kB
  • sloc: ruby: 672; makefile: 6
file content (38 lines) | stat: -rw-r--r-- 1,375 bytes parent folder | download
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
require 'spec_helper'
require 'puppet-syntax/tasks/puppet-syntax'

known_pp = 'spec/fixtures/test_module/manifests/pass.pp'
known_erb = 'spec/fixtures/test_module/templates/pass.erb'
known_yaml = 'spec/fixtures/hiera/data/hiera_1.yaml'
known_eyaml = 'spec/fixtures/hiera/data/hiera_2.eyaml'
known_yaml_subdir = 'spec/fixtures/hiera/data/test/hiera_3.yaml'
known_eyaml_subdir = 'spec/fixtures/hiera/data/test/hiera_4.eyaml'

describe 'PuppetSyntax rake tasks' do
  it 'filters directories' do
    list = PuppetSyntax::RakeTask.new.filelist(['**/lib', known_pp])
    expect(list.count).to eq 1
    expect(list).to include(known_pp)
  end

  it 'generates FileList of manifests relative to Rakefile' do
    list = PuppetSyntax::RakeTask.new.filelist_manifests
    expect(list).to include(known_pp)
    expect(list.count).to eq 9
  end

  it 'generates FileList of templates relative to Rakefile' do
    list = PuppetSyntax::RakeTask.new.filelist_templates
    expect(list).to include(known_erb)
    expect(list.count).to eq 9
  end

  it 'generates FileList of Hiera yaml files relative to Rakefile' do
    list = PuppetSyntax::RakeTask.new.filelist_hiera_yaml
    expect(list).to include(known_yaml)
    expect(list).to include(known_eyaml)
    expect(list).to include(known_yaml_subdir)
    expect(list).to include(known_eyaml_subdir)
    expect(list.count).to eq 4
  end
end