wow 0.0.2 → 0.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: a459381f372b915a5ef250d8d89e7b0b6efa5f4b
4
- data.tar.gz: 83d7cd9c31aceb3a72833b46861167ddb0d676aa
3
+ metadata.gz: 6e57690e52632a1d8f631ab3faab9e626d49506a
4
+ data.tar.gz: db53cfe90b6dadb0a30da15dddb61f9cf23c86b3
5
5
  SHA512:
6
- metadata.gz: 4ab1380abba450a73d3915866b1661ea3623ec2e861df3916d3d11af7e6986b60d8f65d8ccf0b7010c03a038044a6903c25fb082aa9a971c5011bde26cb73d94
7
- data.tar.gz: 67d43dbfbb9d9cbcc1af64c86afc57f73d83b540d23c83bae172306e6486e4c62d0780fd2bdf39d195ba439af657e143cfaa09c7ae4fa6545ddd884246c207b1
6
+ metadata.gz: 67e3f24949de0b24f669d30e0e204f925ba6ad648fc14fe586b5656c3febb799bcce25c4d05ae7721fa0df51b076aaffbe3959c58566347aa153299947e109c9
7
+ data.tar.gz: 8b3d27db5fa1ddcfab0271ee5fd4f3beb7ef13abd30521d999beceee7eccff5d957cd127053d0d28de08390466c878bd8041cf1aeb8a15f1545425e22bb6d5bc
@@ -17,6 +17,13 @@ module WoW
17
17
  base_uri "#{WoW.host}/api/wow/character"
18
18
 
19
19
  def initialize(realm, character_name, fields = [], params = {})
20
+ if realm.to_s.empty?
21
+ raise WoW::APIError.new "Realm cannot be blank"
22
+ end
23
+ if character_name.to_s.empty?
24
+ raise WoW::APIError.new "Character name cannot be blank"
25
+ end
26
+
20
27
  params = params.merge({fields: fields.join(',')})
21
28
  super(self.class.data(realm, character_name, params))
22
29
  end
data/lib/wow/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module WoW
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -33,6 +33,18 @@ describe WoW::CharacterProfile do
33
33
  WoW::CharacterProfile.new("Notaserver", "Imnotaguyatalllolplz")
34
34
  }.to raise_error
35
35
  end
36
+
37
+ it "raises WoW::APIError when given nil or server" do
38
+ expect {
39
+ WoW::CharacterProfile.new(nil, "Imnotaguyatalllolplz")
40
+ }.to raise_error(WoW::APIError)
41
+ end
42
+
43
+ it "raises WoW::APIError when given blank or server" do
44
+ expect {
45
+ WoW::CharacterProfile.new("", "Imnotaguyatalllolplz")
46
+ }.to raise_error(WoW::APIError)
47
+ end
36
48
  end
37
49
 
38
50
  describe "#lookup" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Lilienthal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-22 00:00:00.000000000 Z
11
+ date: 2014-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler