mollom 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.1
1
+ 0.2.2
@@ -172,6 +172,8 @@ class Mollom
172
172
  client = XMLRPC::Client.new(server[:host], "/#{API_VERSION}")
173
173
  return client.call(command, data.merge(authentication_hash))
174
174
  # TODO: Rescue more stuff (Connection Timeout and such)
175
+ rescue RuntimeError
176
+ next
175
177
  rescue XMLRPC::FaultException => error
176
178
  case error.faultCode
177
179
  when Errors::Standard
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{mollom}
8
- s.version = "0.2.1"
8
+ s.version = "0.2.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jan De Poorter"]
12
- s.date = %q{2010-03-15}
12
+ s.date = %q{2010-03-16}
13
13
  s.description = %q{Ruby class for easy interfacing with the mollom.com open API for spam detection and content quality assesment.}
14
14
  s.email = %q{mollom@openminds.be}
15
15
  s.extra_rdoc_files = [
@@ -106,6 +106,18 @@ class TestMollom < Test::Unit::TestCase
106
106
  end
107
107
 
108
108
 
109
+ def test_send_command_with_bad_http_response
110
+ Mollom.any_instance.expects(:server_list).returns([{:host => '172.16.0.1', :proto => 'http'}, {:host => '172.16.0.2', :proto => 'http'}])
111
+ xml_rpc = mock
112
+ xml_rpc.expects(:call).with('mollom.testMessage', has_entry(:options => 'foo')).raises(RuntimeError.new('HTTP-Error: 302 Found'))
113
+ xml_rpc2 = mock
114
+ xml_rpc2.expects(:call).with('mollom.testMessage', has_entry(:options => 'foo'))
115
+
116
+ XMLRPC::Client.expects(:new).with('172.16.0.1', '/1.0').returns(xml_rpc)
117
+ XMLRPC::Client.expects(:new).with('172.16.0.2', '/1.0').returns(xml_rpc2)
118
+ @mollom.send_command('mollom.testMessage', {:options => 'foo'})
119
+ end
120
+
109
121
  def test_send_command_with_bad_server
110
122
  Mollom.any_instance.expects(:server_list).returns([{:host => '172.16.0.1', :proto => 'http'}, {:host => '172.16.0.2', :proto => 'http'}])
111
123
  xml_rpc = mock
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 1
9
- version: 0.2.1
8
+ - 2
9
+ version: 0.2.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jan De Poorter
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-03-15 00:00:00 +01:00
17
+ date: 2010-03-16 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies: []
20
20