forked from codefriar/RubySpamAssassin
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed unused cucumber. Added basic test for parser
- Loading branch information
Showing
12 changed files
with
57 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Empty file.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require_relative '../spec_helper' | ||
|
||
describe "ReportParser" do | ||
it "should parse the report text into an informative hash" do | ||
spam = File.read('spec/data/spam_test1.txt') | ||
result = RubySpamAssassin::ReportParser.parse(spam) | ||
result.length.equal?(6) | ||
|
||
# Check contents of first one to make sure text/points are formatted correctly | ||
result[0][:pts].equal?(0.5) | ||
result[0][:rule].equal?('DATE_IN_PAST_24_48') | ||
result[0][:text].equal?('Date: is 24 to 48 hours before Received: date') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require_relative '../spec_helper' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require_relative '../spec_helper' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') | ||
|
||
describe "Rubyspamassassin" do | ||
it "fails" do | ||
fail "hey buddy, you should probably rename this file and start specing for real" | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on | ||
scanner.com | ||
X-Spam-Level: *** | ||
X-Spam-Status: No, score=3.4 required=5.0 tests=DATE_IN_PAST_24_48, | ||
HTML_MESSAGE,HTML_MIME_NO_HTML_TAG,INVALID_MSGID,MIME_HTML_ONLY, | ||
UNPARSEABLE_RELAY autolearn=no version=3.3.2 | ||
Received: from dummyurl.com for <dummy@dummy.com>; Fri, 8 Mar 2013 14:53:15 -0500 | ||
Date: Thu, 7 Mar 2013 00:02:33 -0500 | ||
From: Dummy <dummy@dummy.com> | ||
Reply-To: Dummy <dummy@dummy.com> | ||
To: dummy@dummy.com | ||
Message-Id: testdummy@dummy.com | ||
Subject: Work Report | ||
Mime-Version: 1.0 | ||
Content-Type: text/html; charset=utf-8 | ||
Auto-Submitted: auto-generated | ||
|
||
Hey, | ||
|
||
Was wondering if I could get a copy of the work report you made yesterday. Thanks! | ||
Spam detection software, running on the system "scan1.blue.postageapp.com", has | ||
identified this incoming email as possible spam. The original message | ||
has been attached to this so you can view it (if it isn't spam) or label | ||
similar future email. If you have any questions, see | ||
the administrator of that system for details. | ||
|
||
Content preview: Hey, Was wondering if I could get a copy of the work report | ||
you made yesterday. Thanks! [...] | ||
|
||
Content analysis details: (3.4 points, 5.0 required) | ||
|
||
pts rule name description | ||
---- ---------------------- -------------------------------------------------- | ||
0.5 DATE_IN_PAST_24_48 Date: is 24 to 48 hours before Received: date | ||
0.0 HTML_MESSAGE BODY: HTML included in message | ||
1.1 MIME_HTML_ONLY BODY: Message only has text/html MIME parts | ||
0.6 HTML_MIME_NO_HTML_TAG HTML-only message, but there is no HTML tag | ||
1.2 INVALID_MSGID Message-Id is not valid, according to RFC 2822 | ||
0.0 UNPARSEABLE_RELAY Informational: message has unparseable relay lines |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,4 @@ | |
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f} | ||
|
||
RSpec.configure do |config| | ||
|
||
end |