source: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/bool2num_spec.rb@ 30960

Last change on this file since 30960 was 30960, checked in by davidb, 8 years ago

Switch to using Puppet to provision machine. Strongly based on files developed for spark-hdfs cluster

  • Property svn:executable set to *
File size: 945 bytes
Line 
1#! /usr/bin/env ruby -S rspec
2require 'spec_helper_acceptance'
3
4describe 'bool2num function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
5 describe 'success' do
6 ['false', 'f', '0', 'n', 'no'].each do |bool|
7 it "should convert a given boolean, #{bool}, to 0" do
8 pp = <<-EOS
9 $input = "#{bool}"
10 $output = bool2num($input)
11 notify { "$output": }
12 EOS
13
14 apply_manifest(pp, :catch_failures => true) do |r|
15 expect(r.stdout).to match(/Notice: 0/)
16 end
17 end
18 end
19
20 ['true', 't', '1', 'y', 'yes'].each do |bool|
21 it "should convert a given boolean, #{bool}, to 1" do
22 pp = <<-EOS
23 $input = "#{bool}"
24 $output = bool2num($input)
25 notify { "$output": }
26 EOS
27
28 apply_manifest(pp, :catch_failures => true) do |r|
29 expect(r.stdout).to match(/Notice: 1/)
30 end
31 end
32 end
33 end
34end
Note: See TracBrowser for help on using the repository browser.