battle_pet 0.2.9 → 0.2.10

Sign up to get free protection for your applications and to get access to all the features.
data/lib/battle_pet.rb CHANGED
@@ -69,10 +69,11 @@ class BattlePet
69
69
 
70
70
  def self.check_patch(id)
71
71
  case id
72
- when 1..864 then '5.0'
73
- when 865..1013 then '5.1'
74
- when 1014..1213 then '5.2'
75
- else '5.3'
72
+ when 1226..1248, 1184, 1200, 1205 then '5.3'
73
+ when 1174..1213 then '5.2'
74
+ when 868..1168 then '5.1'
75
+ when 1..864 then '5.0'
76
+ else 'unknown'
76
77
  end
77
78
  end
78
79
 
@@ -30,9 +30,9 @@ class BattlePetTest < Test::Unit::TestCase
30
30
 
31
31
  def test_check_patch
32
32
  (1..864).to_a.sample(5) { |i| assert_equal '5.0', BattlePet.check_patch(i) }
33
- (865..1013).to_a.sample(5) { |i| assert_equal '5.1', BattlePet.check_patch(i) }
34
- (1014..1213).to_a.sample(5) { |i| assert_equal '5.2', BattlePet.check_patch(i) }
35
- (1213..1400).to_a.sample(5) { |i| assert_equal '5.3', BattlePet.check_patch(i) }
33
+ (868..1168).to_a.sample(5) { |i| assert_equal '5.1', BattlePet.check_patch(i) }
34
+ ((1174..1213).to_a - [1184, 1200, 1205]).sample(5) { |i| assert_equal '5.2', BattlePet.check_patch(i) }
35
+ [(1226..1248).to_a, 1184, 1200, 1205].flatten.sample(5) { |i| assert_equal '5.3', BattlePet.check_patch(i) }
36
36
  end
37
37
 
38
38
  def test_parse_source
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: battle_pet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.9
4
+ version: 0.2.10
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-06-14 00:00:00.000000000 Z
12
+ date: 2013-06-22 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A simple gem to get data from WoW BattlePet API
15
15
  email: zwt315@163.com