my
(
@should_be_output
,
@output
,
$source
);
$source
= <<
'EOF'
;
if
(
'false'
) {
EOF
@should_be_output
= <<
'EOF'
;
if
(
'false'
) {
EOF
Puppet::Tidy::puppettidy(
source
=>
$source
,
destination
=> \
@output
);
is_deeply(
@output
,
@should_be_output
,
"insert warning for single quoted 'false'"
);
$source
= <<
'EOF'
;
if
(
"false"
) {
EOF
@should_be_output
= <<
'EOF'
;
if
(
"false"
) {
EOF
Puppet::Tidy::puppettidy(
source
=>
$source
,
destination
=> \
@output
);
is_deeply(
@output
,
@should_be_output
,
"insert warning for double quoted 'false'"
);
$source
= <<
'EOF'
;
if
(
'true'
) {
}
EOF
@should_be_output
= <<
'EOF'
;
if
(true) {
}
EOF
Puppet::Tidy::puppettidy(
source
=>
$source
,
destination
=> \
@output
);
is_deeply(
@output
,
@should_be_output
,
"booleans mustn't be single quoted"
);
$source
= <<
'EOF'
;
if
(
"true"
) {
}
EOF
@should_be_output
= <<
'EOF'
;
if
(true) {
}
EOF
Puppet::Tidy::puppettidy(
source
=>
$source
,
destination
=> \
@output
);
is_deeply(
@output
,
@should_be_output
,
"booleans mustn't be double quoted"
);
$source
= <<
'EOF'
;
filebucket {
'main'
:
server
=>
'server.address'
,
path
=> false,
}
EOF
@should_be_output
= <<
'EOF'
;
filebucket {
'main'
:
server
=>
'server.address'
,
path
=> false,
}
EOF
Puppet::Tidy::puppettidy(
source
=>
$source
,
destination
=> \
@output
);
is_deeply(
@output
,
@should_be_output
,
"unquoted booleans must not be modified"
);