wot_api_ru 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53225c2c1ce2762a15029a41e014dc9173492146
4
- data.tar.gz: f54829d42104889bfa5b31c9e153b676a484212a
3
+ metadata.gz: 015e79bfe20d833906c92aba519a451b75dfba50
4
+ data.tar.gz: 67135721d0606a3550cd597b8db267f37b4dbdb6
5
5
  SHA512:
6
- metadata.gz: a94f6a6504287f9dc9b7ba82c0588196b7175dd5dd17bfeaf572ca0aedc5ac9bb7590419d830d9f61b646c99904f1e76c20032f902a1cde7f09a58b0783fc8d9
7
- data.tar.gz: 8bd540fdd8b4f9ca5f45d03487857211deb6dd5107456c387aaf59ba3d5ee8c2f3d75b894c09c05df46cb514bf23c33acafef10f9e9fc735928035622490cd29
6
+ metadata.gz: e7cdb11d46943bfe8e2ab0817f1bc87a1b3f27398895a4a7666f9e3c9136ab6048213876b16902245a69eaaa19d1d8abfab9b45c9642e112a386280a212792c7
7
+ data.tar.gz: a322809d1c13c704c62085fd8c0f02ded4a266c2717eaedaf3b0a17d71262c15285201468a1b45ff648c2b301db0e26f337d47bfe0741537eea9e5479184a748
data/.rspec CHANGED
@@ -1,3 +1 @@
1
1
  --color
2
- --warnings
3
- --require spec_helper
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- wot_api_ru (0.1.0)
4
+ wot_api_ru (0.1.1)
5
5
  rails (~> 4.1, >= 4.1.4)
6
6
  rest_client (~> 1.7, >= 1.7.3)
7
7
 
@@ -45,6 +45,9 @@ GEM
45
45
  diff-lcs (1.2.5)
46
46
  docile (1.1.5)
47
47
  erubis (2.7.0)
48
+ generator_spec (0.9.2)
49
+ activesupport (>= 3.0.0)
50
+ railties (>= 3.0.0)
48
51
  hike (1.2.3)
49
52
  i18n (0.6.11)
50
53
  json (1.8.1)
@@ -128,6 +131,7 @@ PLATFORMS
128
131
 
129
132
  DEPENDENCIES
130
133
  coveralls (~> 0.7, >= 0.7.0)
134
+ generator_spec (~> 0.9, >= 0.9.2)
131
135
  rspec-rails (~> 3.0, >= 3.0.1)
132
136
  sqlite3 (~> 1.3, >= 1.3.9)
133
137
  wot_api_ru!
data/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  WotApiRu
2
2
  =======
