1 #! /usr/bin/env ruby -S rspec
4 describe "the time function" do
5 let(:scope) { PuppetlabsSpec::PuppetInternals.scope }
8 expect(Puppet::Parser::Functions.function("time")).to eq("function_time")
11 it "should raise a ParseError if there is more than 2 arguments" do
12 expect { scope.function_time(['','']) }.to( raise_error(Puppet::ParseError))
15 it "should return a number" do
16 result = scope.function_time([])
17 expect(result).to be_an(Integer)
20 it "should be higher then when I wrote this test" do
21 result = scope.function_time([])
22 expect(result).to(be > 1311953157)
25 it "should be lower then 1.5 trillion" do
26 result = scope.function_time([])
27 expect(result).to(be < 1500000000)