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
old mode 100755 (executable)
new mode 100644 (file)
index dae1166..b0a4564
@@ -1,31 +1,27 @@
-#! /usr/bin/env ruby -S rspec
 require 'spec_helper_acceptance'
 
 describe 'time function' do
   describe 'success' do
-    it 'gives the time' do
-      pp = <<-EOS
+    pp1 = <<-DOC
       $o = time()
       notice(inline_template('time is <%= @o.inspect %>'))
-      EOS
-
-      apply_manifest(pp, :catch_failures => true) do |r|
-        m = r.stdout.match(/time is (\d+)\D/)
-
+    DOC
+    it 'gives the time' do
+      apply_manifest(pp1, :catch_failures => true) do |r|
+        m = r.stdout.match(%r{time is (\d+)\D})
         # When I wrote this test
-        expect(Integer(m[1])).to be > 1398894170
+        expect(Integer(m[1])).to be > 1_398_894_170
       end
     end
-    it 'takes a timezone argument' do
-      pp = <<-EOS
+
+    pp2 = <<-DOC
       $o = time('UTC')
       notice(inline_template('time is <%= @o.inspect %>'))
-      EOS
-
-      apply_manifest(pp, :catch_failures => true) do |r|
-        m = r.stdout.match(/time is (\d+)\D/)
-
-        expect(Integer(m[1])).to be > 1398894170
+    DOC
+    it 'takes a timezone argument' do
+      apply_manifest(pp2, :catch_failures => true) do |r|
+        m = r.stdout.match(%r{time is (\d+)\D})
+        expect(Integer(m[1])).to be > 1_398_894_170
       end
     end
   end