Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F9313005
to_hash_settings_spec.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
654 B
Subscribers
None
to_hash_settings_spec.rb
View Options
require
'spec_helper'
describe
'to_hash_settings'
do
input
=
{
'a'
=>
1
,
'b'
=>
2
}
results
=
[
{
'a'
=>
{
'key'
=>
'a'
,
'value'
=>
1
},
'b'
=>
{
'key'
=>
'b'
,
'value'
=>
2
}
},
{
'foo: a'
=>
{
'key'
=>
'a'
,
'value'
=>
1
},
'foo: b'
=>
{
'key'
=>
'b'
,
'value'
=>
2
}
}
]
describe
'when first parameter is not a hash'
do
it
{
should
run
.
with_params
(
'baz'
,
input
)
.
and_raise_error
(
Puppet
::
ParseError
)}
end
describe
'when used with proper parameters'
do
it
{
should
run
.
with_params
(
input
)
.
and_return
(
results
[
0
]
)
}
it
{
should
run
.
with_params
(
input
,
'foo'
)
.
and_return
(
results
[
1
]
)
}
end
end
File Metadata
Details
Attached
Mime Type
text/x-ruby
Expires
Thu, Jul 3, 11:19 AM (1 w, 23 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3452103
Attached To
R140 puppet-puppet-php
Event Timeline
Log In to Comment