From 055c3fa555bc548e1156f3e50445d50df78cef76 Mon Sep 17 00:00:00 2001 From: Jerod Santo Date: Fri, 9 Feb 2024 09:55:02 -0600 Subject: [PATCH] Exclude repos that have descriptions less than 3 words --- lib/repo.rb | 2 +- spec/repo_spec.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/repo.rb b/lib/repo.rb index 6fbcad0..01f6a7c 100644 --- a/lib/repo.rb +++ b/lib/repo.rb @@ -61,7 +61,7 @@ def no_language? end def description_too_short? - description.length < 5 + (description.length < 5) || (description.split(" ").length < 3) end def description_too_long? diff --git a/spec/repo_spec.rb b/spec/repo_spec.rb index 912050d..4a609dd 100644 --- a/spec/repo_spec.rb +++ b/spec/repo_spec.rb @@ -45,6 +45,11 @@ expect(repo.description_too_short?).to be true end + it "is true when description is less than 3 words" do + repo.description = "too shot" + expect(repo.description_too_short?).to be true + end + it "is false when descripton has long contents" do repo.description = "ohai this is a real one" expect(repo.description_too_short?).to be false