Skip to content

Commit caa2fee

Browse files
Merge pull request #1095 from syseleven/correct-naming
Add correct namespace for start_with function
2 parents 397d0eb + e4712fa commit caa2fee

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/puppet/functions/start_with.rb renamed to lib/puppet/functions/stdlib/start_with.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
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
#

spec/functions/startswith_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require '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}) }

0 commit comments

Comments
 (0)