eveapi 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (84) hide show
  1. checksums.yaml +8 -8
  2. data/.rubocop.yml +1 -6
  3. data/README.md +59 -16
  4. data/Rakefile +10 -1
  5. data/eveapi.gemspec +4 -4
  6. data/gemspec.yml +2 -0
  7. data/lib/eveapi.rb +2 -0
  8. data/lib/eveapi/alliance.rb +50 -0
  9. data/lib/eveapi/character.rb +60 -0
  10. data/lib/eveapi/client.rb +28 -2
  11. data/lib/eveapi/crest.rb +8 -3
  12. data/lib/eveapi/util.rb +4 -0
  13. data/lib/eveapi/version.rb +1 -1
  14. data/spec/cassettes/EVEApi/EVEApi_Alliance/expect_Alliance_corporations_to_be_an_Array.yml +7017 -0
  15. data/spec/cassettes/EVEApi/EVEApi_Alliance/expect_Alliance_find_to_fill_short_name_and_name_values.yml +2263 -0
  16. data/spec/cassettes/EVEApi/EVEApi_Alliance/expect_Alliance_info_to_be_a_Hash.yml +7017 -0
  17. data/spec/cassettes/EVEApi/EVEApi_Alliance/expect_Alliance_new_with_id_argument_to_create_an_Alliance.yml +131 -0
  18. data/spec/cassettes/EVEApi/EVEApi_Alliance/expect_Alliance_to_h_to_be_a_Hash.yml +6925 -0
  19. data/spec/cassettes/EVEApi/EVEApi_Character/expect_Character_new_args_to_create_a_Character.yml +193 -0
  20. data/spec/cassettes/EVEApi/EVEApi_Character/expect_a_Character_account_balance_to_return_a_Hash.yml +222 -0
  21. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_account_account_status.yml +161 -0
  22. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_account_api_key_info.yml +163 -0
  23. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_account_characters.yml +162 -0
  24. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_account_balance.yml +160 -0
  25. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_asset_list.yml +207 -0
  26. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_character_sheet.yml +207 -0
  27. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_contact_list.yml +175 -0
  28. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_contact_notifications.yml +159 -0
  29. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_contracts.yml +159 -0
  30. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_industry_jobs.yml +159 -0
  31. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_mail_messages.yml +159 -0
  32. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_mailing_lists.yml +159 -0
  33. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_market_orders.yml +159 -0
  34. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_medals.yml +160 -0
  35. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_notifications.yml +159 -0
  36. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_research.yml +159 -0
  37. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_skill_in_training.yml +159 -0
  38. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_skill_queue.yml +159 -0
  39. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_standings.yml +173 -0
  40. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_upcoming_calendar_events.yml +169 -0
  41. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_wallet_journal.yml +159 -0
  42. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_wallet_transactions.yml +159 -0
  43. data/spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_server_server_status.yml +159 -0
  44. data/spec/cassettes/EVEApi/EVEApi_Client/expect_Client_characters_to_handle_mutiple_characters_differently.yml +131 -0
  45. data/spec/cassettes/EVEApi/EVEApi_Client/expect_Client_charcaters_to_succeed.yml +131 -0
  46. data/spec/cassettes/EVEApi/EVEApi_Client/expect_Client_connection_to_be_an_Excon_Connection.yml +131 -0
  47. data/spec/cassettes/EVEApi/EVEApi_Client/expect_Client_new_to_succeed.yml +131 -0
  48. data/spec/cassettes/EVEApi/EVEApi_Client/expect_Client_params_to_return_an_empty_hash_when_on_no_param.yml +131 -0
  49. data/spec/cassettes/EVEApi/{calling_api_methods_should_return_an_Array_of_method_symobls.yml → EVEApi_Client/expect_api_methods_to_return_an_Array_of_method_symobls.yml} +134 -6
  50. data/spec/cassettes/EVEApi/{calling_a_method_not_present_in_the_EVEApi_should_fail.yml → EVEApi_Client/expect_calling_a_non-existing_API_method_to_fail.yml} +132 -4
  51. data/spec/cassettes/EVEApi/EVEApi_Client/expect_calling_an_existing_API_method_to_succeed.yml +159 -0
  52. data/spec/cassettes/EVEApi/EVEApi_Client/expect_check_path_to_return_a_non-empty_String_for_a_muti-part_name.yml +131 -0
  53. data/spec/cassettes/EVEApi/EVEApi_Client/expect_check_path_to_return_an_empty_String_for_a_one_part_name.yml +131 -0
  54. data/spec/cassettes/EVEApi/EVEApi_Crest/expect_Crest_alliances_to_be_an_Array.yml +6925 -0
  55. data/spec/cassettes/EVEApi/EVEApi_Crest/expect_Crest_new_to_succeed.yml +131 -0
  56. data/spec/cassettes/EVEApi/EVEApi_Request/expect_there_to_be_a_EVEApi_Request_class.yml +131 -0
  57. data/spec/eve_api_spec.rb +117 -0
  58. metadata +76 -30
  59. data/spec/cassettes/EVEApi/calling_a_method_present_in_the_EVEApi_should_success.yml +0 -31
  60. data/spec/cassettes/EVEApi/calling_api_method_account_account_status.yml +0 -33
  61. data/spec/cassettes/EVEApi/calling_api_method_account_api_key_info.yml +0 -35
  62. data/spec/cassettes/EVEApi/calling_api_method_account_characters.yml +0 -34
  63. data/spec/cassettes/EVEApi/calling_api_method_char_account_balance.yml +0 -32
  64. data/spec/cassettes/EVEApi/calling_api_method_char_asset_list.yml +0 -79
  65. data/spec/cassettes/EVEApi/calling_api_method_char_character_sheet.yml +0 -79
  66. data/spec/cassettes/EVEApi/calling_api_method_char_contact_list.yml +0 -47
  67. data/spec/cassettes/EVEApi/calling_api_method_char_contact_notifications.yml +0 -31
  68. data/spec/cassettes/EVEApi/calling_api_method_char_contracts.yml +0 -31
  69. data/spec/cassettes/EVEApi/calling_api_method_char_industry_jobs.yml +0 -31
  70. data/spec/cassettes/EVEApi/calling_api_method_char_mail_messages.yml +0 -31
  71. data/spec/cassettes/EVEApi/calling_api_method_char_mailing_lists.yml +0 -31
  72. data/spec/cassettes/EVEApi/calling_api_method_char_market_orders.yml +0 -31
  73. data/spec/cassettes/EVEApi/calling_api_method_char_medals.yml +0 -32
  74. data/spec/cassettes/EVEApi/calling_api_method_char_notifications.yml +0 -31
  75. data/spec/cassettes/EVEApi/calling_api_method_char_research.yml +0 -31
  76. data/spec/cassettes/EVEApi/calling_api_method_char_skill_in_training.yml +0 -31
  77. data/spec/cassettes/EVEApi/calling_api_method_char_skill_queue.yml +0 -31
  78. data/spec/cassettes/EVEApi/calling_api_method_char_standings.yml +0 -45
  79. data/spec/cassettes/EVEApi/calling_api_method_char_upcoming_calendar_events.yml +0 -37
  80. data/spec/cassettes/EVEApi/calling_api_method_char_wallet_journal.yml +0 -31
  81. data/spec/cassettes/EVEApi/calling_api_method_char_wallet_transactions.yml +0 -31
  82. data/spec/cassettes/EVEApi/calling_api_method_server_server_status.yml +0 -31
  83. data/spec/cassettes/EVEApi_Crest/alliances_crest_methods_should_return_an_Array_of_alliances.yml +0 -13577
  84. data/spec/eveapi_spec.rb +0 -73
