File tree Expand file tree Collapse file tree
lib/entitlements/data/groups/calculated
entitlements/data/groups/calculated
fixtures/ldap-config/filters Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,9 +41,10 @@ def description
4141 # Returns a String with the schema version (semver), or "1.0.0" if undefined.
4242 Contract C ::None => String
4343 def schema_version
44- version = parsed_data . fetch ( "schema_version" , "1.0.0" )
44+ version = parsed_data . fetch ( "schema_version" , "1.0.0" ) . to_s
4545 unless version . match? ( /\A \d +\. \d +\. \d +\z / )
46- raise "Invalid schema version format: #{ version } - Expected format is 'MAJOR.MINOR.PATCH' - Examples: 1.2.3 or 10.0.0"
46+ raise "Invalid schema version format: #{ version } - Expected format is 'MAJOR.MINOR.PATCH' " \
47+ "- Examples: 1.2.3 or 10.0.0"
4748 end
4849 version
4950 end
Original file line number Diff line number Diff line change 4242 expect ( subject . schema_version ) . to eq ( "1.2.3" )
4343 end
4444
45+ it "returns the version string when one is set without the patch - not valid semver 2" do
46+ filename = fixture ( "ldap-config/filters/no-filters-with-schema-version-no-patch.yaml" )
47+ subject = described_class . new ( filename : filename )
48+ expect { subject . schema_version } . to raise_error ( RuntimeError , /Invalid schema version format/ )
49+ end
50+
4551 it "returns the version string when one is set (with v prefix - not valid semver 2)" do
4652 filename = fixture ( "ldap-config/filters/no-filters-with-schema-version-with-v.yaml" )
4753 subject = described_class . new ( filename : filename )
Original file line number Diff line number Diff line change 1+ description : Yo kittens
2+ schema_version : 1.2
3+ rules :
4+ or :
5+ - username : russianblue
6+ - username : BlackManx
You can’t perform that action at this time.
0 commit comments