battlenet-api 1.0.2 → 1.0.3
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.
- checksums.yaml +4 -4
- data/lib/battlenet/api/version.rb +1 -1
- data/lib/battlenet/modules/wow/pet.rb +1 -1
- data/spec/client_spec.rb +21 -0
- data/spec/wow/character_spec.rb +0 -29
- data/spec/wow/pet_spec.rb +19 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 34bead009ea53df329c024cbc2dbc72be58a4b80
|
4
|
+
data.tar.gz: 80b7435404b703cd9af0fea335a657643e13104d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4d97c3587a13095ce282fff907632a5f4a01cff3349ec84d133a51e7a3269cf9f1911cd0af44e63a2842888a517c7e97bab182eaf6590e609fdaa15d8d12b68
|
7
|
+
data.tar.gz: 0123d7ef4845882db8083219e61db3e5dc5e194c6b4a9379116917543d544a734671a88619292d742c6996646bb351c09e3e48ca14aebd2433bc2298832ba1a2
|
data/spec/client_spec.rb
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Battlenet::Client do
|
4
|
+
|
5
|
+
before do
|
6
|
+
Battlenet.configure do |config|
|
7
|
+
config.api_key = ENV['BATTLENET_API_KEY']
|
8
|
+
config.region = :us
|
9
|
+
end
|
10
|
+
@client = Battlenet::Client.new
|
11
|
+
end
|
12
|
+
|
13
|
+
# it "should translate foreign characters for URLS (whispä)" do
|
14
|
+
# character = @client.character({realm: 'sargeras', character_name: 'Silverwinter'})
|
15
|
+
# end
|
16
|
+
#
|
17
|
+
# it "should translate spaces accurately for URLS (emerald dream)" do
|
18
|
+
# character = @client.character({:realm => 'emerald dream', :character_name => 'pftpft'})
|
19
|
+
# end
|
20
|
+
|
21
|
+
end
|
data/spec/wow/character_spec.rb
CHANGED
@@ -10,35 +10,6 @@ describe Battlenet::WOW::Character do
|
|
10
10
|
end
|
11
11
|
@wow_client = Battlenet.WOWClient
|
12
12
|
end
|
13
|
-
|
14
|
-
it "should be able to find 'Silverwinter' on 'Sargeras'" do
|
15
|
-
character = @wow_client.character({:realm => 'sargeras', :character_name => 'Silverwinter'})
|
16
|
-
VCR.use_cassette('character/profile') do
|
17
|
-
expect(character.profile['name']).to eq('Silverwinter')
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
it "should be able to find 'whispä' on 'frostmourne' (handle foreign characters)" do
|
22
|
-
character = @wow_client.character({:realm => 'frostmourne', :character_name => 'whispä'})
|
23
|
-
VCR.use_cassette('character/profile_whispä') do
|
24
|
-
expect(character.profile['name']).to eq('Whispä')
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
it "should be able to find 'pftpft' on 'emerald dream' (handle spaces)" do
|
29
|
-
character = @wow_client.character({:realm => 'emerald dream', :character_name => 'pftpft'})
|
30
|
-
VCR.use_cassette('character/profile_pft') do
|
31
|
-
expect(character.profile['name']).to eq('Pftpft')
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
it "should not be able to find 'ThisCharacterShouldntExist' on 'Sargeras'" do
|
36
|
-
character = @wow_client.character({realm: 'sargeras', character_name: 'ThisCharacterShouldntExist'})
|
37
|
-
VCR.use_cassette('character/invalid_character') do
|
38
|
-
expect(character.profile['reason']).to eq('Character not found.')
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
13
|
end
|
43
14
|
|
44
15
|
it { should respond_to(:profile) }
|
data/spec/wow/pet_spec.rb
CHANGED
@@ -2,6 +2,25 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Battlenet::WOW::Pet do
|
4
4
|
|
5
|
+
context "when looking up a species" do
|
6
|
+
before do
|
7
|
+
Battlenet.configure do |config|
|
8
|
+
config.api_key = ENV['BATTLENET_API_KEY']
|
9
|
+
config.region = :us
|
10
|
+
end
|
11
|
+
@wow_client = Battlenet.WOWClient
|
12
|
+
end
|
13
|
+
|
14
|
+
it "should be able to fetch details" do
|
15
|
+
sid = 1134
|
16
|
+
VCR.use_cassette("pet/species/#{sid}") do
|
17
|
+
species = @wow_client.pet.species(sid)
|
18
|
+
expect(species['speciesId']).to eq(sid)
|
19
|
+
expect(species).to have_key('abilities')
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
5
24
|
it { should respond_to(:master_list) }
|
6
25
|
it { should respond_to(:ability) }
|
7
26
|
it { should respond_to(:species) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: battlenet-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- goodcodeguy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httparty
|
@@ -180,6 +180,7 @@ files:
|
|
180
180
|
- lib/battlenet/modules/wow/recipe.rb
|
181
181
|
- lib/battlenet/modules/wow/spell.rb
|
182
182
|
- spec/battlenetapi_spec.rb
|
183
|
+
- spec/client_spec.rb
|
183
184
|
- spec/d3/data_spec.rb
|
184
185
|
- spec/d3/profile_spec.rb
|
185
186
|
- spec/d3client_spec.rb
|
@@ -224,12 +225,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
224
225
|
version: '0'
|
225
226
|
requirements: []
|
226
227
|
rubyforge_project:
|
227
|
-
rubygems_version: 2.
|
228
|
+
rubygems_version: 2.5.1
|
228
229
|
signing_key:
|
229
230
|
specification_version: 4
|
230
231
|
summary: Battlenet Client API
|
231
232
|
test_files:
|
232
233
|
- spec/battlenetapi_spec.rb
|
234
|
+
- spec/client_spec.rb
|
233
235
|
- spec/d3/data_spec.rb
|
234
236
|
- spec/d3/profile_spec.rb
|
235
237
|
- spec/d3client_spec.rb
|