1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 if get_puppet_version =~ /^4/
5 describe 'is_a function' do
6 it 'should match a string' do
8 if 'hello world'.is_a(String) {
9 notify { 'output correct': }
13 apply_manifest(pp, :catch_failures => true) do |r|
14 expect(r.stdout).to match(/Notice: output correct/)
18 it 'should not match a integer as string' do
21 notify { 'output wrong': }
25 apply_manifest(pp, :catch_failures => true) do |r|
26 expect(r.stdout).not_to match(/Notice: output wrong/)