eve-4 2.0.1 → 2.0.2

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 (182) hide show
  1. checksums.yaml +4 -4
  2. data/.DS_Store +0 -0
  3. data/.gitignore +0 -0
  4. data/.idea/.name +1 -0
  5. data/.idea/.rakeTasks +7 -0
  6. data/.idea/dictionaries/tylercollins.xml +3 -0
  7. data/.idea/encodings.xml +5 -0
  8. data/.idea/eve-updated.iml +58 -0
  9. data/.idea/misc.xml +5 -0
  10. data/.idea/modules.xml +9 -0
  11. data/.idea/scopes/scope_settings.xml +5 -0
  12. data/.idea/vcs.xml +7 -0
  13. data/.idea/workspace.xml +554 -0
  14. data/Gemfile +2 -0
  15. data/Gemfile.lock +108 -0
  16. data/History.txt +7 -0
  17. data/Rakefile +37 -0
  18. data/eve.gemspec +36 -0
  19. data/lib/eve.rb +26 -0
  20. data/lib/eve/api.rb +249 -0
  21. data/lib/eve/api/connectivity.rb +39 -0
  22. data/lib/eve/api/request.rb +80 -0
  23. data/lib/eve/api/response.rb +34 -0
  24. data/lib/eve/api/response/result.rb +87 -0
  25. data/lib/eve/api/response/row.rb +42 -0
  26. data/lib/eve/api/response/rowset.rb +18 -0
  27. data/lib/eve/api/services.rb +20 -0
  28. data/lib/eve/api/services/account.rb +12 -0
  29. data/lib/eve/api/services/character.rb +96 -0
  30. data/lib/eve/api/services/corporation.rb +150 -0
  31. data/lib/eve/api/services/eve.rb +76 -0
  32. data/lib/eve/api/services/map.rb +45 -0
  33. data/lib/eve/api/services/misc.rb +24 -0
  34. data/lib/eve/api/services/server.rb +20 -0
  35. data/lib/eve/dependencies.rb +48 -0
  36. data/lib/eve/deprecation.rb +3 -0
  37. data/lib/eve/errors.rb +129 -0
  38. data/lib/eve/errors/authentication_errors.rb +33 -0
  39. data/lib/eve/errors/internal_errors.rb +64 -0
  40. data/lib/eve/errors/miscellaneous_errors.rb +19 -0
  41. data/lib/eve/errors/user_input_errors.rb +62 -0
  42. data/lib/eve/javascript_helper.rb +196 -0
  43. data/lib/eve/trust.rb +87 -0
  44. data/lib/eve/trust/controller_helpers.rb +86 -0
  45. data/lib/eve/trust/igb_interface.rb +92 -0
  46. data/lib/eve/trust/mime_types.rb +4 -0
  47. data/lib/eve/version.rb +8 -0
  48. data/log/development.log +30 -0
  49. data/spec/controllers/controller_helpers_spec.rb +91 -0
  50. data/spec/helpers/javascript_helper_spec.rb +80 -0
  51. data/spec/helpers/view_helper_spec.rb +7 -0
  52. data/spec/lib/eve/api/calls/account/characters_spec.rb +22 -0
  53. data/spec/lib/eve/api/calls/character/account_balance_spec.rb +21 -0
  54. data/spec/lib/eve/api/calls/character/asset_list_spec.rb +23 -0
  55. data/spec/lib/eve/api/calls/character/character_sheet_spec.rb +51 -0
  56. data/spec/lib/eve/api/calls/character/fac_war_stats_spec.rb +31 -0
  57. data/spec/lib/eve/api/calls/character/industry_jobs_spec.rb +27 -0
  58. data/spec/lib/eve/api/calls/character/kill_log_spec.rb +27 -0
  59. data/spec/lib/eve/api/calls/character/mail_messages_spec.rb +21 -0
  60. data/spec/lib/eve/api/calls/character/mailing_lists_spec.rb +21 -0
  61. data/spec/lib/eve/api/calls/character/market_orders_spec.rb +21 -0
  62. data/spec/lib/eve/api/calls/character/medals_spec.rb +24 -0
  63. data/spec/lib/eve/api/calls/character/research_spec.rb +21 -0
  64. data/spec/lib/eve/api/calls/character/skill_in_training_spec.rb +44 -0
  65. data/spec/lib/eve/api/calls/character/skill_queue_spec.rb +21 -0
  66. data/spec/lib/eve/api/calls/character/standings_spec.rb +26 -0
  67. data/spec/lib/eve/api/calls/character/wallet_journal_spec.rb +21 -0
  68. data/spec/lib/eve/api/calls/character/wallet_transactions_spec.rb +21 -0
  69. data/spec/lib/eve/api/calls/character_portrait_spec.rb +17 -0
  70. data/spec/lib/eve/api/calls/corporation/account_balances_spec.rb +21 -0
  71. data/spec/lib/eve/api/calls/corporation/asset_list_spec.rb +25 -0
  72. data/spec/lib/eve/api/calls/corporation/container_log_spec.rb +23 -0
  73. data/spec/lib/eve/api/calls/corporation/corporation_sheet_spec.rb +36 -0
  74. data/spec/lib/eve/api/calls/corporation/fac_war_stats_spec.rb +23 -0
  75. data/spec/lib/eve/api/calls/corporation/industry_jobs_spec.rb +30 -0
  76. data/spec/lib/eve/api/calls/corporation/kill_log_spec.rb +27 -0
  77. data/spec/lib/eve/api/calls/corporation/market_orders_spec.rb +22 -0
  78. data/spec/lib/eve/api/calls/corporation/medals_spec.rb +21 -0
  79. data/spec/lib/eve/api/calls/corporation/member_medals_spec.rb +21 -0
  80. data/spec/lib/eve/api/calls/corporation/member_security_log_spec.rb +24 -0
  81. data/spec/lib/eve/api/calls/corporation/member_security_spec.rb +25 -0
  82. data/spec/lib/eve/api/calls/corporation/member_tracking_spec.rb +22 -0
  83. data/spec/lib/eve/api/calls/corporation/shareholders_spec.rb +23 -0
  84. data/spec/lib/eve/api/calls/corporation/standings_spec.rb +30 -0
  85. data/spec/lib/eve/api/calls/corporation/starbase_detail_spec.rb +32 -0
  86. data/spec/lib/eve/api/calls/corporation/starbase_list_spec.rb +22 -0
  87. data/spec/lib/eve/api/calls/corporation/titles_spec.rb +26 -0
  88. data/spec/lib/eve/api/calls/corporation/wallet_journal_spec.rb +22 -0
  89. data/spec/lib/eve/api/calls/corporation/wallet_transactions_spec.rb +22 -0
  90. data/spec/lib/eve/api/calls/empty_call_spec.rb +29 -0
  91. data/spec/lib/eve/api/calls/eve/alliance_list_spec.rb +26 -0
  92. data/spec/lib/eve/api/calls/eve/certificate_tree_spec.rb +18 -0
  93. data/spec/lib/eve/api/calls/eve/character_id_spec.rb +27 -0
  94. data/spec/lib/eve/api/calls/eve/conquerable_station_list_spec.rb +11 -0
  95. data/spec/lib/eve/api/calls/eve/error_list_spec.rb +21 -0
  96. data/spec/lib/eve/api/calls/eve/fac_war_stats_spec.rb +25 -0
  97. data/spec/lib/eve/api/calls/eve/fac_war_top_stats_spec.rb +54 -0
  98. data/spec/lib/eve/api/calls/eve/ref_types_spec.rb +11 -0
  99. data/spec/lib/eve/api/calls/eve/skill_tree_spec.rb +17 -0
  100. data/spec/lib/eve/api/calls/map/fac_war_systems_spec.rb +11 -0
  101. data/spec/lib/eve/api/calls/map/jumps_spec.rb +11 -0
  102. data/spec/lib/eve/api/calls/map/kills_spec.rb +11 -0
  103. data/spec/lib/eve/api/calls/map/sovereignty_spec.rb +11 -0
  104. data/spec/lib/eve/api/calls/server_status_spec.rb +28 -0
  105. data/spec/lib/eve/api/request_spec.rb +18 -0
  106. data/spec/lib/eve/api/response/error_spec.rb +13 -0
  107. data/spec/lib/eve/api/response_spec.rb +79 -0
  108. data/spec/lib/eve/api_spec.rb +13 -0
  109. data/spec/lib/eve/core_extensions/hash_spec.rb +23 -0
  110. data/spec/lib/eve/core_extensions/string_spec.rb +8 -0
  111. data/spec/lib/eve/trust/igb_interface_spec.rb +112 -0
  112. data/spec/log/development.log +0 -0
  113. data/spec/rcov.opts +2 -0
  114. data/spec/readme_spec.rb +36 -0
  115. data/spec/sample_api_key.yml +20 -0
  116. data/spec/spec.opts +4 -0
  117. data/spec/spec_helper.rb +63 -0
  118. data/spec/support/behaves_like_rowset.rb +50 -0
  119. data/spec/support/controllers/trust_controller.rb +24 -0
  120. data/spec/support/jpg/mock_portrait.jpg +0 -0
  121. data/spec/support/mock_api_helpers.rb +46 -0
  122. data/spec/support/views/trust/html_and_igb.html.erb +1 -0
  123. data/spec/support/views/trust/html_and_igb.igb.erb +1 -0
  124. data/spec/support/views/trust/html_only.html.erb +1 -0
  125. data/spec/support/views/trust/igb_only.igb.erb +1 -0
  126. data/spec/support/xml/account/characters.xml +15 -0
  127. data/spec/support/xml/character/account_balance.xml +10 -0
  128. data/spec/support/xml/character/asset_list.xml +50 -0
  129. data/spec/support/xml/character/character_sheet.xml +65 -0
  130. data/spec/support/xml/character/fac_war_stats.xml +20 -0
  131. data/spec/support/xml/character/industry_jobs.xml +70 -0
  132. data/spec/support/xml/character/kill_log.xml +51 -0
  133. data/spec/support/xml/character/mail_messages.xml +12 -0
  134. data/spec/support/xml/character/mailing_lists.xml +12 -0
  135. data/spec/support/xml/character/market_orders.xml +11 -0
  136. data/spec/support/xml/character/medals.xml +13 -0
  137. data/spec/support/xml/character/research.xml +13 -0
  138. data/spec/support/xml/character/skill_in_training.xml +14 -0
  139. data/spec/support/xml/character/skill_not_in_training.xml +7 -0
  140. data/spec/support/xml/character/skill_queue.xml +11 -0
  141. data/spec/support/xml/character/standings.xml +32 -0
  142. data/spec/support/xml/character/wallet_journal.xml +39 -0
  143. data/spec/support/xml/character/wallet_transactions.xml +44 -0
  144. data/spec/support/xml/corporation/account_balance.xml +15 -0
  145. data/spec/support/xml/corporation/asset_list.xml +50 -0
  146. data/spec/support/xml/corporation/container_log.xml +32 -0
  147. data/spec/support/xml/corporation/fac_war_stats.xml +19 -0
  148. data/spec/support/xml/corporation/industry_jobs.xml +70 -0
  149. data/spec/support/xml/corporation/kill_log.xml +51 -0
  150. data/spec/support/xml/corporation/market_orders.xml +37 -0
  151. data/spec/support/xml/corporation/medals.xml +8 -0
  152. data/spec/support/xml/corporation/member_corporation_sheet.xml +51 -0
  153. data/spec/support/xml/corporation/member_medals.xml +10 -0
  154. data/spec/support/xml/corporation/member_security.xml +21 -0
  155. data/spec/support/xml/corporation/member_security_log.xml +55 -0
  156. data/spec/support/xml/corporation/member_tracking.xml +18 -0
  157. data/spec/support/xml/corporation/non_member_corporation_sheet.xml +30 -0
  158. data/spec/support/xml/corporation/shareholders.xml +11 -0
  159. data/spec/support/xml/corporation/standings.xml +33 -0
  160. data/spec/support/xml/corporation/starbase_detail.xml +33 -0
  161. data/spec/support/xml/corporation/starbase_list.xml +17 -0
  162. data/spec/support/xml/corporation/titles.xml +34 -0
  163. data/spec/support/xml/corporation/wallet_journal.xml +40 -0
  164. data/spec/support/xml/corporation/wallet_transactions.xml +12 -0
  165. data/spec/support/xml/errors/106.xml +5 -0
  166. data/spec/support/xml/errors/516.xml +5 -0
  167. data/spec/support/xml/eve/alliance_list.xml +22 -0
  168. data/spec/support/xml/eve/certificate_tree.xml +49 -0
  169. data/spec/support/xml/eve/character_id.xml +15 -0
  170. data/spec/support/xml/eve/conquerable_station_list.xml +24 -0
  171. data/spec/support/xml/eve/error_list.xml +78 -0
  172. data/spec/support/xml/eve/fac_war_stats.xml +31 -0
  173. data/spec/support/xml/eve/fac_war_top_stats.xml +238 -0
  174. data/spec/support/xml/eve/ref_types.xml +105 -0
  175. data/spec/support/xml/eve/skill_tree.xml +52 -0
  176. data/spec/support/xml/map/fac_war_systems.xml +180 -0
  177. data/spec/support/xml/map/jumps.xml +166 -0
  178. data/spec/support/xml/map/kills.xml +191 -0
  179. data/spec/support/xml/map/sovereignty.xml +20 -0
  180. data/spec/support/xml/rowset_with_mismatched_attributes.xml +6 -0
  181. data/spec/support/xml/server/server_status.xml +9 -0
  182. metadata +310 -2
@@ -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
@@ -0,0 +1,24 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#member_security_log" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'member_security_log', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should load lists of role changes for members in corporation" do
11
+ subject.role_history.should behave_like_rowset('changeTime,characterID,issuerID,roleLocationType') { |history|
12
+ history.old_roles.should behave_like_rowset('roleID,roleName')
13
+ history.new_roles.should behave_like_rowset('roleID,roleName')
14
+ }
15
+ end
16
+ end
17
+
18
+ context "without an api key" do
19
+ it "should raise an ArgumentError" do
20
+ proc { mock_service('corporation', 'member_security_log') }.should raise_error(ArgumentError)
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#member_security" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'member_security', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should load lists of roles and titles for specified user" do
11
+ %w(roles grantable_roles roles_at_hq grantable_roles_at_hq roles_at_base grantable_roles_at_base
12
+ roles_at_other grantable_roles_at_other).each do |row|
13
+ subject.member.send(row).should behave_like_rowset('roleID,roleName')
14
+ end
15
+ subject.member.titles.should behave_like_rowset('titleID,titleName')
16
+ end
17
+ end
18
+
19
+ context "without an api key" do
20
+ it "should raise an ArgumentError" do
21
+ proc { mock_service('corporation', 'member_security') }.should raise_error(ArgumentError)
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#member_tracking" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'member_tracking', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should load a list of members" do
11
+ subject.members.should behave_like_rowset('characterID,name,startDateTime,baseID,base,title,logonDateTime,
12
+ logoffDateTime,locationID,location,shipTypeID,shipType,roles,grantableRoles')
13
+ end
14
+ end
15
+
16
+ context "without an api key" do
17
+ it "should raise an ArgumentError" do
18
+ proc { mock_service('corporation', 'member_tracking') }.should raise_error(ArgumentError)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,23 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#shareholders" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'shareholders', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should load a list of shareholders" do
11
+ subject.characters.should behave_like_rowset('shareholderID,shareholderName,shareholderCorporationID,
12
+ shareholderCorporationName,shares')
13
+ subject.corporations.should behave_like_rowset('shareholderID,shareholderName,shares')
14
+ end
15
+ end
16
+
17
+ context "without an api key" do
18
+ it "should raise an ArgumentError" do
19
+ proc { mock_service('corporation', 'shareholders') }.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 "#standings" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'standings', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should load a list of standings" do
11
+ subject.corporation_standings.standings_to.characters.should behave_like_rowset('toID,toName,standing')
12
+ subject.corporation_standings.standings_to.corporations.should behave_like_rowset('toID,toName,standing')
13
+ subject.corporation_standings.standings_to.alliances.should behave_like_rowset('toID,toName,standing')
14
+
15
+ subject.corporation_standings.standings_from.agents.should behave_like_rowset('fromID,fromName,standing')
16
+ subject.corporation_standings.standings_from.npc_corporations.should behave_like_rowset('fromID,fromName,standing')
17
+ subject.corporation_standings.standings_from.factions.should behave_like_rowset('fromID,fromName,standing')
18
+
19
+ subject.alliance_standings.standings_to.corporations.should behave_like_rowset('toID,toName,standing')
20
+ subject.alliance_standings.standings_to.alliances.should behave_like_rowset('toID,toName,standing')
21
+ end
22
+ end
23
+
24
+ context "without an api key" do
25
+ it "should raise an ArgumentError" do
26
+ proc { mock_service('corporation', 'standings') }.should raise_error(ArgumentError)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,32 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#starbase_detail" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'starbase_detail', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key,
9
+ :args => ['1234567890']) }
10
+
11
+ it "should load starbase details" do
12
+ subject.state.should == 4
13
+ subject.general_settings.usage_flags.should == 3
14
+ subject.general_settings.deploy_flags.should == 0
15
+ subject.general_settings.allow_corporation_members.should == 1
16
+ subject.general_settings.allow_alliance_members.should == 1
17
+ subject.combat_settings.on_standing_drop.standing.should == 10
18
+ subject.combat_settings.on_status_drop.enabled.should == 0
19
+ subject.combat_settings.on_status_drop.standing.should == 0
20
+ subject.combat_settings.on_aggression.enabled.should == 0
21
+ subject.combat_settings.on_corporation_war.enabled.should == 1
22
+ subject.fuel.should behave_like_rowset('typeID,quantity')
23
+ end
24
+ end
25
+
26
+ context "without an api key" do
27
+ it "should raise an ArgumentError" do
28
+ proc { mock_service('corporation', 'starbase_detail') }.should raise_error(ArgumentError)
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#starbase_list" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'starbase_list', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should load a list of starbases" do
11
+ subject.starbases.should behave_like_rowset('itemID,typeID,locationID,moonID,state,stateTimestamp,
12
+ onlineTimestamp')
13
+ end
14
+ end
15
+
16
+ context "without an api key" do
17
+ it "should raise an ArgumentError" do
18
+ proc { mock_service('corporation', 'starbase_list') }.should raise_error(ArgumentError)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#titles" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'titles', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should load a list of titles and associated roles" do
11
+ subject.titles.should behave_like_rowset('titleID,titleName') { |title|
12
+ %w(roles grantable_roles roles_at_hq grantable_roles_at_hq roles_at_base grantable_roles_at_base
13
+ roles_at_other grantable_roles_at_other).each do |role|
14
+ title.send(role).should behave_like_rowset('roleID,roleName')
15
+ end
16
+ }
17
+ end
18
+ end
19
+
20
+ context "without an api key" do
21
+ it "should raise an ArgumentError" do
22
+ proc { mock_service('corporation', 'titles') }.should raise_error(ArgumentError)
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#wallet_journal" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'wallet_journal', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should load a list of journal entries" do
11
+ subject.entries.should behave_like_rowset('date,refID,refTypeID,ownerName1,ownerID1,ownerName2,ownerID2,
12
+ argName1,argID1,amount,balance,reason')
13
+ end
14
+ end
15
+
16
+ context "without an api key" do
17
+ it "should raise an ArgumentError" do
18
+ proc { mock_service('corporation', 'wallet_journal') }.should raise_error(ArgumentError)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe Eve::API::Services::Corporation do
4
+ context "#wallet_transactions" do
5
+ context "with a valid api key" do
6
+ subject { mock_service('corporation', 'wallet_transactions', :user_id => $user_id,
7
+ :character_id => $character_id,
8
+ :api_key => $full_api_key) }
9
+
10
+ it "should load a list of wallet transactions" do
11
+ subject.transactions.should behave_like_rowset('transactionDateTime,transactionID,quantity,typeName,typeID,
12
+ price,clientID,clientName,characterID,characterName,stationID,stationName,transactionType,transactionFor')
13
+ end
14
+ end
15
+
16
+ context "without an api key" do
17
+ it "should raise an ArgumentError" do
18
+ proc { mock_service('corporation', 'wallet_transactions') }.should raise_error(ArgumentError)
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,29 @@
1
+ # I'm using this as a copy-and-paste template while I build the API specs.
2
+ =begin
3
+
4
+ require 'spec_helper'
5
+
6
+ describe Eve::API::Services::ChangeMe do
7
+ context "#" do
8
+ context "with a valid api key" do
9
+ subject { mock_service('', '', :user_id => $user_id,
10
+ :character_id => $character_id,
11
+ :api_key => $full_api_key) }
12
+
13
+ it "should do something" do
14
+ subject.something.should behave_like_rowset('') { |row|
15
+
16
+ }
17
+ end
18
+ end
19
+
20
+ context "without an api key" do
21
+ it "should raise an ArgumentError" do
22
+ proc { mock_service('', '') }.should raise_error(ArgumentError)
23
+ end
24
+ end
25
+ end
26
+ end
27
+
28
+
29
+ =end