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 +4 -4
- data/lib/wow/features/character_profile.rb +7 -0
- data/lib/wow/version.rb +1 -1
- data/spec/features/character_profile_spec.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e57690e52632a1d8f631ab3faab9e626d49506a
|
4
|
+
data.tar.gz: db53cfe90b6dadb0a30da15dddb61f9cf23c86b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
@@ -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.
|
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-
|
11
|
+
date: 2014-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|