require 'spec_helper' describe Profanity do describe "profanity_filter" do it "can handle a nil input" do Profanity.is_profane?(nil).should be false end it "can handle a blank input" do Profanity.is_profane?('').should be false end it "can handle a clean input" do Profanity.is_profane?('you are a clean input').should be false end it "can handle a profane input" do Profanity.is_profane?('fuck you!').should be true end it "is not fooled by punctuation" do Profanity.is_profane?('fuck-you!').should be true Profanity.is_profane?('???$$fuck-you!').should be true Profanity.is_profane?('--!fuck-you!').should be true end end end