@@ -0,0 +1,131 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.eveonline.com/account/Characters.xml.aspx?keyID=4669404&vCode=hushhush
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - excon/0.45.4
12
+ response:
13
+ status:
14
+ code: 200
15
+ message: ''
16
+ headers:
17
+ Content-Type:
18
+ - application/xml; charset=utf-8
19
+ Access-Control-Allow-Origin:
20
+ - "*"
21
+ Date:
22
+ - Sat, 12 Sep 2015 08:52:26 GMT
23
+ body:
24
+ encoding: UTF-8
25
+ string: "<?xml version='1.0' encoding='UTF-8'?>\r\n<eveapi version=\"2\">\r\n
26
+ \ <currentTime>2015-09-12 08:52:27</currentTime>\r\n <result>\r\n <rowset
27
+ name=\"characters\" key=\"characterID\" columns=\"name,characterID,corporationName,corporationID,allianceID,allianceName,factionID,factionName\">\r\n
28
+ \ <row name=\"Blondie Blond\" characterID=\"93051887\" corporationName=\"Carl
29
+ Malus Corporation\" corporationID=\"98279136\" allianceID=\"0\" allianceName=\"\"
30
+ factionID=\"0\" factionName=\"\" />\r\n <row name=\"Adrian Dent\" characterID=\"810699209\"
31
+ corporationName=\"Caldari Provisions\" corporationID=\"1000009\" allianceID=\"0\"
32
+ allianceName=\"\" factionID=\"0\" factionName=\"\" />\r\n </rowset>\r\n
33
+ \ </result>\r\n <cachedUntil>2015-09-12 09:48:16</cachedUntil>\r\n</eveapi>"
34
+ http_version:
35
+ recorded_at: Sat, 12 Sep 2015 08:52:27 GMT
36
+ - request:
37
+ method: get
38
+ uri: https://api.eveonline.com/account/Characters.xml.aspx?keyID=4669404&vCode=hushhush
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ''
42
+ headers:
43
+ User-Agent:
44
+ - excon/0.45.4
45
+ response:
46
+ status:
47
+ code: 200
48
+ message: ''
49
+ headers:
50
+ Content-Type:
51
+ - application/xml; charset=utf-8
52
+ Access-Control-Allow-Origin:
53
+ - "*"
54
+ Date:
55
+ - Sat, 12 Sep 2015 08:52:26 GMT
56
+ body:
57
+ encoding: UTF-8
58
+ string: "<?xml version='1.0' encoding='UTF-8'?>\r\n<eveapi version=\"2\">\r\n
59
+ \ <currentTime>2015-09-12 08:52:27</currentTime>\r\n <result>\r\n <rowset
60
+ name=\"characters\" key=\"characterID\" columns=\"name,characterID,corporationName,corporationID,allianceID,allianceName,factionID,factionName\">\r\n
61
+ \ <row name=\"Blondie Blond\" characterID=\"93051887\" corporationName=\"Carl
62
+ Malus Corporation\" corporationID=\"98279136\" allianceID=\"0\" allianceName=\"\"
63
+ factionID=\"0\" factionName=\"\" />\r\n <row name=\"Adrian Dent\" characterID=\"810699209\"
64
+ corporationName=\"Caldari Provisions\" corporationID=\"1000009\" allianceID=\"0\"
65
+ allianceName=\"\" factionID=\"0\" factionName=\"\" />\r\n </rowset>\r\n
66
+ \ </result>\r\n <cachedUntil>2015-09-12 09:48:16</cachedUntil>\r\n</eveapi>"
67
+ http_version:
68
+ recorded_at: Sat, 12 Sep 2015 08:52:27 GMT
69
+ - request:
70
+ method: get
71
+ uri: https://api.eveonline.com/account/Characters.xml.aspx?characterID=95512059&keyID=4278167&vCode=supersecretstuff
72
+ body:
73
+ encoding: US-ASCII
74
+ string: ''
75
+ headers:
76
+ User-Agent:
77
+ - excon/0.45.4
78
+ response:
79
+ status:
80
+ code: 200
81
+ message: ''
82
+ headers:
83
+ Content-Type:
84
+ - application/xml; charset=utf-8
85
+ Access-Control-Allow-Origin:
86
+ - "*"
87
+ Date:
88
+ - Sat, 12 Sep 2015 08:52:27 GMT
89
+ body:
90
+ encoding: UTF-8
91
+ string: "<?xml version='1.0' encoding='UTF-8'?>\r\n<eveapi version=\"2\">\r\n
92
+ \ <currentTime>2015-09-12 08:52:28</currentTime>\r\n <result>\r\n <rowset
93
+ name=\"characters\" key=\"characterID\" columns=\"name,characterID,corporationName,corporationID,allianceID,allianceName,factionID,factionName\">\r\n
94
+ \ <row name=\"Quint Slade\" characterID=\"95512059\" corporationName=\"Imperial
95
+ Academy\" corporationID=\"1000166\" allianceID=\"0\" allianceName=\"\" factionID=\"0\"
96
+ factionName=\"\" />\r\n </rowset>\r\n </result>\r\n <cachedUntil>2015-09-12
97
+ 09:48:16</cachedUntil>\r\n</eveapi>"
98
+ http_version:
99
+ recorded_at: Sat, 12 Sep 2015 08:52:28 GMT
100
+ - request:
101
+ method: get
102
+ uri: https://api.eveonline.com/account/Characters.xml.aspx?characterID=95512059&keyID=4278167&vCode=supersecretstuff
103
+ body:
104
+ encoding: US-ASCII
105
+ string: ''
106
+ headers:
107
+ User-Agent:
108
+ - excon/0.45.4
109
+ response:
110
+ status:
111
+ code: 200
112
+ message: ''
113
+ headers:
114
+ Content-Type:
115
+ - application/xml; charset=utf-8
116
+ Access-Control-Allow-Origin:
117
+ - "*"
118
+ Date:
119
+ - Sat, 12 Sep 2015 08:52:27 GMT
120
+ body:
121
+ encoding: UTF-8
122
+ string: "<?xml version='1.0' encoding='UTF-8'?>\r\n<eveapi version=\"2\">\r\n
123
+ \ <currentTime>2015-09-12 08:52:28</currentTime>\r\n <result>\r\n <rowset
124
+ name=\"characters\" key=\"characterID\" columns=\"name,characterID,corporationName,corporationID,allianceID,allianceName,factionID,factionName\">\r\n
125
+ \ <row name=\"Quint Slade\" characterID=\"95512059\" corporationName=\"Imperial
126
+ Academy\" corporationID=\"1000166\" allianceID=\"0\" allianceName=\"\" factionID=\"0\"
127
+ factionName=\"\" />\r\n </rowset>\r\n </result>\r\n <cachedUntil>2015-09-12
128
+ 09:48:16</cachedUntil>\r\n</eveapi>"
129
+ http_version:
130
+ recorded_at: Sat, 12 Sep 2015 08:52:28 GMT
131
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,131 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.eveonline.com/account/Characters.xml.aspx?keyID=4669404&vCode=hushhush
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - excon/0.45.4
12
+ response:
13
+ status:
14
+ code: 200
15
+ message: ''
16
+ headers:
17
+ Content-Type:
18
+ - application/xml; charset=utf-8
19
+ Access-Control-Allow-Origin:
20
+ - "*"
21
+ Date:
22
+ - Sat, 12 Sep 2015 08:52:26 GMT
23
+ body:
24
+ encoding: UTF-8
25
+ string: "<?xml version='1.0' encoding='UTF-8'?>\r\n<eveapi version=\"2\">\r\n
26
+ \ <currentTime>2015-09-12 08:52:26</currentTime>\r\n <result>\r\n <rowset
27
+ name=\"characters\" key=\"characterID\" columns=\"name,characterID,corporationName,corporationID,allianceID,allianceName,factionID,factionName\">\r\n
28
+ \ <row name=\"Blondie Blond\" characterID=\"93051887\" corporationName=\"Carl
29
+ Malus Corporation\" corporationID=\"98279136\" allianceID=\"0\" allianceName=\"\"
30
+ factionID=\"0\" factionName=\"\" />\r\n <row name=\"Adrian Dent\" characterID=\"810699209\"
31
+ corporationName=\"Caldari Provisions\" corporationID=\"1000009\" allianceID=\"0\"
32
+ allianceName=\"\" factionID=\"0\" factionName=\"\" />\r\n </rowset>\r\n
33
+ \ </result>\r\n <cachedUntil>2015-09-12 09:48:16</cachedUntil>\r\n</eveapi>"
34
+ http_version:
35
+ recorded_at: Sat, 12 Sep 2015 08:52:26 GMT
36
+ - request:
37
+ method: get
38
+ uri: https://api.eveonline.com/account/Characters.xml.aspx?keyID=4669404&vCode=hushhush
39
+ body:
40
+ encoding: US-ASCII
41
+ string: ''
42
+ headers:
43
+ User-Agent:
44
+ - excon/0.45.4
45
+ response:
46
+ status:
47
+ code: 200
48
+ message: ''
49
+ headers:
50
+ Content-Type:
51
+ - application/xml; charset=utf-8
52
+ Access-Control-Allow-Origin:
53
+ - "*"
54
+ Date:
55
+ - Sat, 12 Sep 2015 08:52:26 GMT
56
+ body:
57
+ encoding: UTF-8
58
+ string: "<?xml version='1.0' encoding='UTF-8'?>\r\n<eveapi version=\"2\">\r\n
59
+ \ <currentTime>2015-09-12 08:52:26</currentTime>\r\n <result>\r\n <rowset
60
+ name=\"characters\" key=\"characterID\" columns=\"name,characterID,corporationName,corporationID,allianceID,allianceName,factionID,factionName\">\r\n
61
+ \ <row name=\"Blondie Blond\" characterID=\"93051887\" corporationName=\"Carl
62
+ Malus Corporation\" corporationID=\"98279136\" allianceID=\"0\" allianceName=\"\"
63
+ factionID=\"0\" factionName=\"\" />\r\n <row name=\"Adrian Dent\" characterID=\"810699209\"
64
+ corporationName=\"Caldari Provisions\" corporationID=\"1000009\" allianceID=\"0\"
65
+ allianceName=\"\" factionID=\"0\" factionName=\"\" />\r\n </rowset>\r\n
66
+ \ </result>\r\n <cachedUntil>2015-09-12 09:48:16</cachedUntil>\r\n</eveapi>"
67
+ http_version:
68
+ recorded_at: Sat, 12 Sep 2015 08:52:27 GMT
69
+ - request:
70
+ method: get
71
+ uri: https://api.eveonline.com/account/Characters.xml.aspx?characterID=95512059&keyID=4278167&vCode=supersecretstuff
72
+ body:
73
+ encoding: US-ASCII
74
+ string: ''
75
+ headers:
76
+ User-Agent:
77
+ - excon/0.45.4
78
+ response:
79
+ status:
80
+ code: 200
81
+ message: ''
82
+ headers:
83
+ Content-Type:
84
+ - application/xml; charset=utf-8
85
+ Access-Control-Allow-Origin:
86
+ - "*"
87
+ Date:
88
+ - Sat, 12 Sep 2015 08:52:26 GMT
89
+ body:
90
+ encoding: UTF-8
91
+ string: "<?xml version='1.0' encoding='UTF-8'?>\r\n<eveapi version=\"2\">\r\n
92
+ \ <currentTime>2015-09-12 08:52:27</currentTime>\r\n <result>\r\n <rowset
93
+ name=\"characters\" key=\"characterID\" columns=\"name,characterID,corporationName,corporationID,allianceID,allianceName,factionID,factionName\">\r\n
94
+ \ <row name=\"Quint Slade\" characterID=\"95512059\" corporationName=\"Imperial
95
+ Academy\" corporationID=\"1000166\" allianceID=\"0\" allianceName=\"\" factionID=\"0\"
96
+ factionName=\"\" />\r\n </rowset>\r\n </result>\r\n <cachedUntil>2015-09-12
97
+ 09:48:16</cachedUntil>\r\n</eveapi>"
98
+ http_version:
99
+ recorded_at: Sat, 12 Sep 2015 08:52:27 GMT
100
+ - request:
101
+ method: get
102
+ uri: https://api.eveonline.com/account/Characters.xml.aspx?characterID=95512059&keyID=4278167&vCode=supersecretstuff
103
+ body:
104
+ encoding: US-ASCII
105
+ string: ''
106
+ headers:
107
+ User-Agent:
108
+ - excon/0.45.4
109
+ response:
110
+ status:
111
+ code: 200
112
+ message: ''
113
+ headers:
114
+ Content-Type:
115
+ - application/xml; charset=utf-8
116
+ Access-Control-Allow-Origin:
117
+ - "*"
118
+ Date:
119
+ - Sat, 12 Sep 2015 08:52:27 GMT
120
+ body:
121
+ encoding: UTF-8
122
+ string: "<?xml version='1.0' encoding='UTF-8'?>\r\n<eveapi version=\"2\">\r\n
123
+ \ <currentTime>2015-09-12 08:52:27</currentTime>\r\n <result>\r\n <rowset
124
+ name=\"characters\" key=\"characterID\" columns=\"name,characterID,corporationName,corporationID,allianceID,allianceName,factionID,factionName\">\r\n
125
+ \ <row name=\"Quint Slade\" characterID=\"95512059\" corporationName=\"Imperial
126
+ Academy\" corporationID=\"1000166\" allianceID=\"0\" allianceName=\"\" factionID=\"0\"
127
+ factionName=\"\" />\r\n </rowset>\r\n </result>\r\n <cachedUntil>2015-09-12
128
+ 09:48:16</cachedUntil>\r\n</eveapi>"
129
+ http_version:
130
+ recorded_at: Sat, 12 Sep 2015 08:52:27 GMT
131
+ recorded_with: VCR 2.9.3
@@ -0,0 +1,117 @@
1
+ require 'spec_helper'
2
+ require 'eveapi'
3
+
4
+ describe EVEApi, :vcr do
5
+ let!(:client) { Client.new }
6
+ let!(:client_auth) { Client.new('4278167', 'supersecretstuff', '95512059') }
7
+ let!(:client_auth_two_chars) { Client.new('4669404', 'hushhush') }
8
+ let!(:mutliple_characters) { client_auth_two_chars.characters }
9
+ let!(:characters) { client_auth.characters }
10
+
11
+ describe Client do
12
+ it 'expect Client.new to succeed' do
13
+ expect { client }.not_to raise_error
14
+ end
15
+
16
+ it 'expect Client#connection to be an Excon::Connection' do
17
+ expect(client.connection).to be_a(Excon::Connection)
18
+ end
19
+
20
+ it 'expect check_path to return an empty String for a one part name' do
21
+ expect(client.check_path('name')).to eq('')
22
+ end
23
+
24
+ it 'expect check_path to return a non-empty String for a muti-part name' do
25
+ expect(client.check_path('name_name')).to be_a(String)
26
+ expect(client.check_path('name_name')).not_to be_empty
27
+ end
28
+
29
+ it 'expect Client#params to return an empty hash when on no param' do
30
+ expect(Client.new.params).to be_a(Hash)
31
+ expect(Client.new.params).to be_empty
32
+ end
33
+
34
+ it 'expect calling an existing API method to succeed' do
35
+ expect { client.server_server_status }.not_to raise_error
36
+ end
37
+
38
+ it 'expect calling a non-existing API method to fail' do
39
+ expect { client.some_bs_method }.to raise_error(RuntimeError)
40
+ end
41
+
42
+ it 'expect api_methods to return an Array of method symobls' do
43
+ expect(client.api_methods).to be_an(Array)
44
+ end
45
+
46
+ it 'expect Client#charcaters to succeed' do
47
+ expect(characters).to be_an(Array)
48
+ end
49
+
50
+ it 'expect Client#characters to handle mutiple characters differently' do
51
+ expect(mutliple_characters).to be_an(Array)
52
+ end
53
+
54
+ Client.new.working_methods.each do |m|
55
+ it "calling api method #{m}" do
56
+ expect { client_auth.send(m) }.not_to raise_error
57
+ end
58
+ end
59
+ end
60
+
61
+ describe Request do
62
+ it 'expect there to be a EVEApi::Request class' do
63
+ expect { Request }.not_to raise_error
64
+ end
65
+ end
66
+
67
+ describe Crest do
68
+ let!(:crest) { Crest.new }
69
+
70
+ it 'expect Crest.new to succeed' do
71
+ expect { crest }.not_to raise_error
72
+ end
73
+
74
+ it 'expect Crest#alliances to be an Array' do
75
+ expect(crest.alliances).to be_an(Array)
76
+ end
77
+ end
78
+
79
+ describe Alliance do
80
+ let(:alliance) { Crest.new.alliances.first }
81
+
82
+ it 'expect Alliance#info to be a Hash' do
83
+ expect { alliance.info }.not_to raise_error
84
+ expect(alliance.info).to be_a(Hash)
85
+ end
86
+
87
+ it 'expect Alliance#corporations to be an Array' do
88
+ expect(alliance.corporations).to be_an(Array)
89
+ end
90
+
91
+ it 'expect Alliance#to_h to be a Hash' do
92
+ expect(alliance.to_h).to be_a(Hash)
93
+ end
94
+
95
+ it 'expect Alliance.new with id argument to create an Alliance' do
96
+ expect(Alliance.new('1354830081')).to be_an(Alliance)
97
+ end
98
+
99
+ it 'expect Alliance#find to fill short_name and name values' do
100
+ alliance = Alliance.new('1354830081').find
101
+ expect(alliance.short_name).to be_a(String)
102
+ expect(alliance.short_name).not_to be_empty
103
+ expect(alliance.name).to be_a(String)
104
+ expect(alliance.name).not_to be_empty
105
+ end
106
+ end
107
+
108
+ describe Character do
109
+ let(:character) { client_auth.characters.first }
110
+ it 'expect Character.new(args) to create a Character' do
111
+ expect(character).to be_a(Character)
112
+ end
113
+ it 'expect a Character#account_balance to return a Hash' do
114
+ expect(character.account_balance).to be_a(Hash)
115
+ end
116
+ end
117
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eveapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Ladachowski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-10 00:00:00.000000000 Z
11
+ date: 2015-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: excon
@@ -38,6 +38,34 @@ dependencies:
38
38
  - - ~>
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.4'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ~>
46
+ - !ruby/object:Gem::Version
47
+ version: '0.34'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ~>
53
+ - !ruby/object:Gem::Version
54
+ version: '0.34'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rubocop-rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: '1.3'
41
69
  - !ruby/object:Gem::Dependency
