Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ By setting optional `ssl` parameter to `true` will create https_port entries ins

* [`Squid::Action::SslBump`](#Squid--Action--SslBump): Possible SSLBump options
* [`Squid::PkgEnsure`](#Squid--PkgEnsure): Custom type representing package status and/or version
* [`Squid::Size`](#Squid--Size): Custom type containing the numeral value and the unit of messurement (Kilo- or Megabyte)
* [`Squid::Size`](#Squid--Size): Custom type containing the numeral value and the unit of messurement (Kilo-, Mega-, or Gigabyte)

## Classes

Expand Down Expand Up @@ -1717,7 +1717,7 @@ Alias of `Variant[Pattern[/^\d.*/], Enum['present', 'latest', 'absent', 'purged'

### <a name="Squid--Size"></a>`Squid::Size`

Custom type containing the numeral value and the unit of messurement (Kilo- or Megabyte)
Custom type containing the numeral value and the unit of messurement (Kilo-, Mega-, or Gigabyte)

Alias of `Pattern[/^\d+ [KM]B$/]`
Alias of `Pattern[/^\d+ [KMG]B$/]`

3 changes: 3 additions & 0 deletions spec/type_aliases/squid_size_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
it { is_expected.to allow_value('1 MB') }
it { is_expected.to allow_value('10 KB') }
it { is_expected.to allow_value('9876543210 KB') }
it { is_expected.to allow_value('1 GB') }
it { is_expected.not_to allow_value('-1 KB') }
it { is_expected.not_to allow_value('1 kB') }
it { is_expected.not_to allow_value('1 Kb') }
it { is_expected.not_to allow_value('1 Mb') }
it { is_expected.not_to allow_value('1 KBB') }
it { is_expected.not_to allow_value('a KBB') }
it { is_expected.not_to allow_value('1KB') }
it { is_expected.not_to allow_value('1 gb') }
it { is_expected.not_to allow_value('1 Gb') }
end
4 changes: 2 additions & 2 deletions types/size.pp
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# @summary
# Custom type containing the numeral value and the unit of messurement (Kilo- or Megabyte)
type Squid::Size = Pattern[/^\d+ [KM]B$/]
# Custom type containing the numeral value and the unit of messurement (Kilo-, Mega-, or Gigabyte)
type Squid::Size = Pattern[/^\d+ [KMG]B$/]