source: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/time_spec.rb@ 30960

Last change on this file since 30960 was 30960, checked in by davidb, 8 years ago

Switch to using Puppet to provision machine. Strongly based on files developed for spark-hdfs cluster

  • Property svn:executable set to *
File size: 948 bytes
Line 
1#! /usr/bin/env ruby -S rspec
2require 'spec_helper_acceptance'
3
4describe 'time function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
5 describe 'success' do
6 it 'gives the time' do
7 pp = <<-EOS
8 $o = time()
9 notice(inline_template('time is <%= @o.inspect %>'))
10 EOS
11
12 apply_manifest(pp, :catch_failures => true) do |r|
13 m = r.stdout.match(/time is (\d+)\D/)
14
15 # When I wrote this test
16 expect(Integer(m[1])).to be > 1398894170
17 end
18 end
19 it 'takes a timezone argument' do
20 pp = <<-EOS
21 $o = time('UTC')
22 notice(inline_template('time is <%= @o.inspect %>'))
23 EOS
24
25 apply_manifest(pp, :catch_failures => true) do |r|
26 m = r.stdout.match(/time is (\d+)\D/)
27
28 expect(Integer(m[1])).to be > 1398894170
29 end
30 end
31 end
32 describe 'failure' do
33 it 'handles more arguments'
34 it 'handles invalid timezones'
35 end
36end
Note: See TracBrowser for help on using the repository browser.