source: other-projects/hathitrust/vagrant-hadoop-cluster/trunk/modules/stdlib/spec/acceptance/is_function_available_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.7 KB
Line 
1#! /usr/bin/env ruby -S rspec
2require 'spec_helper_acceptance'
3
4describe 'is_function_available function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
5 describe 'success' do
6 it 'is_function_availables arrays' do
7 pp = <<-EOS
8 $a = ['fail','include','require']
9 $o = is_function_available($a)
10 notice(inline_template('is_function_available is <%= @o.inspect %>'))
11 EOS
12
13 apply_manifest(pp, :catch_failures => true) do |r|
14 expect(r.stdout).to match(/is_function_available is false/)
15 end
16 end
17 it 'is_function_availables true' do
18 pp = <<-EOS
19 $a = true
20 $o = is_function_available($a)
21 notice(inline_template('is_function_available is <%= @o.inspect %>'))
22 EOS
23
24 apply_manifest(pp, :catch_failures => true) do |r|
25 expect(r.stdout).to match(/is_function_available is false/)
26 end
27 end
28 it 'is_function_availables strings' do
29 pp = <<-EOS
30 $a = "fail"
31 $b = true
32 $o = is_function_available($a)
33 if $o == $b {
34 notify { 'output correct': }
35 }
36 EOS
37
38 apply_manifest(pp, :catch_failures => true) do |r|
39 expect(r.stdout).to match(/Notice: output correct/)
40 end
41 end
42 it 'is_function_availables function_availables' do
43 pp = <<-EOS
44 $a = "is_function_available"
45 $o = is_function_available($a)
46 notice(inline_template('is_function_available is <%= @o.inspect %>'))
47 EOS
48
49 apply_manifest(pp, :catch_failures => true) do |r|
50 expect(r.stdout).to match(/is_function_available is true/)
51 end
52 end
53 end
54 describe 'failure' do
55 it 'handles improper argument counts'
56 it 'handles non-arrays'
57 end
58end
Note: See TracBrowser for help on using the repository browser.