Skip to content

Commit

Permalink
Add testfile for tabular
Browse files Browse the repository at this point in the history
  • Loading branch information
Felixoid committed Mar 21, 2018
1 parent ceb00c6 commit 054312a
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions tests/tabular_test.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
class some::example (
$the_most_longest_argument,
String $arg2,
$arg3=4,
$rsa_private_key = undef,
Type::Server::Hostname $hostname =$::hostname,
Type::Inet $intern_ip= $::intern_ip,
Optional[Type::Inet6] $primary_ip6 = defined('$::primary_ip6') ? {
true=>$::primary_ip6,
false=> undef,
},
# comment with => and $var inside
# comment with only =>
# comment with only $argument
Type::Server::Hostname $project = $::project,
Enum[
'online',
'offline',
'WIP'
] $state= $::state,
String[1] $environment = $::environment,
Optional[String[1]] $function = $::function,
Type::Server::Hostname $monitoring_queue = $::monitoring_queue,
Array[Pattern[/\A[a-z][a-z0-9_-]*\Z/]] $monitoring_checks =$::monitoring_checks,
Optional[Type::Server::Hostname] $project_network= defined('$::project_network') ? {
true => $::project_network,
false =>undef,
default=>'',
},
) {
file { '/just_example':
ensure => 'directory',
}

# Another useful case
# Shouldn't brake on <Enter> or calling `:Tabularize puppet_class`
if $rsa_private_key != undef {
some::cool::helper { $user:
home_dir => '/home/user',
authorized_keys => [
convert_ssh_rsa_private_to_public_key($rsa_private_key)
],
rsa_private_key => $rsa_private_key,
}
}
}

0 comments on commit 054312a

Please sign in to comment.