1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 describe 'is_string function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
6 it 'is_strings arrays' do
8 $a = ['aaa.com','bbb','ccc']
12 notify { 'output correct': }
16 apply_manifest(pp, :catch_failures => true) do |r|
17 expect(r.stdout).to match(/Notice: output correct/)
20 it 'is_strings true' do
26 notify { 'output correct': }
30 apply_manifest(pp, :catch_failures => true) do |r|
31 expect(r.stdout).to match(/Notice: output correct/)
34 it 'is_strings strings' do
38 notice(inline_template('is_string is <%= @o.inspect %>'))
41 apply_manifest(pp, :catch_failures => true) do |r|
42 expect(r.stdout).to match(/is_string is true/)
45 it 'is_strings number strings' do
49 notice(inline_template('is_string is <%= @o.inspect %>'))
52 apply_manifest(pp, :catch_failures => true) do |r|
53 expect(r.stdout).to match(/is_string is false/)
56 it 'is_strings floats' do
62 notify { 'output correct': }
66 apply_manifest(pp, :catch_failures => true) do |r|
67 expect(r.stdout).to match(/Notice: output correct/)
70 it 'is_strings integers' do
76 notify { 'output correct': }
80 apply_manifest(pp, :catch_failures => true) do |r|
81 expect(r.stdout).to match(/Notice: output correct/)
84 it 'is_strings hashes' do
86 $a = {'aaa'=>'www.com'}
90 notify { 'output correct': }
94 apply_manifest(pp, :catch_failures => true) do |r|
95 expect(r.stdout).to match(/Notice: output correct/)
100 it 'handles improper argument counts'