summaryrefslogtreecommitdiffstats
path: root/spec/integration/parser/functions_spec.rb
blob: 3975761829db155e0b5c4a0bb7cf547e97ca891a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env ruby

require 'spec_helper'

describe Puppet::Parser::Functions do
  before :each do
    Puppet::Parser::Functions.rmfunction("template") if Puppet::Parser::Functions.function("template")
  end

  it "should support multiple threads autoloading the same function" do
    threads = []
    lambda {
      10.times { |a|
        threads << Thread.new {
          Puppet::Parser::Functions.function("template")
        }
      }
    }.should_not raise_error
    threads.each { |t| t.join }
  end
end