eve 1.0.0

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.
Files changed (175) hide show
  1. data/History.txt +4 -0
  2. data/Manifest.txt +174 -0
  3. data/PostInstall.txt +6 -0
  4. data/README.rdoc +126 -0
  5. data/Rakefile +128 -0
  6. data/features/support/env.rb +1 -0
  7. data/lib/eve.rb +31 -0
  8. data/lib/eve/api.rb +247 -0
  9. data/lib/eve/api/connectivity.rb +39 -0
  10. data/lib/eve/api/request.rb +74 -0
  11. data/lib/eve/api/response.rb +100 -0
  12. data/lib/eve/api/response/inspection.rb +62 -0
  13. data/lib/eve/api/response/rowset.rb +56 -0
  14. data/lib/eve/api/response/rowsets.rb +42 -0
  15. data/lib/eve/api/response/wrap_object.rb +15 -0
  16. data/lib/eve/api/services.rb +20 -0
  17. data/lib/eve/api/services/account.rb +12 -0
  18. data/lib/eve/api/services/character.rb +96 -0
  19. data/lib/eve/api/services/corporation.rb +150 -0
  20. data/lib/eve/api/services/eve.rb +76 -0
  21. data/lib/eve/api/services/map.rb +45 -0
  22. data/lib/eve/api/services/misc.rb +24 -0
  23. data/lib/eve/api/services/server.rb +20 -0
  24. data/lib/eve/core_extensions.rb +3 -0
  25. data/lib/eve/core_extensions/hash.rb +51 -0
  26. data/lib/eve/core_extensions/string.rb +11 -0
  27. data/lib/eve/dependencies.rb +18 -0
  28. data/lib/eve/errors.rb +129 -0
  29. data/lib/eve/errors/authentication_errors.rb +33 -0
  30. data/lib/eve/errors/internal_errors.rb +64 -0
  31. data/lib/eve/errors/miscellaneous_errors.rb +19 -0
  32. data/lib/eve/errors/user_input_errors.rb +62 -0
  33. data/lib/eve/helpers.rb +12 -0
  34. data/lib/eve/helpers/javascript_helper.rb +198 -0
  35. data/lib/eve/helpers/view_helper.rb +13 -0
  36. data/lib/eve/trust.rb +88 -0
  37. data/lib/eve/trust/controller_helpers.rb +90 -0
  38. data/lib/eve/trust/igb_interface.rb +88 -0
  39. data/lib/eve/trust/mime_types.rb +4 -0
  40. data/script/console +10 -0
  41. data/script/console.cmd +1 -0
  42. data/script/destroy +14 -0
  43. data/script/destroy.cmd +1 -0
  44. data/script/generate +14 -0
  45. data/script/generate.cmd +1 -0
  46. data/spec/lib/eve/api/calls/account/characters_spec.rb +22 -0
  47. data/spec/lib/eve/api/calls/character/account_balance_spec.rb +21 -0
  48. data/spec/lib/eve/api/calls/character/asset_list_spec.rb +23 -0
  49. data/spec/lib/eve/api/calls/character/character_sheet_spec.rb +51 -0
  50. data/spec/lib/eve/api/calls/character/fac_war_stats_spec.rb +31 -0
  51. data/spec/lib/eve/api/calls/character/industry_jobs_spec.rb +27 -0
  52. data/spec/lib/eve/api/calls/character/kill_log_spec.rb +27 -0
  53. data/spec/lib/eve/api/calls/character/mail_messages_spec.rb +21 -0
  54. data/spec/lib/eve/api/calls/character/mailing_lists_spec.rb +21 -0
  55. data/spec/lib/eve/api/calls/character/market_orders_spec.rb +21 -0
  56. data/spec/lib/eve/api/calls/character/medals_spec.rb +24 -0
  57. data/spec/lib/eve/api/calls/character/research_spec.rb +21 -0
  58. data/spec/lib/eve/api/calls/character/skill_in_training_spec.rb +44 -0
  59. data/spec/lib/eve/api/calls/character/skill_queue_spec.rb +21 -0
  60. data/spec/lib/eve/api/calls/character/standings_spec.rb +26 -0
  61. data/spec/lib/eve/api/calls/character/wallet_journal_spec.rb +21 -0
  62. data/spec/lib/eve/api/calls/character/wallet_transactions_spec.rb +21 -0
  63. data/spec/lib/eve/api/calls/character_portrait_spec.rb +17 -0
  64. data/spec/lib/eve/api/calls/corporation/account_balances_spec.rb +21 -0
  65. data/spec/lib/eve/api/calls/corporation/asset_list_spec.rb +25 -0
  66. data/spec/lib/eve/api/calls/corporation/container_log_spec.rb +23 -0
  67. data/spec/lib/eve/api/calls/corporation/corporation_sheet_spec.rb +36 -0
  68. data/spec/lib/eve/api/calls/corporation/fac_war_stats_spec.rb +23 -0
  69. data/spec/lib/eve/api/calls/corporation/industry_jobs_spec.rb +30 -0
  70. data/spec/lib/eve/api/calls/corporation/kill_log_spec.rb +27 -0
  71. data/spec/lib/eve/api/calls/corporation/market_orders_spec.rb +22 -0
  72. data/spec/lib/eve/api/calls/corporation/medals_spec.rb +21 -0
  73. data/spec/lib/eve/api/calls/corporation/member_medals_spec.rb +21 -0
  74. data/spec/lib/eve/api/calls/corporation/member_security_log_spec.rb +24 -0
  75. data/spec/lib/eve/api/calls/corporation/member_security_spec.rb +25 -0
  76. data/spec/lib/eve/api/calls/corporation/member_tracking_spec.rb +22 -0
  77. data/spec/lib/eve/api/calls/corporation/shareholders_spec.rb +23 -0
  78. data/spec/lib/eve/api/calls/corporation/standings_spec.rb +30 -0
  79. data/spec/lib/eve/api/calls/corporation/starbase_detail_spec.rb +32 -0
  80. data/spec/lib/eve/api/calls/corporation/starbase_list_spec.rb +22 -0
  81. data/spec/lib/eve/api/calls/corporation/titles_spec.rb +26 -0
  82. data/spec/lib/eve/api/calls/corporation/wallet_journal_spec.rb +22 -0
  83. data/spec/lib/eve/api/calls/corporation/wallet_transactions_spec.rb +22 -0
  84. data/spec/lib/eve/api/calls/empty_call_spec.rb +29 -0
  85. data/spec/lib/eve/api/calls/eve/alliance_list_spec.rb +26 -0
  86. data/spec/lib/eve/api/calls/eve/certificate_tree_spec.rb +18 -0
  87. data/spec/lib/eve/api/calls/eve/character_id_spec.rb +27 -0
  88. data/spec/lib/eve/api/calls/eve/conquerable_station_list_spec.rb +11 -0
  89. data/spec/lib/eve/api/calls/eve/error_list_spec.rb +21 -0
  90. data/spec/lib/eve/api/calls/eve/fac_war_stats_spec.rb +25 -0
  91. data/spec/lib/eve/api/calls/eve/fac_war_top_stats_spec.rb +54 -0
  92. data/spec/lib/eve/api/calls/eve/ref_types_spec.rb +11 -0
  93. data/spec/lib/eve/api/calls/eve/skill_tree_spec.rb +17 -0
  94. data/spec/lib/eve/api/calls/map/fac_war_systems_spec.rb +11 -0
  95. data/spec/lib/eve/api/calls/map/jumps_spec.rb +11 -0
  96. data/spec/lib/eve/api/calls/map/kills_spec.rb +15 -0
  97. data/spec/lib/eve/api/calls/map/sovereignty_spec.rb +11 -0
  98. data/spec/lib/eve/api/calls/server_status_spec.rb +24 -0
  99. data/spec/lib/eve/api/request_spec.rb +17 -0
  100. data/spec/lib/eve/api/response/error_spec.rb +13 -0
  101. data/spec/lib/eve/api/response/rowset_spec.rb +28 -0
  102. data/spec/lib/eve/api/response_spec.rb +79 -0
  103. data/spec/lib/eve/api_spec.rb +13 -0
  104. data/spec/lib/eve/core_extensions/hash_spec.rb +23 -0
  105. data/spec/lib/eve/core_extensions/string_spec.rb +8 -0
  106. data/spec/lib/eve/helpers/javascript_helper_spec.rb +80 -0
  107. data/spec/lib/eve/helpers/view_helper_spec.rb +12 -0
  108. data/spec/lib/eve/trust/controller_helpers_spec.rb +70 -0
  109. data/spec/lib/eve/trust/igb_interface_spec.rb +102 -0
  110. data/spec/rcov.opts +2 -0
  111. data/spec/readme_spec.rb +36 -0
  112. data/spec/sample_api_key.yml +20 -0
  113. data/spec/spec.opts +4 -0
  114. data/spec/spec_helper.rb +22 -0
  115. data/spec/support/behaves_like_rowset.rb +50 -0
  116. data/spec/support/controllers/trust_controller.rb +7 -0
  117. data/spec/support/jpg/mock_portrait.jpg +0 -0
  118. data/spec/support/mock_api_helpers.rb +41 -0
  119. data/spec/support/xml/account/characters.xml +15 -0
  120. data/spec/support/xml/character/account_balance.xml +10 -0
  121. data/spec/support/xml/character/asset_list.xml +50 -0
  122. data/spec/support/xml/character/character_sheet.xml +65 -0
  123. data/spec/support/xml/character/fac_war_stats.xml +20 -0
  124. data/spec/support/xml/character/industry_jobs.xml +70 -0
  125. data/spec/support/xml/character/kill_log.xml +51 -0
  126. data/spec/support/xml/character/mail_messages.xml +12 -0
  127. data/spec/support/xml/character/mailing_lists.xml +12 -0
  128. data/spec/support/xml/character/market_orders.xml +11 -0
  129. data/spec/support/xml/character/medals.xml +13 -0
  130. data/spec/support/xml/character/research.xml +13 -0
  131. data/spec/support/xml/character/skill_in_training.xml +14 -0
  132. data/spec/support/xml/character/skill_not_in_training.xml +7 -0
  133. data/spec/support/xml/character/skill_queue.xml +11 -0
  134. data/spec/support/xml/character/standings.xml +32 -0
  135. data/spec/support/xml/character/wallet_journal.xml +39 -0
  136. data/spec/support/xml/character/wallet_transactions.xml +44 -0
  137. data/spec/support/xml/corporation/account_balance.xml +15 -0
  138. data/spec/support/xml/corporation/asset_list.xml +50 -0
  139. data/spec/support/xml/corporation/container_log.xml +32 -0
  140. data/spec/support/xml/corporation/fac_war_stats.xml +19 -0
  141. data/spec/support/xml/corporation/industry_jobs.xml +70 -0
  142. data/spec/support/xml/corporation/kill_log.xml +51 -0
  143. data/spec/support/xml/corporation/market_orders.xml +37 -0
  144. data/spec/support/xml/corporation/medals.xml +8 -0
  145. data/spec/support/xml/corporation/member_corporation_sheet.xml +51 -0
  146. data/spec/support/xml/corporation/member_medals.xml +10 -0
  147. data/spec/support/xml/corporation/member_security.xml +21 -0
  148. data/spec/support/xml/corporation/member_security_log.xml +55 -0
  149. data/spec/support/xml/corporation/member_tracking.xml +18 -0
  150. data/spec/support/xml/corporation/non_member_corporation_sheet.xml +30 -0
  151. data/spec/support/xml/corporation/shareholders.xml +11 -0
  152. data/spec/support/xml/corporation/standings.xml +33 -0
  153. data/spec/support/xml/corporation/starbase_detail.xml +33 -0
  154. data/spec/support/xml/corporation/starbase_list.xml +17 -0
  155. data/spec/support/xml/corporation/titles.xml +34 -0
  156. data/spec/support/xml/corporation/wallet_journal.xml +40 -0
  157. data/spec/support/xml/corporation/wallet_transactions.xml +12 -0
  158. data/spec/support/xml/errors/106.xml +5 -0
  159. data/spec/support/xml/errors/516.xml +5 -0
  160. data/spec/support/xml/eve/alliance_list.xml +22 -0
  161. data/spec/support/xml/eve/certificate_tree.xml +49 -0
  162. data/spec/support/xml/eve/character_id.xml +15 -0
  163. data/spec/support/xml/eve/conquerable_station_list.xml +24 -0
  164. data/spec/support/xml/eve/error_list.xml +78 -0
  165. data/spec/support/xml/eve/fac_war_stats.xml +31 -0
  166. data/spec/support/xml/eve/fac_war_top_stats.xml +238 -0
  167. data/spec/support/xml/eve/ref_types.xml +105 -0
  168. data/spec/support/xml/eve/skill_tree.xml +52 -0
  169. data/spec/support/xml/map/fac_war_systems.xml +180 -0
  170. data/spec/support/xml/map/jumps.xml +166 -0
  171. data/spec/support/xml/map/kills.xml +191 -0
  172. data/spec/support/xml/map/sovereignty.xml +20 -0
  173. data/spec/support/xml/rowset_with_mismatched_attributes.xml +6 -0
  174. data/spec/support/xml/server/server_status.xml +9 -0
  175. metadata +364 -0
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Character do
4
+ context "#research" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('character', 'research', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should provide a list of research jobs" do
11
+ subject.research.should behave_like_rowset('agentID,skillTypeID,researchStartDate,pointsPerDay,remainderPoints')
12
+ end
13
+ end
14
+
15
+ context "without an api key" do
16
+ it "should raise an ArgumentError" do
17
+ proc { mock_service('character', 'research') }.should raise_error(ArgumentError)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,44 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Character do
4
+ context "#skill_in_training" do
5
+ context "with a valid api key" do
6
+ context "with a character that is training" do
7
+ subject { mock_service('xml/character/skill_in_training.xml', :user_id => $user_id,
8
+ :character_id => $character_id,
9
+ :api_key => $limited_api_key).character.skill_in_training }
10
+
11
+
12
+ it "should return skill training information" do
13
+ subject.current_tq_time.should == Time.parse('2008-08-17 06:43:00 +0000')
14
+ subject.training_end_time.should == Time.parse('2008-08-17 15:29:44 +0000')
15
+ subject.training_start_time.should == Time.parse('2008-08-15 04:01:16 +0000')
16
+ subject.training_type_id.should == 3305
17
+ subject.training_start_sp.should == 24000
18
+ subject.training_destination_sp.should == 135765
19
+ subject.training_to_level.should == 4
20
+ subject.skill_in_training.should == 1
21
+ end
22
+ end
23
+
24
+ context "with a character that is not training" do
25
+ subject { mock_service('xml/character/skill_not_in_training.xml', :user_id => $user_id,
26
+ :character_id => $character_id,
27
+ :api_key => $full_api_key).character.skill_in_training }
28
+
29
+
30
+ it "should produce a result with #skill_in_training == 0" do
31
+ subject.skill_in_training.should == 0
32
+ end
33
+ end
34
+ end
35
+
36
+ context "without an api key" do
37
+ subject { mock_service('xml/character/skill_in_training.xml', {}) }
38
+
39
+ it "should raise an ArgumentError" do
40
+ proc { subject.character.skill_in_training }.should raise_error(ArgumentError)
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Character do
4
+ context "#skill_queue" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('character', 'skill_queue', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $limited_api_key) }
9
+
10
+ it "should return the character's training queue" do
11
+ subject.skillqueue.should behave_like_rowset('queuePosition,typeID,level,startSP,endSP,startTime,endTime')
12
+ end
13
+ end
14
+
15
+ context "without an api key" do
16
+ it "should raise an ArgumentError" do
17
+ proc { mock_service('character', 'skill_queue') }.should raise_error(ArgumentError)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Character do
4
+ context "#standings" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('character', 'standings', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $limited_api_key) }
9
+
10
+ it "should return the character's training queue" do
11
+ subject.standings_to.characters.should behave_like_rowset('toID,toName,standing')
12
+ subject.standings_to.corporations.should behave_like_rowset('toID,toName,standing')
13
+
14
+ subject.standings_from.agents.should behave_like_rowset('fromID,fromName,standing')
15
+ subject.standings_from.npc_corporations.should behave_like_rowset('fromID,fromName,standing')
16
+ subject.standings_from.factions.should behave_like_rowset('fromID,fromName,standing')
17
+ end
18
+ end
19
+
20
+ context "without an api key" do
21
+ it "should raise an ArgumentError" do
22
+ proc { mock_service('character', 'standings') }.should raise_error(ArgumentError)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Character do
4
+ context "#wallet_journal" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('character', 'wallet_journal', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should provide a list of wallet journal entries" do
11
+ subject.entries.should behave_like_rowset('date,refID,refTypeID,ownerName1,ownerID1,ownerName2,ownerID2,argName1,argID1,amount,balance,reason, taxRecieverID, taxAmount')
12
+ end
13
+ end
14
+
15
+ context "without an api key" do
16
+ it "should raise an ArgumentError" do
17
+ proc { mock_service('character', 'wallet_journal') }.should raise_error(ArgumentError)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Character do
4
+ context "#wallet_transactions" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('character', 'wallet_transactions', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should provide a list of wallet transaction entries" do
11
+ subject.transactions.should behave_like_rowset('transactionDateTime,transactionID,quantity,typeName,typeID,price,clientID,clientName,stationID,stationName,transactionType,transactionFor')
12
+ end
13
+ end
14
+
15
+ context "without an api key" do
16
+ it "should raise an ArgumentError" do
17
+ proc { mock_service('character', 'wallet_transactions') }.should raise_error(ArgumentError)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,17 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API do
4
+ context "#character_portrait" do
5
+ it "should be a binary string" do
6
+ mock_service('jpg/mock_portrait.jpg')
7
+ subject.character_portrait('1234567890').should be_a(String)
8
+ end
9
+
10
+ it "should be cached" do
11
+ Eve.cache.delete_matched /\/serv\.asp/
12
+ Net::HTTP.should_receive(:post_form).once.and_return(mock_http_response('jpg/mock_portrait.jpg'))
13
+ subject.character_portrait('1234567890')
14
+ subject.character_portrait('1234567890')
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#account_balance" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'account_balance', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should load account balances" do
11
+ subject.accounts.should behave_like_rowset('accountID,accountKey,balance')
12
+ end
13
+ end
14
+
15
+ context "without an api key" do
16
+ it "should raise an ArgumentError" do
17
+ proc { mock_service('corporation', 'account_balance') }.should raise_error(ArgumentError)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#asset_list" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'asset_list', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should load a list of assets" do
11
+ subject.assets.should behave_like_rowset('itemID,locationID,typeID,quantity,flag,singleton') { |asset|
12
+ if asset.respond_to?(:contents)
13
+ asset.contents.should behave_like_rowset('itemID,typeID,quantity,flag,singleton')
14
+ end
15
+ }
16
+ end
17
+ end
18
+
19
+ context "without an api key" do
20
+ it "should raise an ArgumentError" do
21
+ proc { mock_service('corporation', 'asset_list') }.should raise_error(ArgumentError)
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#container_log" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'container_log', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should load a list of container log entries" do
11
+ subject.container_log.should behave_like_rowset('logTime,itemID,itemTypeID,actorID,actorName,flag,locationID,
12
+ action,passwordType,typeID,quantity,oldConfiguration,
13
+ newConfiguration')
14
+ end
15
+ end
16
+
17
+ context "without an api key" do
18
+ it "should raise an ArgumentError" do
19
+ proc { mock_service('corporation', 'container_log') }.should raise_error(ArgumentError)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,36 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#corporation_sheet" do
5
+ context "with a valid api key" do
6
+ subject {
7
+ mock_service('xml/corporation/member_corporation_sheet.xml', :user_id => $user_id,
8
+ :character_id => $character_id,
9
+ :api_key => $limited_api_key
10
+ ).corporation.corporation_sheet
11
+ }
12
+
13
+ it "should load a corporation sheet with wallet and division information" do
14
+ subject.corporation_id.should == 150212025
15
+ subject.corporation_name.should == "Banana Republic"
16
+ subject.ticker.should == "BR"
17
+ subject.divisions.should have(7).elements
18
+ subject.wallet_divisions.should have(7).elements
19
+ subject.logo.should_not be_nil
20
+ end
21
+ end
22
+
23
+ context "without an api key" do
24
+ subject { mock_service('xml/corporation/non_member_corporation_sheet.xml').corporation.corporation_sheet }
25
+
26
+ it "should load a corporation sheet without wallet or division information" do
27
+ subject.corporation_id.should == 150333466
28
+ subject.corporation_name.should == "Marcus Corp"
29
+ subject.ticker.should == "MATT2"
30
+ subject.should_not respond_to(:divisions)
31
+ subject.should_not respond_to(:wallet_divisions)
32
+ subject.logo.should_not be_nil
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#fac_war_stats" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'fac_war_stats', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $limited_api_key) }
9
+
10
+ it "should load factional warfare stats" do
11
+ subject.faction_id.should == 500001
12
+ subject.faction_name.should == "Caldari State"
13
+ subject.pilots.should == 6
14
+ end
15
+ end
16
+
17
+ context "without an api key" do
18
+ it "should raise an ArgumentError" do
19
+ proc { mock_service('corporation', 'fac_war_stats') }.should raise_error(ArgumentError)
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#industry_jobs" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'industry_jobs', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should load a list of industry jobs" do
11
+ subject.jobs.should behave_like_rowset('jobID,assemblyLineID,containerID,
12
+ installedItemID,installedItemLocationID,installedItemQuantity,
13
+ installedItemProductivityLevel,installedItemMaterialLevel,
14
+ installedItemLicensedProductionRunsRemaining,outputLocationID,
15
+ installerID,runs,licensedProductionRuns,installedInSolarSystemID,
16
+ containerLocationID,materialMultiplier,charMaterialMultiplier,
17
+ timeMultiplier,charTimeMultiplier,installedItemTypeID,outputTypeID,
18
+ containerTypeID,installedItemCopy,completed,completedSuccessfully,
19
+ installedItemFlag,outputFlag,activityID,completedStatus,installTime,
20
+ beginProductionTime,endProductionTime,pauseProductionTime')
21
+ end
22
+ end
23
+
24
+ context "without an api key" do
25
+ it "should raise an ArgumentError" do
26
+ proc { mock_service('corporation', 'industry_jobs') }.should raise_error(ArgumentError)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#kill_log" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'kill_log', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should provide a kill list" do
11
+ subject.kills.should behave_like_rowset('killID,solarSystemID,killTime,moonID') { |kill|
12
+ kill.victim.character_name.should == "Dieinafire"
13
+
14
+ kill.attackers.should behave_like_rowset('characterID,characterName,corporationID,corporationName,allianceID,
15
+ allianceName,securityStatus,damageDone,finalBlow,weaponTypeID,shipTypeID')
16
+ kill.items.should behave_like_rowset('typeID,flag,qtyDropped,qtyDestroyed')
17
+ }
18
+ end
19
+ end
20
+
21
+ context "without an api key" do
22
+ it "should raise an ArgumentError" do
23
+ proc { mock_service('corporation', 'kill_log') }.should raise_error(ArgumentError)
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#market_orders" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'market_orders', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should load a list of market orders" do
11
+ subject.orders.should behave_like_rowset('orderID,charID,stationID,volEntered,volRemaining,minVolume,
12
+ orderState,typeID,range,accountKey,duration,escrow,price,bid,issued')
13
+ end
14
+ end
15
+
16
+ context "without an api key" do
17
+ it "should raise an ArgumentError" do
18
+ proc { mock_service('corporation', 'market_orders') }.should raise_error(ArgumentError)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#medals" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'medals', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $limited_api_key) }
9
+
10
+ it "should load a list of corporation medals" do
11
+ subject.medals.should behave_like_rowset('medalID,title,description,creatorID,created')
12
+ end
13
+ end
14
+
15
+ context "without an api key" do
16
+ it "should raise an ArgumentError" do
17
+ proc { mock_service('corporation', 'medals') }.should raise_error(ArgumentError)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,21 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#member_medals" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'member_medals', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $limited_api_key) }
9
+
10
+ it "should load a list of issued medals" do
11
+ subject.issued_medals.should behave_like_rowset('medalID,characterID,reason,status,issuerID,issued')
12
+ end
13
+ end
14
+
15
+ context "without an api key" do
16
+ it "should raise an ArgumentError" do
17
+ proc { mock_service('corporation', 'member_medals') }.should raise_error(ArgumentError)
18
+ end
19
+ end
20
+ end
21
+ end