Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8393998
shell_join_spec.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
shell_join_spec.rb
View Options
require
'spec_helper'
describe
'shell_join'
do
it
{
is_expected
.
not_to
eq
(
nil
)
}
describe
'signature validation'
do
it
{
is_expected
.
to
run
.
with_params
.
and_raise_error
(
Puppet
::
ParseError
,
%r{wrong number of arguments}i
)
}
it
{
is_expected
.
to
run
.
with_params
(
[
'foo'
]
,
[
'bar'
]
)
.
and_raise_error
(
Puppet
::
ParseError
,
%r{wrong number of arguments}i
)
}
it
{
is_expected
.
to
run
.
with_params
(
'foo'
)
.
and_raise_error
(
Puppet
::
ParseError
,
%r{is not an Array}i
)
}
end
describe
'shell argument joining'
do
it
{
is_expected
.
to
run
.
with_params
(
[
'foo'
]
)
.
and_return
(
'foo'
)
}
it
{
is_expected
.
to
run
.
with_params
(
[
'foo'
,
'bar'
]
)
.
and_return
(
'foo bar'
)
}
it
{
is_expected
.
to
run
.
with_params
(
[
'foo'
,
'bar baz'
]
)
.
and_return
(
'foo bar\ baz'
)
}
it
{
is_expected
.
to
run
.
with_params
(
[
'~`!@#$'
,
'%^&*()_+-='
,
'[]\{}|;
\'
:"'
,
',./<>?'
]
)
.
and_return
(
'\~\`\!@
\#
\$ \%\^\&\*\(\)_\+-\= \[\]
\\\\
\{\}\|\;
\\\'
:
\"
,./\<\>\?'
)
}
context
'with UTF8 and double byte characters'
do
it
{
is_expected
.
to
run
.
with_params
(
[
'μťƒ'
,
'8'
,
'ŧĕχť'
]
)
.
and_return
(
'
\\
μ
\\
ť
\\
ƒ 8
\\
ŧ
\\
ĕ
\\
χ
\\
ť'
)
}
it
{
is_expected
.
to
run
.
with_params
(
[
'スペー'
,
'スを含むテ'
,
' キスト'
]
)
.
and_return
(
'
\\
ス
\\
ペ
\\
ー
\\
ス
\\
を
\\
含
\\
む
\\
テ
\\
\\
キ
\\
ス
\\
ト'
)
}
end
end
describe
'stringification'
do
it
{
is_expected
.
to
run
.
with_params
(
[
10
,
false
,
'foo'
]
)
.
and_return
(
'10 false foo'
)
}
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Wed, Jun 4, 7:20 PM (4 d, 21 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3382633
Attached To
rSPSTD puppet-puppetlabs-stdlib
Event Timeline
Log In to Comment