summaryrefslogtreecommitdiffstats
path: root/spec/integration/parser/functions_spec.rb
blob: 6791987d7b889c53415d41b0e3d6c8a66026856c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env rspec
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