d3api 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,51 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://us.battle.net/api/d3/data/item/ChkIsp-JsQsSBwgEFRaK1aUwCTiYBEAAYJgEGNPX06ILUAhYAA
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers: {}
10
+ response:
11
+ status:
12
+ code: 200
13
+ message:
14
+ headers:
15
+ date:
16
+ - Thu, 10 Jan 2013 00:51:23 GMT
17
+ server:
18
+ - Apache
19
+ x-frame-options:
20
+ - SAMEORIGIN
21
+ last-modified:
22
+ - Fri, 12 Oct 2012 12:30:08 GMT
23
+ content-language:
24
+ - en-US
25
+ vary:
26
+ - Accept-Encoding
27
+ connection:
28
+ - close
29
+ transfer-encoding:
30
+ - chunked
31
+ content-type:
32
+ - application/json;charset=UTF-8
33
+ body:
34
+ encoding: ASCII-8BIT
35
+ string: !binary |-
36
+ ewoiaWQiIDogIlBhbnRzXzAwMSIsCiJuYW1lIiA6ICJDbG90aCBQYW50cyIs
37
+ CiJpY29uIiA6ICJwYW50c18wMDFfbW9ua19tYWxlIiwKImRpc3BsYXlDb2xv
38
+ ciIgOiAid2hpdGUiLAoidG9vbHRpcFBhcmFtcyIgOiAiaXRlbS9DaGtJc3At
39
+ SnNRc1NCd2dFRlJhSzFhVXdDVGlZQkVBQVlKZ0VHTlBYMDZJTFVBaFlBQSIs
40
+ CiJyZXF1aXJlZExldmVsIiA6IDEsCiJpdGVtTGV2ZWwiIDogMiwKImJvbnVz
41
+ QWZmaXhlcyIgOiAwLAoidHlwZU5hbWUiIDogIlBhbnRzIiwKInR5cGUiIDog
42
+ ewoiaWQiIDogIkxlZ3MiLAoidHdvSGFuZGVkIiA6IGZhbHNlCn0sCiJhcm1v
43
+ ciIgOiB7CiJtaW4iIDogNi4wLAoibWF4IiA6IDYuMAp9LAoiYXR0cmlidXRl
44
+ cyIgOiBbIF0sCiJhdHRyaWJ1dGVzUmF3IiA6IHsKIkR1cmFiaWxpdHlfTWF4
45
+ IiA6IHsKIm1pbiIgOiA1MzYuMCwKIm1heCIgOiA1MzYuMAp9LAoiQXJtb3Jf
46
+ SXRlbSIgOiB7CiJtaW4iIDogNi4wLAoibWF4IiA6IDYuMAp9LAoiRHVyYWJp
47
+ bGl0eV9DdXIiIDogewoibWluIiA6IDUzNi4wLAoibWF4IiA6IDUzNi4wCn0K
48
+ fSwKInNvY2tldEVmZmVjdHMiIDogWyBdLAoiZ2VtcyIgOiBbIF0KfQ==
49
+ http_version:
50
+ recorded_at: Thu, 10 Jan 2013 00:51:26 GMT
51
+ recorded_with: VCR 2.4.0
Binary file
@@ -0,0 +1,31 @@
1
+ require 'spec_helper'
2
+
3
+ describe D3api::Artisan, '.new' do
4
+ use_vcr_cassette
5
+
6
+ it 'returns a response' do
7
+ @artisan = D3api::Artisan.new(:us, 'blacksmith')
8
+ @artisan.should_not be_nil
9
+ end
10
+ end
11
+
12
+ describe D3api::Artisan, 'top level hash methods from BaseModel' do
13
+ subject { @artisan = D3api::Artisan.new(:us, 'blacksmith') }
14
+ use_vcr_cassette
15
+
16
+ it 'returns an array for .training' do
17
+ subject.training.should be_kind_of(Array)
18
+ end
19
+
20
+ it 'returns a string for .slug' do
21
+ subject.slug.should be_kind_of(String)
22
+ end
23
+
24
+ it 'returns a string for .name' do
25
+ subject.name.should be_kind_of(String)
26
+ end
27
+
28
+ it 'returns a string for .potrait' do
29
+ subject.potrait.should be_kind_of(String)
30
+ end
31
+ end
@@ -0,0 +1,59 @@
1
+ require 'spec_helper'
2
+
3
+ describe D3api::Career, '.new' do
4
+ use_vcr_cassette
5
+
6
+ it 'returns a response' do
7
+ @career = D3api::Career.new(:us, 'yojymbu', '1249')
8
+ @career.should_not be_nil
9
+ end
10
+ end
11
+
12
+ describe D3api::Career, 'top level hash methods from BaseModel' do
13
+ use_vcr_cassette
14
+ subject { @career = D3api::Career.new(:us, 'yojymbu', '1249') }
15
+
16
+ it 'returns an array for .heroes' do
17
+ subject.heroes.should be_kind_of(Array)
18
+ end
19
+
20
+ it 'returns a hero id for .lastHeroPlayed' do
21
+ subject.lastHeroPlayed.to_i.should be_kind_of(Integer)
22
+ end
23
+
24
+ it 'returns a string of numbers for .lastUpdated' do
25
+ subject.lastUpdated.should be_kind_of(Integer)
26
+ end
27
+
28
+ it 'returns an array for .artisans' do
29
+ subject.artisans.should be_kind_of(Array)
30
+ end
31
+
32
+ it 'returns an array for .hardcoreArtisans' do
33
+ subject.hardcoreArtisans.should be_kind_of(Array)
34
+ end
35
+
36
+ it 'returns a hash for .kills' do
37
+ subject.kills.should be_kind_of(Hash)
38
+ end
39
+
40
+ it 'returns a hash for .timePlayed' do
41
+ subject.timePlayed.should be_kind_of(Hash)
42
+ end
43
+
44
+ it 'returns an array for .fallenHeroes' do
45
+ subject.fallenHeroes.should be_kind_of(Array)
46
+ end
47
+
48
+ it 'returns a string for .battleTag' do
49
+ subject.battleTag.should be_kind_of(String)
50
+ end
51
+
52
+ it 'returns an array for .progression' do
53
+ subject.progression.should be_kind_of(Array)
54
+ end
55
+
56
+ it 'returns an array for .hardcoreProgression' do
57
+ subject.hardcoreProgression.should be_kind_of(Array)
58
+ end
59
+ end
@@ -0,0 +1,10 @@
1
+ require 'spec_helper'
2
+
3
+ describe D3api::Follower, '.new' do
4
+ use_vcr_cassette
5
+
6
+ it 'returns a response' do
7
+ @follower = D3api::Follower.new
8
+ @follower.should_not be_nil
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ require 'spec_helper'
2
+
3
+ describe D3api::Hero, '.new' do
4
+ use_vcr_cassette
5
+
6
+ it 'returns a response' do
7
+ @hero = D3api::Hero.new(:us, 'yojymbu', '1249', '30255685')
8
+ @hero.should_not be_nil
9
+ end
10
+ end
@@ -0,0 +1,10 @@
1
+ require 'spec_helper'
2
+
3
+ describe D3api::Item, '.new' do
4
+ use_vcr_cassette
5
+
6
+ it 'returns a response' do
7
+ @item = D3api::Item.new(:us, 'ChkIsp-JsQsSBwgEFRaK1aUwCTiYBEAAYJgEGNPX06ILUAhYAA')
8
+ @item.should_not be_nil
9
+ end
10
+ end
@@ -0,0 +1,14 @@
1
+ require 'd3api'
2
+ require 'rspec'
3
+ require 'vcr'
4
+
5
+ VCR.configure do |config|
6
+ config.cassette_library_dir = 'spec/cassettes'
7
+ config.hook_into :faraday
8
+ config.default_cassette_options = { :record => :new_episodes, :erb => true }
9
+ end
10
+
11
+ RSpec.configure do |config|
12
+ config.extend VCR::RSpec::Macros
13
+ config.mock_with :rspec
14
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: d3api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-09 00:00:00.000000000 Z
12
+ date: 2013-01-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday
@@ -43,6 +43,22 @@ dependencies:
43
43
  - - ~>
