diff --git a/spec/type_aliases/squid_size_spec.rb b/spec/type_aliases/squid_size_spec.rb index e572146..e78f28f 100644 --- a/spec/type_aliases/squid_size_spec.rb +++ b/spec/type_aliases/squid_size_spec.rb @@ -7,6 +7,7 @@ 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') } @@ -14,4 +15,6 @@ 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 diff --git a/types/size.pp b/types/size.pp index cb52b3a..5fb45b0 100644 --- a/types/size.pp +++ b/types/size.pp @@ -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$/] +type Squid::Size = Pattern[/^\d+ [KMG]B$/]