File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
lib/puppet/functions/stdlib Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 22# Returns true if str starts with one of the prefixes given. Each of the prefixes should be a String.
33#
44# @example
5- # 'foobar'.start_with('foo') => true
6- # 'foobar'.start_with('bar') => false
7- # 'foObar'.start_with(['bar', 'baz']) => false
8- Puppet ::Functions . create_function ( :start_with ) do
5+ # 'foobar'.stdlib:: start_with('foo') => true
6+ # 'foobar'.stdlib:: start_with('bar') => false
7+ # 'foObar'.stdlib:: start_with(['bar', 'baz']) => false
8+ Puppet ::Functions . create_function ( :'stdlib:: start_with' ) do
99 # @param test_string The string to check
1010 # @param prefixes The prefixes to check.
1111 #
Original file line number Diff line number Diff line change 11require 'spec_helper'
22
3- describe 'start_with' do
3+ describe 'stdlib:: start_with' do
44 it { is_expected . not_to eq ( nil ) }
55 it { is_expected . to run . with_params . and_raise_error ( ArgumentError , %r{expects 2 arguments, got none}i ) }
66 it { is_expected . to run . with_params ( '' ) . and_raise_error ( ArgumentError , %r{expects 2 arguments, got 1} ) }
You can’t perform that action at this time.
0 commit comments