File tree Expand file tree Collapse file tree 6 files changed +29
-4
lines changed Expand file tree Collapse file tree 6 files changed +29
-4
lines changed Original file line number Diff line number Diff line change 1730
1730
Optional[Integer] $ssl_stapling_timeout = undef ,
1731
1731
Optional[Enum['on', 'off']] $ssl_stapling_return_errors = undef ,
1732
1732
Optional[String] $ssl_user_name = undef ,
1733
- Optional[Variant[Integer, Boolean]] $priority = undef ,
1733
+ Optional[Apache::Vhost::Priority] $priority = undef ,
1734
1734
Boolean $default_vhost = false ,
1735
1735
Optional[String] $servername = $name,
1736
1736
Variant[Array[String], String] $serveraliases = [],
Original file line number Diff line number Diff line change 18
18
define apache::vhost::custom (
19
19
String $content ,
20
20
String $ensure = ' present' ,
21
- Variant[Integer, Boolean] $priority = 25,
21
+ Apache::Vhost::Priority $priority = 25,
22
22
Boolean $verify_config = true ,
23
23
) {
24
24
include apache
Original file line number Diff line number Diff line change 59
59
define apache::vhost::fragment (
60
60
String[1] $vhost ,
61
61
Optional[Stdlib::Port] $port = undef ,
62
- Optional[Variant[Integer, Boolean]] $priority = undef ,
62
+ Optional[Apache::Vhost::Priority] $priority = undef ,
63
63
Optional[String] $content = undef ,
64
64
Integer[0] $order = 900,
65
65
) {
Original file line number Diff line number Diff line change 106
106
#
107
107
define apache::vhost::proxy (
108
108
String[1] $vhost ,
109
- Optional[Variant[Integer, Boolean]] $priority = undef ,
109
+ Optional[Apache::Vhost::Priority] $priority = undef ,
110
110
Integer[0] $order = 170,
111
111
Optional[Stdlib::Port] $port = undef ,
112
112
Optional[String[1]] $proxy_dest = undef ,
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ require 'spec_helper'
4
+
5
+ describe 'Apache::Vhost::Priority' do
6
+ # Pattern
7
+ it { is_expected . to allow_value ( '10' ) }
8
+ it { is_expected . to allow_value ( '010' ) }
9
+ it { is_expected . not_to allow_value ( '' ) }
10
+ it { is_expected . not_to allow_value ( 'a' ) }
11
+ it { is_expected . not_to allow_value ( 'a1' ) }
12
+ it { is_expected . not_to allow_value ( '1a' ) }
13
+
14
+ # Integer
15
+ it { is_expected . to allow_value ( 0 ) }
16
+ it { is_expected . to allow_value ( 1 ) }
17
+
18
+ # Boolean
19
+ it { is_expected . to allow_value ( true ) } # Technically an illegal value
20
+ it { is_expected . to allow_value ( false ) }
21
+
22
+ it { is_expected . not_to allow_value ( nil ) }
23
+ end
Original file line number Diff line number Diff line change
1
+ # @summary The priority on vhost
2
+ type Apache::Vhost::Priority = Variant[Pattern[/^\d+$/], Integer, Boolean]
You can’t perform that action at this time.
0 commit comments