battlenet-api 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab8afa30b56711ba085a8b2d4abcd13da587f77b
4
- data.tar.gz: 21e951ae124811bfe7261c0e8b195ee97cae8b89
3
+ metadata.gz: 34bead009ea53df329c024cbc2dbc72be58a4b80
4
+ data.tar.gz: 80b7435404b703cd9af0fea335a657643e13104d
5
5
  SHA512:
6
- metadata.gz: 4d33baacbd01a4fde3e6d075d9adca265bebc3635b23245e6a8267b82dbfdadf5f01f19ec7e61a565e1cb17e42f4778b75fe5571ee95124491b0510a0b5980fa
7
- data.tar.gz: ee3d9b68ac2c67834d51b9701ac4fb753cb178289a022c745aec884643834eba80e51fc3d6c17caa4b542b510c622eefbdd1972513c3338ebd3bdd8e88cc0fe9
6
+ metadata.gz: d4d97c3587a13095ce282fff907632a5f4a01cff3349ec84d133a51e7a3269cf9f1911cd0af44e63a2842888a517c7e97bab182eaf6590e609fdaa15d8d12b68
7
+ data.tar.gz: 0123d7ef4845882db8083219e61db3e5dc5e194c6b4a9379116917543d544a734671a88619292d742c6996646bb351c09e3e48ca14aebd2433bc2298832ba1a2
@@ -1,5 +1,5 @@
1
1
  module Battlenet
2
2
  module Api
3
- VERSION = "1.0.2"
3
+ VERSION = "1.0.3"
4
4
  end
5
5
  end
@@ -3,7 +3,7 @@ module Battlenet
3
3
  class Pet < Battlenet::APIResponse
4
4
 
5
5
  def initialize(options={})
6
- @endpoint = "/wow/pet"
6
+ @endpoint = "/pet"
7
7
  super(options)
8
8
  end
9
9
 
@@ -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
@@ -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) }
@@ -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.2
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-01-18 00:00:00.000000000 Z
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.4.5.1
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