-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from theverything/get_score
Refactor #get_score
- Loading branch information
Showing
2 changed files
with
29 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require_relative "../lib/sentimental" | ||
|
||
describe Sentimental do | ||
|
||
before :each do | ||
Sentimental.load_defaults | ||
Sentimental.threshold = 0.1 | ||
@analyzer = Sentimental.new | ||
end | ||
|
||
describe "#get_score" do | ||
|
||
it "returns a score of 0.925 when passed 'I love ruby'" do | ||
@analyzer.get_score('I love ruby').should eq(0.925) | ||
end | ||
|
||
it "returns a score of 0.0 when passed 'I like ruby'" do | ||
@analyzer.get_score('I like ruby').should eq(0.0) | ||
end | ||
|
||
it "returns a score of -0.4375 when passed 'I hate ruby'" do | ||
@analyzer.get_score('I hate ruby').should eq(-0.4375) | ||
end | ||
|
||
end | ||
|
||
end |