Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Test for proper spelling in the project's license

Also a refactor of the code that asserts correct spelling in a given file.
  • Loading branch information...
commit c9581f1ce73dbdf8e06bd78241dbd7fc3654ddf5 1 parent b67a0e1
Troy Surrett authored
Showing with 18 additions and 10 deletions.
  1. +14 −0 test/helper.rb
  2. +4 −10 test/test_sentient_user.rb
View
14 test/helper.rb
@@ -22,4 +22,18 @@ class AnonymousUser < User ; end
ExceptedWords = %w{ hackery hacky monkeypatching
ActiveRecord SentientUser SentientController
initializer config rakefile bokmann
+ sublicense MERCHANTABILITY NONINFRINGEMENT
}
+
+def check_spelling_in_file(path_relative_to_gem_root)
+ path = "#{File.dirname(__FILE__)}/../#{path_relative_to_gem_root}"
+ begin
+ aspell_output = `cat #{path} | aspell list`
+ rescue => err
+ warn "You probably don't have aspell. On mac: brew install aspell --lang=en"
+ raise err
+ end
+ noticed_words = aspell_output.split($/)
+ misspellings = noticed_words - ExceptedWords
+ assert_equal [], misspellings
+end
View
14 test/test_sentient_user.rb
@@ -48,16 +48,10 @@ class TestSentientUser < Test::Unit::TestCase
end
should "have no spelling errors in its README" do
- begin
- aspell_output = `cat #{File.dirname(__FILE__)}/../README.rdoc | aspell list`
- rescue => err
- warn "You probably don't have aspell. On mac: brew install aspell --lang=en"
- raise err
- end
- misspellings = aspell_output.split($/) - ExceptedWords
- assert_equal [], misspellings
+ check_spelling_in_file "README.rdoc"
end
- # should "have no spelling errors in the license" do
- # end
+ should "have no spelling errors in the license" do
+ check_spelling_in_file "LICENSE"
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.