source: other-projects/hathitrust/vagrant-hadoop-cluster/trunk/modules/stdlib/spec/acceptance/is_array_spec.rb@ 30903

Last change on this file since 30903 was 30903, checked in by davidb, 7 years ago

Vagrant provisioning files for a 4-node Hadoop cluster. See README.txt for more details

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#! /usr/bin/env ruby -S rspec
2require 'spec_helper_acceptance'
3
4describe 'is_array function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
5 describe 'success' do
6 it 'is_arrays arrays' do
7 pp = <<-EOS
8 $a = ['aaa','bbb','ccc']
9 $b = true
10 $o = is_array($a)
11 if $o == $b {
12 notify { 'output correct': }
13 }
14 EOS
15
16 apply_manifest(pp, :catch_failures => true) do |r|
17 expect(r.stdout).to match(/Notice: output correct/)
18 end
19 end
20 it 'is_arrays empty arrays' do
21 pp = <<-EOS
22 $a = []
23 $b = true
24 $o = is_array($a)
25 if $o == $b {
26 notify { 'output correct': }
27 }
28 EOS
29
30 apply_manifest(pp, :catch_failures => true) do |r|
31 expect(r.stdout).to match(/Notice: output correct/)
32 end
33 end
34 it 'is_arrays strings' do
35 pp = <<-EOS
36 $a = "aoeu"
37 $b = false
38 $o = is_array($a)
39 if $o == $b {
40 notify { 'output correct': }
41 }
42 EOS
43
44 apply_manifest(pp, :catch_failures => true) do |r|
45 expect(r.stdout).to match(/Notice: output correct/)
46 end
47 end
48 it 'is_arrays hashes' do
49 pp = <<-EOS
50 $a = {'aaa'=>'bbb'}
51 $b = false
52 $o = is_array($a)
53 if $o == $b {
54 notify { 'output correct': }
55 }
56 EOS
57
58 apply_manifest(pp, :catch_failures => true) do |r|
59 expect(r.stdout).to match(/Notice: output correct/)
60 end
61 end
62 end
63 describe 'failure' do
64 it 'handles improper argument counts'
65 it 'handles non-arrays'
66 end
67end
Note: See TracBrowser for help on using the repository browser.