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 17301730 Optional[Integer] $ssl_stapling_timeout = undef ,
17311731 Optional[Enum['on', 'off']] $ssl_stapling_return_errors = undef ,
17321732 Optional[String] $ssl_user_name = undef ,
1733- Optional[Variant[Integer, Boolean]] $priority = undef ,
1733+ Optional[Apache::Vhost::Priority] $priority = undef ,
17341734 Boolean $default_vhost = false ,
17351735 Optional[String] $servername = $name,
17361736 Variant[Array[String], String] $serveraliases = [],
Original file line number Diff line number Diff line change 1818define apache::vhost::custom (
1919 String $content ,
2020 String $ensure = ' present' ,
21- Variant[Integer, Boolean] $priority = 25,
21+ Apache::Vhost::Priority $priority = 25,
2222 Boolean $verify_config = true ,
2323) {
2424 include apache
Original file line number Diff line number Diff line change 5959define apache::vhost::fragment (
6060 String[1] $vhost ,
6161 Optional[Stdlib::Port] $port = undef ,
62- Optional[Variant[Integer, Boolean]] $priority = undef ,
62+ Optional[Apache::Vhost::Priority] $priority = undef ,
6363 Optional[String] $content = undef ,
6464 Integer[0] $order = 900,
6565) {
Original file line number Diff line number Diff line change 106106#
107107define apache::vhost::proxy (
108108 String[1] $vhost ,
109- Optional[Variant[Integer, Boolean]] $priority = undef ,
109+ Optional[Apache::Vhost::Priority] $priority = undef ,
110110 Integer[0] $order = 170,
111111 Optional[Stdlib::Port] $port = undef ,
112112 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