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

Last change on this file since 30903 was 30903, checked in by davidb, 8 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.5 KB
Line 
1#! /usr/bin/env ruby -S rspec
2require 'spec_helper_acceptance'
3
4describe 'is_hash function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
5 describe 'success' do
6 it 'is_hashs arrays' do
7 pp = <<-EOS
8 $a = ['aaa','bbb','ccc']
9 $o = is_hash($a)
10 notice(inline_template('is_hash is <%= @o.inspect %>'))
11 EOS
12
13 apply_manifest(pp, :catch_failures => true) do |r|
14 expect(r.stdout).to match(/is_hash is false/)
15 end
16 end
17 it 'is_hashs empty hashs' do
18 pp = <<-EOS
19 $a = {}
20 $b = true
21 $o = is_hash($a)
22 if $o == $b {
23 notify { 'output correct': }
24 }
25 EOS
26
27 apply_manifest(pp, :catch_failures => true) do |r|
28 expect(r.stdout).to match(/Notice: output correct/)
29 end
30 end
31 it 'is_hashs strings' do
32 pp = <<-EOS
33 $a = "aoeu"
34 $b = false
35 $o = is_hash($a)
36 if $o == $b {
37 notify { 'output correct': }
38 }
39 EOS
40
41 apply_manifest(pp, :catch_failures => true) do |r|
42 expect(r.stdout).to match(/Notice: output correct/)
43 end
44 end
45 it 'is_hashs hashes' do
46 pp = <<-EOS
47 $a = {'aaa'=>'bbb'}
48 $b = true
49 $o = is_hash($a)
50 if $o == $b {
51 notify { 'output correct': }
52 }
53 EOS
54
55 apply_manifest(pp, :catch_failures => true) do |r|
56 expect(r.stdout).to match(/Notice: output correct/)
57 end
58 end
59 end
60 describe 'failure' do
61 it 'handles improper argument counts'
62 end
63end
Note: See TracBrowser for help on using the repository browser.