summaryrefslogtreecommitdiffstats
path: root/spec/unit/parameter/path_spec.rb
blob: 0826265c3716fd7ead4d0456cdf05f1818e4713b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env ruby
require 'spec_helper'

require 'puppet/parameter/path'

[false, true].each do |arrays|
  describe "Puppet::Parameter::Path with arrays #{arrays}" do
    it_should_behave_like "all path parameters", :path, :array => arrays do
      # The new type allows us a test that is guaranteed to go direct to our
      # validation code, without passing through any "real type" overrides or
      # whatever on the way.
      Puppet::newtype(:test_puppet_parameter_path) do
        newparam(:path, :parent => Puppet::Parameter::Path, :arrays => arrays) do
          isnamevar
          accept_arrays arrays
        end
      end

      def instance(path)
        Puppet::Type.type(:test_puppet_parameter_path).new(:path => path)
      end
    end
  end
end