Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / time_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'time function' do
4   describe 'success' do
5     pp1 = <<-DOC
6       $o = time()
7       notice(inline_template('time is <%= @o.inspect %>'))
8     DOC
9     it 'gives the time' do
10       apply_manifest(pp1, :catch_failures => true) do |r|
11         m = r.stdout.match(%r{time is (\d+)\D})
12         # When I wrote this test
13         expect(Integer(m[1])).to be > 1_398_894_170
14       end
15     end
16
17     pp2 = <<-DOC
18       $o = time('UTC')
19       notice(inline_template('time is <%= @o.inspect %>'))
20     DOC
21     it 'takes a timezone argument' do
22       apply_manifest(pp2, :catch_failures => true) do |r|
23         m = r.stdout.match(%r{time is (\d+)\D})
24         expect(Integer(m[1])).to be > 1_398_894_170
25       end
26     end
27   end
28   describe 'failure' do
29     it 'handles more arguments'
30     it 'handles invalid timezones'
31   end
32 end