44
44
  - !ruby/object:Gem::Version
45
45
  version: 0.9.0
46
+ - !ruby/object:Gem::Dependency
47
+ name: rake
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ~>
52
+ - !ruby/object:Gem::Version
53
+ version: 10.0.3
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: 10.0.3
46
62
  - !ruby/object:Gem::Dependency
47
63
  name: rspec
48
64
  requirement: !ruby/object:Gem::Requirement
@@ -59,6 +75,22 @@ dependencies:
59
75
  - - '='
60
76
  - !ruby/object:Gem::Version
61
77
  version: 2.12.0
78
+ - !ruby/object:Gem::Dependency
79
+ name: vcr
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ~>
84
+ - !ruby/object:Gem::Version
85
+ version: 2.4.0
86
+ type: :development
87
+ prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 2.4.0
62
94
  description: Diablo 3 API ruby wrapper
63
95
  email:
64
96
  - phereford@gmail.com
@@ -67,6 +99,7 @@ extensions: []
67
99
  extra_rdoc_files: []
68
100
  files:
69
101
  - .gitignore
102
+ - .travis.yml
70
103
  - Gemfile
71
104
  - LICENSE.txt
72
105
  - README.md
@@ -85,6 +118,19 @@ files:
85
118
  - lib/d3api/item.rb