42
70
  name: bundler
43
71
  requirement: !ruby/object:Gem::Requirement
@@ -188,40 +216,58 @@ files:
188
216
  - eveapi.gemspec
189
217
  - gemspec.yml
190
218
  - lib/eveapi.rb
219
+ - lib/eveapi/alliance.rb
220
+ - lib/eveapi/character.rb
191
221
  - lib/eveapi/client.rb
192
222
  - lib/eveapi/console.rb
193
223
  - lib/eveapi/crest.rb
194
224
  - lib/eveapi/request.rb
195
225
  - lib/eveapi/util.rb
196
226
  - lib/eveapi/version.rb
197
- - spec/cassettes/EVEApi/calling_a_method_not_present_in_the_EVEApi_should_fail.yml
198
- - spec/cassettes/EVEApi/calling_a_method_present_in_the_EVEApi_should_success.yml
199
- - spec/cassettes/EVEApi/calling_api_method_account_account_status.yml
200
- - spec/cassettes/EVEApi/calling_api_method_account_api_key_info.yml
201
- - spec/cassettes/EVEApi/calling_api_method_account_characters.yml
202
- - spec/cassettes/EVEApi/calling_api_method_char_account_balance.yml
203
- - spec/cassettes/EVEApi/calling_api_method_char_asset_list.yml
204
- - spec/cassettes/EVEApi/calling_api_method_char_character_sheet.yml
205
- - spec/cassettes/EVEApi/calling_api_method_char_contact_list.yml
206
- - spec/cassettes/EVEApi/calling_api_method_char_contact_notifications.yml
207
- - spec/cassettes/EVEApi/calling_api_method_char_contracts.yml
208
- - spec/cassettes/EVEApi/calling_api_method_char_industry_jobs.yml
209
- - spec/cassettes/EVEApi/calling_api_method_char_mail_messages.yml
210
- - spec/cassettes/EVEApi/calling_api_method_char_mailing_lists.yml
211
- - spec/cassettes/EVEApi/calling_api_method_char_market_orders.yml
212
- - spec/cassettes/EVEApi/calling_api_method_char_medals.yml
213
- - spec/cassettes/EVEApi/calling_api_method_char_notifications.yml
214
- - spec/cassettes/EVEApi/calling_api_method_char_research.yml
215
- - spec/cassettes/EVEApi/calling_api_method_char_skill_in_training.yml
216
- - spec/cassettes/EVEApi/calling_api_method_char_skill_queue.yml
217
- - spec/cassettes/EVEApi/calling_api_method_char_standings.yml
218
- - spec/cassettes/EVEApi/calling_api_method_char_upcoming_calendar_events.yml
219
- - spec/cassettes/EVEApi/calling_api_method_char_wallet_journal.yml
220
- - spec/cassettes/EVEApi/calling_api_method_char_wallet_transactions.yml
221
- - spec/cassettes/EVEApi/calling_api_method_server_server_status.yml
222
- - spec/cassettes/EVEApi/calling_api_methods_should_return_an_Array_of_method_symobls.yml
223
- - spec/cassettes/EVEApi_Crest/alliances_crest_methods_should_return_an_Array_of_alliances.yml
224
- - spec/eveapi_spec.rb
227
+ - spec/cassettes/EVEApi/EVEApi_Alliance/expect_Alliance_corporations_to_be_an_Array.yml
228
+ - spec/cassettes/EVEApi/EVEApi_Alliance/expect_Alliance_find_to_fill_short_name_and_name_values.yml
229
+ - spec/cassettes/EVEApi/EVEApi_Alliance/expect_Alliance_info_to_be_a_Hash.yml
230
+ - spec/cassettes/EVEApi/EVEApi_Alliance/expect_Alliance_new_with_id_argument_to_create_an_Alliance.yml
231
+ - spec/cassettes/EVEApi/EVEApi_Alliance/expect_Alliance_to_h_to_be_a_Hash.yml
232
+ - spec/cassettes/EVEApi/EVEApi_Character/expect_Character_new_args_to_create_a_Character.yml
233
+ - spec/cassettes/EVEApi/EVEApi_Character/expect_a_Character_account_balance_to_return_a_Hash.yml
234
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_account_account_status.yml
235
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_account_api_key_info.yml
236
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_account_characters.yml
237
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_account_balance.yml
238
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_asset_list.yml
239
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_character_sheet.yml
240
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_contact_list.yml
241
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_contact_notifications.yml
242
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_contracts.yml
243
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_industry_jobs.yml
244
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_mail_messages.yml
245
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_mailing_lists.yml
246
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_market_orders.yml
247
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_medals.yml
248
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_notifications.yml
249
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_research.yml
250
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_skill_in_training.yml
251
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_skill_queue.yml
252
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_standings.yml
253
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_upcoming_calendar_events.yml
254
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_wallet_journal.yml
255
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_char_wallet_transactions.yml
256
+ - spec/cassettes/EVEApi/EVEApi_Client/calling_api_method_server_server_status.yml
257
+ - spec/cassettes/EVEApi/EVEApi_Client/expect_Client_characters_to_handle_mutiple_characters_differently.yml
258
+ - spec/cassettes/EVEApi/EVEApi_Client/expect_Client_charcaters_to_succeed.yml
259
+ - spec/cassettes/EVEApi/EVEApi_Client/expect_Client_connection_to_be_an_Excon_Connection.yml
260
+ - spec/cassettes/EVEApi/EVEApi_Client/expect_Client_new_to_succeed.yml
261
+ - spec/cassettes/EVEApi/EVEApi_Client/expect_Client_params_to_return_an_empty_hash_when_on_no_param.yml
262
+ - spec/cassettes/EVEApi/EVEApi_Client/expect_api_methods_to_return_an_Array_of_method_symobls.yml
263
+ - spec/cassettes/EVEApi/EVEApi_Client/expect_calling_a_non-existing_API_method_to_fail.yml
264
+ - spec/cassettes/EVEApi/EVEApi_Client/expect_calling_an_existing_API_method_to_succeed.yml
265
+ - spec/cassettes/EVEApi/EVEApi_Client/expect_check_path_to_return_a_non-empty_String_for_a_muti-part_name.yml
266
+ - spec/cassettes/EVEApi/EVEApi_Client/expect_check_path_to_return_an_empty_String_for_a_one_part_name.yml
267
+ - spec/cassettes/EVEApi/EVEApi_Crest/expect_Crest_alliances_to_be_an_Array.yml
268
+ - spec/cassettes/EVEApi/EVEApi_Crest/expect_Crest_new_to_succeed.yml
269
+ - spec/cassettes/EVEApi/EVEApi_Request/expect_there_to_be_a_EVEApi_Request_class.yml
270
+ - spec/eve_api_spec.rb
225
271
  - spec/spec_helper.rb
226
272
  homepage: https://github.com/aladac/eveapi
227
273
  licenses: