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:
978 bytes
|
Line | |
---|
1 | #! /usr/bin/env ruby -S rspec
|
---|
2 | require 'spec_helper_acceptance'
|
---|
3 |
|
---|
4 | describe 'validate_hash function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
|
---|
5 | describe 'success' do
|
---|
6 | it 'validates a single argument' do
|
---|
7 | pp = <<-EOS
|
---|
8 | $one = { 'a' => 1 }
|
---|
9 | validate_hash($one)
|
---|
10 | EOS
|
---|
11 |
|
---|
12 | apply_manifest(pp, :catch_failures => true)
|
---|
13 | end
|
---|
14 | it 'validates an multiple arguments' do
|
---|
15 | pp = <<-EOS
|
---|
16 | $one = { 'a' => 1 }
|
---|
17 | $two = { 'b' => 2 }
|
---|
18 | validate_hash($one,$two)
|
---|
19 | EOS
|
---|
20 |
|
---|
21 | apply_manifest(pp, :catch_failures => true)
|
---|
22 | end
|
---|
23 | [
|
---|
24 | %{validate_hash('{ "not" => "hash" }')},
|
---|
25 | %{validate_hash('string')},
|
---|
26 | %{validate_hash(["array"])},
|
---|
27 | %{validate_hash(undef)}
|
---|
28 | ].each do |pp|
|
---|
29 | it "rejects #{pp.inspect}" do
|
---|
30 | expect(apply_manifest(pp, :expect_failures => true).stderr).to match(//)
|
---|
31 | end
|
---|
32 | end
|
---|
33 | end
|
---|
34 | describe 'failure' do
|
---|
35 | it 'handles improper number of arguments'
|
---|
36 | end
|
---|
37 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.