86
119
  - lib/d3api/request.rb
87
120
  - lib/d3api/version.rb
121
+ - spec/.DS_Store
122
+ - spec/cassettes/D3api_Artisan.yml
123
+ - spec/cassettes/D3api_Career.yml
124
+ - spec/cassettes/D3api_Follower.yml
125
+ - spec/cassettes/D3api_Hero.yml
126
+ - spec/cassettes/D3api_Item.yml
127
+ - spec/d3api/.DS_Store
128
+ - spec/d3api/artisan_spec.rb
129
+ - spec/d3api/career_spec.rb
130
+ - spec/d3api/follower_spec.rb
131
+ - spec/d3api/hero_spec.rb
132
+ - spec/d3api/item_spec.rb
133
+ - spec/spec_helper.rb
88
134
  homepage: https://github.com/phereford/d3api
89
135
  licenses: []
90
136
  post_install_message:
@@ -97,16 +143,35 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
143
  - - ! '>='
98
144
  - !ruby/object:Gem::Version
99
145
  version: '0'
146
+ segments:
147
+ - 0
148
+ hash: 796898765737275423
100
149
  required_rubygems_version: !ruby/object:Gem::Requirement
101
150
  none: false
102
151
  requirements:
103
152
  - - ! '>='
104
153
  - !ruby/object:Gem::Version
105
154
  version: '0'
155
+ segments:
156
+ - 0
157
+ hash: 796898765737275423
106
158
  requirements: []
107
159
  rubyforge_project:
108
160
  rubygems_version: 1.8.24
109
161
  signing_key:
110
162
  specification_version: 3
111
- summary: Blizzards D3 API
112
- test_files: []
163
+ summary: Blizzard's Diablo 3 API
164
+ test_files:
165
+ - spec/.DS_Store
166
+ - spec/cassettes/D3api_Artisan.yml
167
+ - spec/cassettes/D3api_Career.yml
168
+ - spec/cassettes/D3api_Follower.yml
169
+ - spec/cassettes/D3api_Hero.yml
170
+ - spec/cassettes/D3api_Item.yml
171
+ - spec/d3api/.DS_Store
172
+ - spec/d3api/artisan_spec.rb
173
+ - spec/d3api/career_spec.rb
174
+ - spec/d3api/follower_spec.rb
175
+ - spec/d3api/hero_spec.rb
176
+ - spec/d3api/item_spec.rb
177
+ - spec/spec_helper.rb