X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=3rdparty%2Fmodules%2Fstdlib%2Fspec%2Facceptance%2Ftime_spec.rb;h=b0a456462458d202c5384dfcb55cc40a54323b76;hb=6f656bd4265e3dab13b9af2bf96e9044322e9d8f;hp=cdb296070cbf9df8b82b8bb5f857195b037df31a;hpb=ad88f67c13ae0f1a08936dad643f1e3509ab5f40;p=mirror%2Fdsa-puppet.git diff --git a/3rdparty/modules/stdlib/spec/acceptance/time_spec.rb b/3rdparty/modules/stdlib/spec/acceptance/time_spec.rb old mode 100755 new mode 100644 index cdb296070..b0a456462 --- a/3rdparty/modules/stdlib/spec/acceptance/time_spec.rb +++ b/3rdparty/modules/stdlib/spec/acceptance/time_spec.rb @@ -1,31 +1,27 @@ -#! /usr/bin/env ruby -S rspec require 'spec_helper_acceptance' -describe 'time function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do +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