summaryrefslogtreecommitdiffstats
path: root/spec/integration/parser/functions_spec.rb
blob: cbfb4ac8836520b6894d0575fd29b9b33cb2db81 (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 File.dirname(__FILE__) + '/../../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