1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 describe 'capitalize function' do
6 it 'should capitalize the first letter of a string' do
8 $input = 'this is a string'
9 $output = capitalize($input)
13 apply_manifest(pp, :catch_failures => true) do |r|
14 expect(r.stdout).to match(/Notice: This is a string/)
18 it 'should capitalize the first letter of an array of strings' do
20 $input = ['this', 'is', 'a', 'string']
21 $output = capitalize($input)
25 apply_manifest(pp, :catch_failures => true) do |r|
26 expect(r.stdout).to match(/Notice: This/)
27 expect(r.stdout).to match(/Notice: Is/)
28 expect(r.stdout).to match(/Notice: A/)
29 expect(r.stdout).to match(/Notice: String/)