source: other-projects/hathitrust/vagrant-hadoop-cluster/trunk/modules/stdlib/spec/acceptance/validate_re_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.2 KB
Line 
1#! /usr/bin/env ruby -S rspec
2require 'spec_helper_acceptance'
3
4describe 'validate_re function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
5 describe 'success' do
6 it 'validates a string' do
7 pp = <<-EOS
8 $one = 'one'
9 $two = '^one$'
10 validate_re($one,$two)
11 EOS
12
13 apply_manifest(pp, :catch_failures => true)
14 end
15 it 'validates an array' do
16 pp = <<-EOS
17 $one = 'one'
18 $two = ['^one$', '^two']
19 validate_re($one,$two)
20 EOS
21
22 apply_manifest(pp, :catch_failures => true)
23 end
24 it 'validates a failed array' do
25 pp = <<-EOS
26 $one = 'one'
27 $two = ['^two$', '^three']
28 validate_re($one,$two)
29 EOS
30
31 apply_manifest(pp, :expect_failures => true)
32 end
33 it 'validates a failed array with a custom error message' do
34 pp = <<-EOS
35 $one = '3.4.3'
36 $two = '^2.7'
37 validate_re($one,$two,"The $puppetversion fact does not match 2.7")
38 EOS
39
40 expect(apply_manifest(pp, :expect_failures => true).stderr).to match(/does not match/)
41 end
42 end
43 describe 'failure' do
44 it 'handles improper number of arguments'
45 it 'handles improper argument types'
46 end
47end
Note: See TracBrowser for help on using the repository browser.