my
(
@output
,
$source
);
my
@should_be_output
= <<
'EOF'
;
file {
'space'
:
mode
=>
$mode
}
EOF
$source
= <<
'EOF'
;
file {
'space'
:
mode
=>
$mode
}
EOF
Puppet::Tidy::puppettidy(
source
=>
$source
,
destination
=> \
@output
);
is_deeply(
@output
,
@should_be_output
,
"mode as variable"
);
@should_be_output
= <<
'EOF'
;
file {
'space'
:
mode
=>
'0644'
}
EOF
$source
= <<
'EOF'
;
file {
'space'
:
mode
=>
"0644"
}
EOF
Puppet::Tidy::puppettidy(
source
=>
$source
,
destination
=> \
@output
);
is_deeply(
@output
,
@should_be_output
,
"mode as four digit double quoted string"
);
@should_be_output
= <<
'EOF'
;
file {
'space'
:
mode
=>
'0644'
}
EOF
$source
= <<
'EOF'
;
file {
'space'
:
mode
=> 644 }
EOF
Puppet::Tidy::puppettidy(
source
=>
$source
,
destination
=> \
@output
);
is_deeply(
@output
,
@should_be_output
,
"mode as three digit, unquoted string"
);
@should_be_output
= <<
'EOF'
;
file {
'space'
:
mode
=>
'0644'
}
EOF
$source
= <<
'EOF'
;
file {
'space'
:
mode
=>
'644'
}
EOF
Puppet::Tidy::puppettidy(
source
=>
$source
,
destination
=> \
@output
);
is_deeply(
@output
,
@should_be_output
,
"mode as three digit single quoted string"
);