source: src/puppetcode/environments/gnuboat/modules/stdlib/spec/acceptance/bool2num_spec.rb@ 92a28c4

0.5 debian/bullseye debian/jessie
Last change on this file since 92a28c4 was 92a28c4, checked in by Joachim Langenbach <joachim.langenbach@…>, 9 years ago

Fixed file permissions in stdlib puppet module

  • Property mode set to 100644
File size: 877 bytes
Line 
1#! /usr/bin/env ruby -S rspec
2require 'spec_helper_acceptance'
3
4describe 'bool2num function' 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.