alexrabarts-term_extraction 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/lib/term_extraction.rb +2 -0
- data/test/term_extraction_test.rb +25 -2
- metadata +2 -2
data/VERSION.yml
CHANGED
data/lib/term_extraction.rb
CHANGED
@@ -4,12 +4,35 @@ class TermExtractionTest < Test::Unit::TestCase
|
|
4
4
|
should 'return correct terms from Yahoo!' do
|
5
5
|
yahoo = TermExtraction::Yahoo.new
|
6
6
|
yahoo.stubs(:remote_xml).returns(read_xml_fixture('yahoo'))
|
7
|
-
assert_equal yahoo.terms,
|
7
|
+
assert_equal yahoo.terms, correct_yahoo_terms
|
8
8
|
end
|
9
9
|
|
10
10
|
should 'return correct terms from Zemanta' do
|
11
11
|
zemanta = TermExtraction::Zemanta.new
|
12
12
|
zemanta.stubs(:remote_xml).returns(read_xml_fixture('zemanta'))
|
13
|
-
assert_equal zemanta.terms,
|
13
|
+
assert_equal zemanta.terms, correct_zemanta_terms
|
14
14
|
end
|
15
|
+
|
16
|
+
should 'be able to set the context after initialization' do
|
17
|
+
yahoo = TermExtraction::Yahoo.new
|
18
|
+
context = 'foo'
|
19
|
+
yahoo.context = context
|
20
|
+
assert_equal yahoo.context, context
|
21
|
+
end
|
22
|
+
|
23
|
+
should 'be able to set the api key after initialization' do
|
24
|
+
zemanta = TermExtraction::Zemanta.new
|
25
|
+
context = 'bar'
|
26
|
+
zemanta.context = context
|
27
|
+
assert_equal zemanta.context, context
|
28
|
+
end
|
29
|
+
|
30
|
+
private
|
31
|
+
def correct_yahoo_terms
|
32
|
+
['gears of war', 'gears']
|
33
|
+
end
|
34
|
+
|
35
|
+
def correct_zemanta_terms
|
36
|
+
['Apple', 'IMac', 'Rumor', 'Hardware', 'Nvidia', 'Macintosh', 'Desktops', 'AllInOne']
|
37
|
+
end
|
15
38
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alexrabarts-term_extraction
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- alex
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-03-05 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|