1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 describe 'size function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
6 it 'single string size' do
10 notice(inline_template('size is <%= @o.inspect %>'))
13 apply_manifest(pp, :catch_failures => true) do |r|
14 expect(r.stdout).to match(/size is 14/)
17 it 'with empty string' do
21 notice(inline_template('size is <%= @o.inspect %>'))
24 apply_manifest(pp, :catch_failures => true) do |r|
25 expect(r.stdout).to match(/size is 0/)
32 notice(inline_template('size is <%= @o.inspect %>'))
35 apply_manifest(pp, :catch_failures => true) do |r|
36 expect(r.stdout).to match(/size is 0/)
39 it 'strings in array' do
41 $a = ['discombobulate', 'moo']
43 notice(inline_template('size is <%= @o.inspect %>'))
46 apply_manifest(pp, :catch_failures => true) do |r|
47 expect(r.stdout).to match(/size is 2/)
52 it 'handles no arguments'
53 it 'handles non strings or arrays'