comcetera 0.3.1 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -26,8 +26,9 @@ The API can return a couple of errors. In this case, there is no operator code,
26
26
 
27
27
  comcetera = Comcetera.detect(31612345678)
28
28
  comcetera.operator_code # => nil
29
- comcetera.error_code # => "ERR21"
30
- comcetera.debug # => "QUERYOK\n31612345678 ERR21\nENDBATCH"
29
+ comcetera.error_code # => "ERR29"
30
+ comcetera.error_message # => "Absent subscriber"
31
+ comcetera.debug # => "QUERYOK\n31612345678 ERR29\nENDBATCH"
31
32
 
32
33
  == Operator codes
33
34
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.1
1
+ 1.0.0
@@ -58,7 +58,14 @@ class Comcetera
58
58
  # ignore
59
59
  end
60
60
  end
61
- nil
61
+ new(:error_message=>"Timeout from Comcetera", :debug=>"#{self.retries} times no response within #{self.timeout} seconds")
62
62
  end
63
63
  end
64
+
65
+ def ==(other)
66
+ [:operator_code, :msisdn, :error_code, :error_message, :debug].each do |attribute|
67
+ return false unless self.send(attribute) == other.send(attribute)
68
+ end
69
+ true
70
+ end
64
71
  end
@@ -26,7 +26,7 @@ describe "Comcetera" do
26
26
  it "should retry after a timeout and return nil when it still fails" do
27
27
  3.times {Timeout.should_receive(:timeout).with(2).and_raise(Timeout::Error)}
28
28
  @comcetera = Comcetera.detect(31612345678)
29
- @comcetera.should be_nil
29
+ @comcetera.should == Comcetera.new(:error_message=>"Timeout from Comcetera", :debug=>"2 times no response within 2 seconds")
30
30
  end
31
31
 
32
32
  describe "the returned Comcetera instance" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comcetera
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
- - 0
8
- - 3
9
7
  - 1
10
- version: 0.3.1
8
+ - 0
9
+ - 0
10
+ version: 1.0.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Wes Oldenbeuving
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-29 00:00:00 +02:00
18
+ date: 2010-10-04 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency