Skip to content

Commit 6136eaf

Browse files
authored
Merge branch 'main' into dependabot/bundler/bundler-1587dd27a8
2 parents e5f8014 + 287ad6b commit 6136eaf

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

spec/unit/entitlements/data/groups/calculated/text_spec.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,24 @@
6060
subject.description
6161
end.to raise_error(RuntimeError, /description cannot use '!=' operator in .+not-equals-description.txt!/)
6262
end
63+
64+
it "preserves semicolons in a free-form narrative description" do
65+
filename = fixture("ldap-config/text/description-with-semicolon-narrative.txt")
66+
subject = described_class.new(filename: filename)
67+
expect(subject.description).to eq("This group manages auth; it also handles access control for the team")
68+
end
69+
70+
it "does not parse semicolons in description as predicates" do
71+
filename = fixture("ldap-config/text/semicolons-in-description.txt")
72+
subject = described_class.new(filename: filename)
73+
expect(subject.description).to eq("the; description; can; have; semicolons")
74+
end
75+
76+
it "does not treat predicate-like text after semicolons in description as predicates" do
77+
filename = fixture("ldap-config/text/description-with-predicate-like-semicolon.txt")
78+
subject = described_class.new(filename: filename)
79+
expect(subject.description).to eq("This group provides access to resources; expiration = 2099-12-31 is not a predicate here")
80+
end
6381
end
6482

6583
describe "#initialize_filters" do
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
description = This group provides access to resources; expiration = 2099-12-31 is not a predicate here
2+
username = mainecoon
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
description = This group manages auth; it also handles access control for the team
2+
username = mainecoon

0 commit comments

Comments
 (0)