mollom 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/mollom.rb +2 -2
- data/test/mollom_test.rb +9 -2
- metadata +7 -5
data/lib/mollom.rb
CHANGED
@@ -153,7 +153,7 @@ class Mollom
|
|
153
153
|
proto, ip = server.split('://')
|
154
154
|
{:proto => proto, :host => ip}
|
155
155
|
end
|
156
|
-
rescue
|
156
|
+
rescue StandardError, Exception
|
157
157
|
nil
|
158
158
|
end
|
159
159
|
|
@@ -243,4 +243,4 @@ class Mollom
|
|
243
243
|
|
244
244
|
class Error < StandardError; end
|
245
245
|
class NoAvailableServers < Error; end
|
246
|
-
end
|
246
|
+
end
|
data/test/mollom_test.rb
CHANGED
@@ -64,7 +64,14 @@ class TestMollom < Test::Unit::TestCase
|
|
64
64
|
XMLRPC::Client.stubs(:new).with('xmlrpc.mollom.com', '/1.0').returns(xml_rpc)
|
65
65
|
assert_equal(nil, @mollom.send(:get_server_list_from, {:host => 'xmlrpc.mollom.com', :proto => 'http'}))
|
66
66
|
end
|
67
|
-
|
67
|
+
|
68
|
+
def test_get_server_list_from_with_timemout
|
69
|
+
xml_rpc = mock
|
70
|
+
xml_rpc.expects(:call).times(1).with('mollom.getServerList', is_a(Hash)).raises(Timeout::Error)
|
71
|
+
XMLRPC::Client.stubs(:new).with('xmlrpc.mollom.com', '/1.0').returns(xml_rpc)
|
72
|
+
assert_equal(nil, @mollom.send(:get_server_list_from, {:host => 'xmlrpc.mollom.com', :proto => 'http'}))
|
73
|
+
end
|
74
|
+
|
68
75
|
def test_server_list_force_reload
|
69
76
|
Mollom.any_instance.expects(:get_server_list_from).times(2).with(:host => 'xmlrpc3.mollom.com', :proto => 'http').returns([{:host => '172.16.0.1', :proto => 'http'}, {:host => '172.16.0.2', :proto => 'http'}, {:host => '172.16.0.2', :proto => 'https'}])
|
70
77
|
|
@@ -185,4 +192,4 @@ class TestMollom < Test::Unit::TestCase
|
|
185
192
|
@mollom.send_feedback :session_id => 1, :feedback => 'profanity'
|
186
193
|
end
|
187
194
|
|
188
|
-
end
|
195
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mollom
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan De Poorter
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-09-28 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -25,7 +25,9 @@ files:
|
|
25
25
|
- lib/mollom.rb
|
26
26
|
- README.rdoc
|
27
27
|
has_rdoc: true
|
28
|
-
homepage: mollom.rubyforge.com
|
28
|
+
homepage: http://mollom.rubyforge.com
|
29
|
+
licenses: []
|
30
|
+
|
29
31
|
post_install_message:
|
30
32
|
rdoc_options: []
|
31
33
|
|
@@ -46,9 +48,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
46
48
|
requirements: []
|
47
49
|
|
48
50
|
rubyforge_project: mollom
|
49
|
-
rubygems_version: 1.
|
51
|
+
rubygems_version: 1.3.5
|
50
52
|
signing_key:
|
51
|
-
specification_version:
|
53
|
+
specification_version: 3
|
52
54
|
summary: Ruby class for easy interfacing with the mollom.com open API for spam detection and content quality assesment.
|
53
55
|
test_files:
|
54
56
|
- test/content_response_test.rb
|