Remove rand.

This commit is contained in:
Ken Barber 2011-07-29 22:08:09 +01:00
parent 284843bd96
commit f9634b7f9b
2 changed files with 0 additions and 39 deletions

View file

@ -1,18 +0,0 @@
#
# rand.rb
#
module Puppet::Parser::Functions
newfunction(:rand, :type => :rvalue, :doc => <<-EOS
EOS
) do |arguments|
if (arguments.size != 0) and (arguments.size != 1) then
raise(Puppet::ParseError, "rand(): Wrong number of arguments "+
"given #{arguments.size} for 0 or 1")
end
end
end
# vim: set ts=2 sw=2 et :

View file

@ -1,21 +0,0 @@
#!/usr/bin/env rspec
require 'spec_helper'
describe "the rand function" do
before :all do
Puppet::Parser::Functions.autoloader.loadall
end
before :each do
@scope = Puppet::Parser::Scope.new
end
it "should exist" do
Puppet::Parser::Functions.function("rand").should == "function_rand"
end
it "should raise a ParseError if there is not 0 or 1 arguments" do
lambda { @scope.function_rand(['a','b']) }.should( raise_error(Puppet::ParseError))
end
end