3 describe 'strftime', :if => Puppet::Util::Package.versioncmp(Puppet.version, '4.8.0') < 0 do
5 expect(Puppet::Parser::Functions.function('strftime')).to eq('function_strftime')
8 it 'raises a ParseError if there is less than 1 arguments' do
9 expect { scope.function_strftime([]) }.to(raise_error(Puppet::ParseError))
12 it 'using %s should be higher then when I wrote this test' do
13 result = scope.function_strftime(['%s'])
14 expect(result.to_i).to(be > 1_311_953_157)
17 it 'using %s should be greater than 1.5 trillion' do
18 result = scope.function_strftime(['%s'])
19 expect(result.to_i).to(be > 1_500_000_000)
22 it 'returns a date when given %Y-%m-%d' do
23 result = scope.function_strftime(['%Y-%m-%d'])
24 expect(result).to match(%r{^\d{4}-\d{2}-\d{2}$})