Skip to content

Commit

Permalink
Exclude repos that have descriptions less than 3 words
Browse files Browse the repository at this point in the history
  • Loading branch information
jerodsanto committed Feb 9, 2024
1 parent 8aa5a6c commit 055c3fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/repo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
5 changes: 5 additions & 0 deletions spec/repo_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 055c3fa

Please sign in to comment.