1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 describe 'bool2num function' do
6 ['false', 'f', '0', 'n', 'no'].each do |bool|
7 it "should convert a given boolean, #{bool}, to 0" do
10 $output = bool2num($input)
14 apply_manifest(pp, :catch_failures => true) do |r|
15 expect(r.stdout).to match(/Notice: 0/)
20 ['true', 't', '1', 'y', 'yes'].each do |bool|
21 it "should convert a given boolean, #{bool}, to 1" do
24 $output = bool2num($input)
28 apply_manifest(pp, :catch_failures => true) do |r|
29 expect(r.stdout).to match(/Notice: 1/)