Skip to content

Commit cd12c4e

Browse files
committed
Group wordlists.yml schema specs into sub-describe blocks.
1 parent f3cc90c commit cd12c4e

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

spec/wordlists_yml_spec.rb

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,10 @@
2828
expect(attributes.keys).to all(be_kind_of(Symbol))
2929
end
3030

31-
it "must have a valid :url" do
32-
expect(attributes[:url]).to match(/\A#{URI::DEFAULT_PARSER.make_regexp(%w[http https])}\z/)
31+
describe ":url" do
32+
it "must be a http:// or https:// URL" do
33+
expect(attributes[:url]).to match(/\A#{URI::DEFAULT_PARSER.make_regexp(%w[http https])}\z/)
34+
end
3335
end
3436

3537
it "must have :categories" do
@@ -38,14 +40,21 @@
3840
expect(attributes[:categories]).to all(be_kind_of(String))
3941
end
4042

41-
it "all :categories must be lowercase words" do
42-
expect(attributes[:categories]).to all(match(/\A[a-z][a-z0-9_-]+\z/))
43+
describe ":categories" do
44+
it "must contain lowercase words" do
45+
expect(attributes[:categories]).to all(match(/\A[a-z][a-z0-9_-]+\z/))
46+
end
4347
end
4448

4549
it "must have a :summary" do
4650
expect(attributes[:summary]).to be_kind_of(String)
4751
expect(attributes[:summary]).to_not be_empty
48-
expect(attributes[:summary]).to end_with('.')
52+
end
53+
54+
describe ":summary" do
55+
it "must end with a period" do
56+
expect(attributes[:summary]).to end_with('.')
57+
end
4958
end
5059
end
5160
end

0 commit comments

Comments
 (0)