3
- [![Gem Version](https://badge.fury.io/rb/wot_api_ru.png)](http://badge.fury.io/rb/wot_api_ru)
3
+ [![Gem Version](https://badge.fury.io/rb/wot_api_ru.svg)](http://badge.fury.io/rb/wot_api_ru)
4
4
  [![Code Climate](https://codeclimate.com/github/shved270189/wot_api_ru.png)](https://codeclimate.com/github/shved270189/wot_api_ru)
5
5
  [![Dependency Status](https://gemnasium.com/shved270189/wot_api_ru.svg)](https://gemnasium.com/shved270189/wot_api_ru)
6
6
  [![Build Status](https://travis-ci.org/shved270189/wot_api_ru.svg?branch=master)](https://travis-ci.org/shved270189/wot_api_ru)
7
- [![Coverage Status](https://coveralls.io/repos/shved270189/wot_api_ru/badge.png?branch=master)](https://coveralls.io/r/shved270189/wot_api_ru?branch=master)
7
+ [![Coverage Status](https://img.shields.io/coveralls/shved270189/wot_api_ru.svg)](https://coveralls.io/r/shved270189/wot_api_ru?branch=master)
8
8
  [![PullReview stats](https://www.pullreview.com/github/shved270189/wot_api_ru/badges/master.svg?)](https://www.pullreview.com/github/shved270189/wot_api_ru/reviews/master)
9
9
 
10
10
  Ruby gem for [Wargaming.net Public API](http://ru.wargaming.net/developers/documentation/guide/getting-started/)
@@ -39,7 +39,7 @@ After this steps you can create WotApiRu client and call to Wargaming.net Public
39
39
  client = WotApiRu::Client.new
40
40
  client.account_list(search: 'saltovka')
41
41
  ```
42
- All API's method you can see on [API dicumentation](http://ru.wargaming.net/developers/api_reference).
42
+ All API's method you can see on [API documentation](http://ru.wargaming.net/developers/api_reference).
43
43
  If you want call [api.worldoftanks.ru/wot/account/list](http://ru.wargaming.net/developers/api_reference/wot/account/list/) then you can use WotApiRu::Client#account_list with parameters of API etc.
44
44
 
45
45
  ## License
@@ -3,16 +3,16 @@ require 'rails/generators'
3
3
  module WotApiRu
4
4
  class InstallGenerator < Rails::Generators::Base
5
5
  include Rails::Generators::ResourceHelpers
6
- desc "Some description of my generator here"
6
+ desc 'Generate initialize file of wot_api_ru'
7
7
 
8
8
  def name
9
- "wot_api_ru"
9
+ 'wot_api_ru'
10
10
  end
11
11
 
12
- source_root File.expand_path("../templates", __FILE__)
12
+ source_root File.expand_path('../templates', __FILE__)
13
13
 
14
14
  def copy_initializer_file
15
- copy_file "wot_api_ru.rb", "config/initializers/wot_api_ru.rb"
15
+ copy_file 'wot_api_ru.rb', 'config/initializers/wot_api_ru.rb'
16
16
  end
17
17
  end
18
18
  end
@@ -4,10 +4,9 @@ require 'rest_client'
4
4
 
5
5
  module WotApiRu
6
6
  class Client
7
-
8
7
  def method_missing(meth, *args, &block)
9
8
  raise NoMethodError, "undefined method #{meth} for #{self.class.to_s}" if WotApiRu::Constants::PATH[meth.to_sym].nil?
10
- options = args[0]
9
+ options = args[0] || {}
11
10
  options[:application_id] ||= WotApiRu::Settings[:application_id]
12
11
  path = WotApiRu::Constants::HOST + WotApiRu::Constants::PATH[meth.to_sym]
13
12
  invoke(path, options)
@@ -1,6 +1,5 @@
1
1
  module WotApiRu
2
2
  module Constants
3
-
4
3
  HOST = 'https://api.worldoftanks.ru/wot/'
5
4
 
6
5
  PATH = {
@@ -9,82 +8,82 @@ module WotApiRu
9
8
  # require: search
10
9
  account_list: 'account/list/',
11
10
  # require: account_id
12
- account_info: 'account/info',
11
+ account_info: 'account/info/',
13
12
  # require: account_id
14
- account_tanks: 'account/tanks',
13
+ account_tanks: 'account/tanks/',
15
14
  # require: account_id
16
- account_achievements: 'account/achievements',
15
+ account_achievements: 'account/achievements/',
17
16
 
18
17
  # TODO uncomment when complete authentication
19
18
  # auth_login: 'auth/login',
20
19
  # require: access_token
21
- auth_prolongate: 'auth/prolongate',
20
+ auth_prolongate: 'auth/prolongate/',
22
21
  # require: access_token
23
- auth_logout: 'auth/logout',
22
+ auth_logout: 'auth/logout/',
24
23
 
25
- clan_list: 'clan/list',
24
+ clan_list: 'clan/list/',
26
25
  # require: clan_id
27
- clan_info: 'clan/info',
26
+ clan_info: 'clan/info/',
28
27
  # TODO method should be disable
29
28
  # require: clan_id
30
- clan_battles: 'clan/battles',
31
- clan_top: 'clan/top',
29
+ clan_battles: 'clan/battles/',
30
+ clan_top: 'clan/top/',
32
31
  # require: clan_id
33
- clan_provinces: 'clan/provinces',
32
+ clan_provinces: 'clan/provinces/',
34
33
  # TODO method should be disable
35
34
  # require: clan_id
36
- clan_victorypoints: 'clan/victorypoints',
35
+ clan_victorypoints: 'clan/victorypoints/',
37
36
  # TODO method should be disable
38
37
  # require: clan_id
39
- clan_victorypointshistory: 'clan/victorypointshistory',
38
+ clan_victorypointshistory: 'clan/victorypointshistory/',
40
39
  # require: member_id
41
- clan_membersinfo: 'clan/membersinfo',
40
+ clan_membersinfo: 'clan/membersinfo/',
42
41
 
43
42
  # require: map_id
44
- globalwar_clans: 'globalwar/clans',
43
+ globalwar_clans: 'globalwar/clans/',
45
44
  # require: map_id, account_id
46
- globalwar_famepoints: 'globalwar/famepoints',
47
- globalwar_maps: 'globalwar/maps',
45
+ globalwar_famepoints: 'globalwar/famepoints/',
46
+ globalwar_maps: 'globalwar/maps/',
48
47
  # require: map_id
49
- globalwar_provinces: 'globalwar/provinces',
48
+ globalwar_provinces: 'globalwar/provinces/',
50
49
  # require: map_id, order_by
51
- globalwar_top: 'globalwar/top',
50
+ globalwar_top: 'globalwar/top/',
52
51
  # require: map_id, province_id
53
- globalwar_tournaments: 'globalwar/tournaments',
52
+ globalwar_tournaments: 'globalwar/tournaments/',
54
53
  # require: map_id, access_token
55
- globalwar_famepointshistory: 'globalwar/famepointshistory',
54
+ globalwar_famepointshistory: 'globalwar/famepointshistory/',
56
55
  # require: map_id
57
- globalwar_alleyoffame: 'globalwar/alleyoffame',
56
+ globalwar_alleyoffame: 'globalwar/alleyoffame/',
58
57
  # require: map_id, clan_id
59
- globalwar_battles: 'globalwar/battles',
58
+ globalwar_battles: 'globalwar/battles/',
60
59
  # require: map_id, clan_id
61
- globalwar_victorypointshistory: 'globalwar/victorypointshistory',
60
+ globalwar_victorypointshistory: 'globalwar/victorypointshistory/',
62
61
 
63
- encyclopedia_tanks: 'encyclopedia/tanks',
62
+ encyclopedia_tanks: 'encyclopedia/tanks/',
64
63
  # require: tank_id
65
- encyclopedia_tankinfo: 'encyclopedia/tankinfo',
66
- encyclopedia_tankengines: 'encyclopedia/tankengines',
67
- encyclopedia_tankturrets: 'encyclopedia/tankturrets',
68
- encyclopedia_tankradios: 'encyclopedia/tankradios',
69
- encyclopedia_tankchassis: 'encyclopedia/tankchassis',
70
- encyclopedia_tankguns: 'encyclopedia/tankguns',
71
- encyclopedia_achievements: 'encyclopedia/achievements',
72
- encyclopedia_info: 'encyclopedia/info',
64
+ encyclopedia_tankinfo: 'encyclopedia/tankinfo/',
65
+ encyclopedia_tankengines: 'encyclopedia/tankengines/',
66
+ encyclopedia_tankturrets: 'encyclopedia/tankturrets/',
67
+ encyclopedia_tankradios: 'encyclopedia/tankradios/',
68
+ encyclopedia_tankchassis: 'encyclopedia/tankchassis/',
69
+ encyclopedia_tankguns: 'encyclopedia/tankguns/',
70
+ encyclopedia_achievements: 'encyclopedia/achievements/',
71
+ encyclopedia_info: 'encyclopedia/info/',
73
72
 
74
- ratings_types: 'ratings/types',
73
+ ratings_types: 'ratings/types/',
75
74
  # require: account_id, type
76
- ratings_accounts: 'ratings/accounts',
75
+ ratings_accounts: 'ratings/accounts/',
77
76
  # require: account_id, type, rank_field
78
- ratings_neighbors: 'ratings/neighbors',
77
+ ratings_neighbors: 'ratings/neighbors/',
79
78
  # require: type, rank_field
80
- ratings_top: 'ratings/top',
79
+ ratings_top: 'ratings/top/',
81
80
  # require: type
82
- ratings_dates: 'ratings/dates',
81
+ ratings_dates: 'ratings/dates/',
83
82
 
84
83
  # require: account_id
85
- tanks_stats: 'tanks/stats',
84
+ tanks_stats: 'tanks/stats/',
86
85
  # require: account_id
87
- tanks_achievements: 'tanks/achievements'
86
+ tanks_achievements: 'tanks/achievements/'
88
87
  }
89
88
  end
90
89
  end
@@ -1,15 +1,14 @@
1
1
  module WotApiRu
2
2
  class Settings
3
-
4
- @@options = Hash.new
3
+ @options = Hash.new
5
4
 
6
5
  class << self
7
6
  def [](ind)
8
- @@options[ind.to_sym]
7
+ @options[ind.to_sym]
9
8
  end
10
9
 
11
10
  def []=(ind, val)
12
- @@options[ind.to_sym] = val.to_s
11
+ @options[ind.to_sym] = val.to_s
13
12
  end
14
13
  end
15
14
  end
@@ -1,3 +1,3 @@
1
1
  module WotApiRu
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
@@ -1,3 +1 @@
1
1
  --color
2
- --warnings
3
- --require spec_helper
@@ -26,4 +26,3 @@ module Dummy
26
26
  # config.i18n.default_locale = :de
27
27
  end
28
28
  end
29
-
@@ -0,0 +1,22 @@
1
+ require 'rails_helper'
2
+ require 'generator_spec'
3
+
4
+ describe WotApiRu::InstallGenerator do
5
+ let(:wot_api_ru_gen) { WotApiRu::InstallGenerator.new }
6
+ destination File.expand_path("../../../../dummy/tmp/spec", __FILE__)
7
+
8
+ before(:all) do
9
+ prepare_destination
10
+ run_generator
11
+ end
12
+
13
+ it 'creates a wot_api_ru initializer' do
14
+ expect = %|# Set your application Wargaming key here!
15
+ WotApiRu::Settings[:application_id] = ENV['WOT_API_RU_APP_ID']|
16
+ assert_file "config/initializers/wot_api_ru.rb", expect
17
+ end
18
+
19
+ it 'should have method name' do
20
+ expect(wot_api_ru_gen).to respond_to(:name)
21
+ end
22
+ end
@@ -0,0 +1,105 @@
1
+ require 'rails_helper'
2
+
3
+ describe WotApiRu::Client do
4
+ let(:client) { WotApiRu::Client.new }
5
+
6
+ context 'account' do
7
+ context 'list' do
8
+ let(:params_right) { { search: 'saltovka' } }
9
+ let(:params_wrong) { { search: 'ss' } }
10
+ let(:client_right) { client.account_list(params_right) }
11
+ let(:client_wrong) { client.account_list(params_wrong) }
12
+ let(:client_without_params) { client.account_list() }
13
+
14
+ context 'with rigth params' do
15
+ it 'should be hash' do
16
+ expect(client_right).to be_instance_of(Hash)
17
+ end
18
+
19
+ it 'should be status ok' do
20
+ expect(client_right).to include('status' => 'ok')
21
+ end
22
+
23
+ it 'should have count' do
24
+ expect(client_right).to have_key('count')
25
+ end
26
+
27
+ it 'should have data' do
28
+ expect(client_right).to have_key('data')
29
+ end
30
+
31
+ it 'should be data is array' do
32
+ expect(client_right['data']).to be_instance_of(Array)
33
+ end
34
+ end
35
+
36
+ context 'with wrong params' do
37
+ it 'should be hash' do
38
+ expect(client_wrong).to be_instance_of(Hash)
39
+ end
40
+
41
+ it 'should be status error' do
42
+ expect(client_wrong).to include('status' => 'error')
43
+ end
44
+
45
+ it 'should have error' do
46
+ expect(client_wrong).to have_key('error')
47
+ end
48
+
49
+ context 'error' do
50
+ let(:error) { client_wrong['error'] }
51
+
52
+ it 'should be field is search' do
53
+ expect(error).to include('field' => 'search')
54
+ end
55
+
56
+ it 'should be message is NOT_ENOUGH_SEARCH_LENGTH' do
57
+ expect(error).to include('message' => 'NOT_ENOUGH_SEARCH_LENGTH')
58
+ end
59
+
60
+ it 'should be code 407' do
61
+ expect(error).to include('code' => 407)
62
+ end
63
+
64
+ it 'should have value' do
65
+ expect(error).to have_key('value')
66
+ end
67
+ end
68
+ end
69
+
70
+ context 'without params' do
71
+ it 'should be hash' do
72
+ expect(client_without_params).to be_instance_of(Hash)
73
+ end
74
+
75
+ it 'should be status error' do
76
+ expect(client_without_params).to include('status' => 'error')
77
+ end
78
+
79
+ it 'should have error' do
80
+ expect(client_without_params).to have_key('error')
81
+ end
82
+
83
+ context 'error' do
84
+ let(:error) { client_without_params['error'] }
85
+
86
+ it 'should be field is search' do
87
+ expect(error).to include('field' => 'search')
88
+ end
89
+
90
+ it 'should be message is SEARCH_NOT_SPECIFIED' do
91
+ expect(error).to include('message' => 'SEARCH_NOT_SPECIFIED')
92
+ end
93
+
94
+ it 'should be code 402' do
95
+ expect(error).to include('code' => 402)
96
+ end
97
+
98
+ it 'should have value' do
99
+ expect(error).to have_key('value')
100
+ end
101
+ end
102
+ end
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,9 @@
1
+ require 'rails_helper'
2
+
3
+ describe WotApiRu::Client do
4
+ let(:client) { WotApiRu::Client.new }
5
+
6
+ it 'should have method_missing' do
7
+ expect(client).to respond_to(:method_missing)
8
+ end
9
+ end
@@ -1,49 +1,48 @@
1
- require 'spec_helper'
2
- require 'wot_api_ru'
1
+ require 'rails_helper'
3
2
 
4
3
  describe WotApiRu::Constants do
5
4
  it { expect(WotApiRu::Constants::HOST).to eq 'https://api.worldoftanks.ru/wot/' }
6
5
 
7
6
  context 'PATH' do
8
7
  it { expect(WotApiRu::Constants::PATH[:account_list]).to eq 'account/list/' }
9
- it { expect(WotApiRu::Constants::PATH[:account_info]).to eq 'account/info' }
10
- it { expect(WotApiRu::Constants::PATH[:account_tanks]).to eq 'account/tanks' }
11
- it { expect(WotApiRu::Constants::PATH[:account_achievements]).to eq 'account/achievements' }
12
- it { expect(WotApiRu::Constants::PATH[:auth_prolongate]).to eq 'auth/prolongate' }
13
- it { expect(WotApiRu::Constants::PATH[:auth_logout]).to eq 'auth/logout' }
14
- it { expect(WotApiRu::Constants::PATH[:clan_list]).to eq 'clan/list' }
15
- it { expect(WotApiRu::Constants::PATH[:clan_info]).to eq 'clan/info' }
16
- it { expect(WotApiRu::Constants::PATH[:clan_battles]).to eq 'clan/battles' }
17
- it { expect(WotApiRu::Constants::PATH[:clan_top]).to eq 'clan/top' }
18
- it { expect(WotApiRu::Constants::PATH[:clan_provinces]).to eq 'clan/provinces' }
19
- it { expect(WotApiRu::Constants::PATH[:clan_victorypoints]).to eq 'clan/victorypoints' }
20
- it { expect(WotApiRu::Constants::PATH[:clan_victorypointshistory]).to eq 'clan/victorypointshistory' }
21
- it { expect(WotApiRu::Constants::PATH[:clan_membersinfo]).to eq 'clan/membersinfo' }
22
- it { expect(WotApiRu::Constants::PATH[:globalwar_clans]).to eq 'globalwar/clans' }
23
- it { expect(WotApiRu::Constants::PATH[:globalwar_famepoints]).to eq 'globalwar/famepoints' }
24
- it { expect(WotApiRu::Constants::PATH[:globalwar_maps]).to eq 'globalwar/maps' }
25
- it { expect(WotApiRu::Constants::PATH[:globalwar_provinces]).to eq 'globalwar/provinces' }
26
- it { expect(WotApiRu::Constants::PATH[:globalwar_top]).to eq 'globalwar/top' }
27
- it { expect(WotApiRu::Constants::PATH[:globalwar_tournaments]).to eq 'globalwar/tournaments' }
28
- it { expect(WotApiRu::Constants::PATH[:globalwar_famepointshistory]).to eq 'globalwar/famepointshistory' }
29
- it { expect(WotApiRu::Constants::PATH[:globalwar_alleyoffame]).to eq 'globalwar/alleyoffame' }
30
- it { expect(WotApiRu::Constants::PATH[:globalwar_battles]).to eq 'globalwar/battles' }
31
- it { expect(WotApiRu::Constants::PATH[:globalwar_victorypointshistory]).to eq 'globalwar/victorypointshistory' }
32
- it { expect(WotApiRu::Constants::PATH[:encyclopedia_tanks]).to eq 'encyclopedia/tanks' }
33
- it { expect(WotApiRu::Constants::PATH[:encyclopedia_tankinfo]).to eq 'encyclopedia/tankinfo' }
34
- it { expect(WotApiRu::Constants::PATH[:encyclopedia_tankengines]).to eq 'encyclopedia/tankengines' }
35
- it { expect(WotApiRu::Constants::PATH[:encyclopedia_tankturrets]).to eq 'encyclopedia/tankturrets' }
36
- it { expect(WotApiRu::Constants::PATH[:encyclopedia_tankradios]).to eq 'encyclopedia/tankradios' }
37
- it { expect(WotApiRu::Constants::PATH[:encyclopedia_tankchassis]).to eq 'encyclopedia/tankchassis' }
38
- it { expect(WotApiRu::Constants::PATH[:encyclopedia_tankguns]).to eq 'encyclopedia/tankguns' }
39
- it { expect(WotApiRu::Constants::PATH[:encyclopedia_achievements]).to eq 'encyclopedia/achievements' }
40
- it { expect(WotApiRu::Constants::PATH[:encyclopedia_info]).to eq 'encyclopedia/info' }
41
- it { expect(WotApiRu::Constants::PATH[:ratings_types]).to eq 'ratings/types' }
42
- it { expect(WotApiRu::Constants::PATH[:ratings_accounts]).to eq 'ratings/accounts' }
43
- it { expect(WotApiRu::Constants::PATH[:ratings_neighbors]).to eq 'ratings/neighbors' }
44
- it { expect(WotApiRu::Constants::PATH[:ratings_top]).to eq 'ratings/top' }
45
- it { expect(WotApiRu::Constants::PATH[:ratings_dates]).to eq 'ratings/dates' }
46
- it { expect(WotApiRu::Constants::PATH[:tanks_stats]).to eq 'tanks/stats' }
47
- it { expect(WotApiRu::Constants::PATH[:tanks_achievements]).to eq 'tanks/achievements' }
8
+ it { expect(WotApiRu::Constants::PATH[:account_info]).to eq 'account/info/' }
9
+ it { expect(WotApiRu::Constants::PATH[:account_tanks]).to eq 'account/tanks/' }
10
+ it { expect(WotApiRu::Constants::PATH[:account_achievements]).to eq 'account/achievements/' }
11
+ it { expect(WotApiRu::Constants::PATH[:auth_prolongate]).to eq 'auth/prolongate/' }
12
+ it { expect(WotApiRu::Constants::PATH[:auth_logout]).to eq 'auth/logout/' }
13
+ it { expect(WotApiRu::Constants::PATH[:clan_list]).to eq 'clan/list/' }
14
+ it { expect(WotApiRu::Constants::PATH[:clan_info]).to eq 'clan/info/' }
15
+ it { expect(WotApiRu::Constants::PATH[:clan_battles]).to eq 'clan/battles/' }
16
+ it { expect(WotApiRu::Constants::PATH[:clan_top]).to eq 'clan/top/' }
17
+ it { expect(WotApiRu::Constants::PATH[:clan_provinces]).to eq 'clan/provinces/' }
18
+ it { expect(WotApiRu::Constants::PATH[:clan_victorypoints]).to eq 'clan/victorypoints/' }
19
+ it { expect(WotApiRu::Constants::PATH[:clan_victorypointshistory]).to eq 'clan/victorypointshistory/' }
20
+ it { expect(WotApiRu::Constants::PATH[:clan_membersinfo]).to eq 'clan/membersinfo/' }
21
+ it { expect(WotApiRu::Constants::PATH[:globalwar_clans]).to eq 'globalwar/clans/' }
22
+ it { expect(WotApiRu::Constants::PATH[:globalwar_famepoints]).to eq 'globalwar/famepoints/' }
23
+ it { expect(WotApiRu::Constants::PATH[:globalwar_maps]).to eq 'globalwar/maps/' }
24
+ it { expect(WotApiRu::Constants::PATH[:globalwar_provinces]).to eq 'globalwar/provinces/' }
25
+ it { expect(WotApiRu::Constants::PATH[:globalwar_top]).to eq 'globalwar/top/' }
26
+ it { expect(WotApiRu::Constants::PATH[:globalwar_tournaments]).to eq 'globalwar/tournaments/' }
27
+ it { expect(WotApiRu::Constants::PATH[:globalwar_famepointshistory]).to eq 'globalwar/famepointshistory/' }
28
+ it { expect(WotApiRu::Constants::PATH[:globalwar_alleyoffame]).to eq 'globalwar/alleyoffame/' }
29
+ it { expect(WotApiRu::Constants::PATH[:globalwar_battles]).to eq 'globalwar/battles/' }
30
+ it { expect(WotApiRu::Constants::PATH[:globalwar_victorypointshistory]).to eq 'globalwar/victorypointshistory/' }
31
+ it { expect(WotApiRu::Constants::PATH[:encyclopedia_tanks]).to eq 'encyclopedia/tanks/' }
32
+ it { expect(WotApiRu::Constants::PATH[:encyclopedia_tankinfo]).to eq 'encyclopedia/tankinfo/' }
33
+ it { expect(WotApiRu::Constants::PATH[:encyclopedia_tankengines]).to eq 'encyclopedia/tankengines/' }
34
+ it { expect(WotApiRu::Constants::PATH[:encyclopedia_tankturrets]).to eq 'encyclopedia/tankturrets/' }
35
+ it { expect(WotApiRu::Constants::PATH[:encyclopedia_tankradios]).to eq 'encyclopedia/tankradios/' }
36
+ it { expect(WotApiRu::Constants::PATH[:encyclopedia_tankchassis]).to eq 'encyclopedia/tankchassis/' }
37
+ it { expect(WotApiRu::Constants::PATH[:encyclopedia_tankguns]).to eq 'encyclopedia/tankguns/' }
38
+ it { expect(WotApiRu::Constants::PATH[:encyclopedia_achievements]).to eq 'encyclopedia/achievements/' }
39
+ it { expect(WotApiRu::Constants::PATH[:encyclopedia_info]).to eq 'encyclopedia/info/' }
40
+ it { expect(WotApiRu::Constants::PATH[:ratings_types]).to eq 'ratings/types/' }
41
+ it { expect(WotApiRu::Constants::PATH[:ratings_accounts]).to eq 'ratings/accounts/' }
42
+ it { expect(WotApiRu::Constants::PATH[:ratings_neighbors]).to eq 'ratings/neighbors/' }
43
+ it { expect(WotApiRu::Constants::PATH[:ratings_top]).to eq 'ratings/top/' }
44
+ it { expect(WotApiRu::Constants::PATH[:ratings_dates]).to eq 'ratings/dates/' }
45
+ it { expect(WotApiRu::Constants::PATH[:tanks_stats]).to eq 'tanks/stats/' }
46
+ it { expect(WotApiRu::Constants::PATH[:tanks_achievements]).to eq 'tanks/achievements/' }
48
47
  end
49
48
  end
@@ -1,5 +1,4 @@
1
- require 'spec_helper'
2
- require 'wot_api_ru'
1
+ require 'rails_helper'
3
2
 
4
3
  describe WotApiRu::Settings do
5
4
  it { expect(WotApiRu::Settings.respond_to?('[]')).to eq true }
@@ -0,0 +1,5 @@
1
+ require 'rails_helper'
2
+
3
+ describe WotApiRu do
4
+ it { expect(WotApiRu::VERSION).to eq '0.1.1' }
5
+ end
@@ -24,4 +24,5 @@ Gem::Specification.new do |s|
24
24
  s.add_development_dependency "sqlite3", '~> 1.3', '>= 1.3.9'
25
25
  s.add_development_dependency "rspec-rails", '~> 3.0', '>= 3.0.1'
26
26
  s.add_development_dependency "coveralls", '~> 0.7', '>= 0.7.0'
27
+ s.add_development_dependency "generator_spec", '~> 0.9', '>= 0.9.2'
27
28
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wot_api_ru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Bondarenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-17 00:00:00.000000000 Z
11
+ date: 2014-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -110,6 +110,26 @@ dependencies:
110
110
  - - ">="
111
111
  - !ruby/object:Gem::Version
112
112
  version: 0.7.0
113
+ - !ruby/object:Gem::Dependency
114
+ name: generator_spec
115
+ requirement: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - "~>"
118
+ - !ruby/object:Gem::Version
119
+ version: '0.9'
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: 0.9.2
123
+ type: :development
124
+ prerelease: false
125
+ version_requirements: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - "~>"
128
+ - !ruby/object:Gem::Version
129
+ version: '0.9'
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: 0.9.2
113
133
  description: Gem for Wargaming.net Public API http://ru.wargaming.net/developers/api_reference
114
134
  .
115
135
  email:
@@ -180,11 +200,14 @@ files:
180
200
  - spec/dummy/public/422.html
181
201
  - spec/dummy/public/500.html
182
202
  - spec/dummy/public/favicon.ico
203
+ - spec/lib/generators/wot_api_ru/install_generator_spec.rb
204
+ - spec/lib/wot_api_ru/client/account/list_spec.rb
205
+ - spec/lib/wot_api_ru/client_spec.rb
206
+ - spec/lib/wot_api_ru/constants_spec.rb
207
+ - spec/lib/wot_api_ru/settings_spec.rb
208
+ - spec/lib/wot_api_ru/version_spec.rb
183
209
  - spec/rails_helper.rb
184
210
  - spec/spec_helper.rb
185
- - spec/wot_api_ru/constants_spec.rb
186
- - spec/wot_api_ru/settings_spec.rb
187
- - spec/wot_api_ru/version_spec.rb
188
211
  - wot_api_ru.gemspec
189
212
  homepage: https://github.com/shved270189/wot_api_ru
190
213
  licenses:
@@ -1,6 +0,0 @@
1
- require 'spec_helper'
2
- require 'wot_api_ru'
3
-
4
- describe WotApiRu do
5
- it {expect(WotApiRu::VERSION).to eq '0.1.0'}
6
- end