cadun 0.5.8 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
data/lib/cadun/gateway.rb CHANGED
@@ -18,7 +18,7 @@ module Cadun
18
18
  subject = if opts[:email]; "email/#{opts[:email]}"
19
19
  elsif opts[:cadun_id]; opts[:cadun_id]
20
20
  else
21
- raise RestClient::Unauthorized unless authorization["status"] == "AUTORIZADO"
21
+ raise Exception.new(authorization["status"]) unless authorization["status"] == "AUTORIZADO"
22
22
  authorization["usuarioID"]
23
23
  end
24
24
 
data/lib/cadun/version.rb CHANGED
@@ -2,7 +2,7 @@ module Cadun
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 5
5
- PATCH = 8
5
+ PATCH = 9
6
6
 
7
7
  STRING = [MAJOR, MINOR, PATCH] * '.'
8
8
  end
@@ -42,7 +42,7 @@ describe Cadun::Gateway do
42
42
  FakeWeb.register_uri(:put, "http://isp-authenticator.qa01.globoi.com:8280/ws/rest/autorizacao", :body => "<?xml version='1.0' encoding='utf-8'?><usuarioAutorizado><status>NAO_AUTORIZADO</status><usuarioID>1</usuarioID></usuarioAutorizado>")
43
43
  end
44
44
 
45
- it { proc { gateway.content }.should raise_error(RestClient::Unauthorized) }
45
+ it { proc { gateway.content }.should raise_error(Exception) }
46
46
  end
47
47
 
48
48
  context "when status AUTORIZADO" do
@@ -51,7 +51,7 @@ describe Cadun::Gateway do
51
51
  FakeWeb.register_uri(:get, "http://isp-authenticator.qa01.globoi.com:8280/cadunii/ws/resources/pessoa/1", :body => "<?xml version='1.0' encoding='utf-8'?><pessoa><nome>Barack Obama</nome></pessoa>")
52
52
  end
53
53
 
54
- it { proc { gateway.content }.should_not raise_error(RestClient::Unauthorized) }
54
+ it { proc { gateway.content }.should_not raise_error(Exception) }
55
55
 
56
56
  it "should parse the resource" do
57
57
  gateway.content['nome'].should == 'Barack Obama'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cadun
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.8
4
+ version: 0.5.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,11 +11,11 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2011-08-04 00:00:00.000000000Z
14
+ date: 2011-08-05 00:00:00.000000000Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
18
- requirement: &2152231800 !ruby/object:Gem::Requirement
18
+ requirement: &2152502120 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ! '>='
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 3.0.0
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *2152231800
26
+ version_requirements: *2152502120
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: builder
29
- requirement: &2152231300 !ruby/object:Gem::Requirement
29
+ requirement: &2152501620 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: 2.1.2
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *2152231300
37
+ version_requirements: *2152501620
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: rest-client
40
- requirement: &2152230920 !ruby/object:Gem::Requirement
40
+ requirement: &2152501240 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: '0'
46
46
  type: :runtime
47
47
  prerelease: false
48
- version_requirements: *2152230920
48
+ version_requirements: *2152501240
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: json
51
- requirement: &2152230460 !ruby/object:Gem::Requirement
51
+ requirement: &2152500780 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ! '>='
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: '0'
57
57
  type: :runtime
58
58
  prerelease: false
59
- version_requirements: *2152230460
59
+ version_requirements: *2152500780
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: i18n
62
- requirement: &2152230040 !ruby/object:Gem::Requirement
62
+ requirement: &2152500360 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ! '>='
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: '0'
68
68
  type: :runtime
69
69
  prerelease: false
70
- version_requirements: *2152230040
70
+ version_requirements: *2152500360
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: rake
73
- requirement: &2152229620 !ruby/object:Gem::Requirement
73
+ requirement: &2152499940 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ! '>='
@@ -78,10 +78,10 @@ dependencies:
78
78
  version: '0'
79
79
  type: :development
80
80
  prerelease: false
81
- version_requirements: *2152229620
81
+ version_requirements: *2152499940
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: rspec
84
- requirement: &2152229200 !ruby/object:Gem::Requirement
84
+ requirement: &2152499520 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - ! '>='
@@ -89,10 +89,10 @@ dependencies:
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
- version_requirements: *2152229200
92
+ version_requirements: *2152499520
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: rr
95
- requirement: &2152228780 !ruby/object:Gem::Requirement
95
+ requirement: &2152499100 !ruby/object:Gem::Requirement
96
96
  none: false
97
97
  requirements:
98
98
  - - ! '>='
@@ -100,10 +100,10 @@ dependencies:
100
100
  version: '0'
101
101
  type: :development
102
102
  prerelease: false
103
- version_requirements: *2152228780
103
+ version_requirements: *2152499100
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: fakeweb
106
- requirement: &2152228360 !ruby/object:Gem::Requirement
106
+ requirement: &2152498680 !ruby/object:Gem::Requirement
107
107
  none: false
108
108
  requirements:
109
109
  - - ! '>='
@@ -111,7 +111,7 @@ dependencies:
111
111
  version: '0'
112
112
  type: :development
113
113
  prerelease: false
114
- version_requirements: *2152228360
114
+ version_requirements: *2152498680
115
115
  description: A wrapper for the Globo.com's authentication/authorization API
116
116
  email:
117
117
  - bruno@azisaka.com.br