eveapi 0.1.1 → 0.1.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 (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
@@ -1,73 +0,0 @@
1
- require 'spec_helper'
2
- require 'eveapi'
3
-
4
- describe EVEApi, :vcr do
5
- before :each do
6
- @client = Client.new
7
- end
8
- it 'there should be a connection class' do
9
- expect { @client }.not_to raise_error
10
- end
11
-
12
- it 'connection instance variable should be of class Excon::Connection' do
13
- expect(@client.connection).to be_a(Excon::Connection)
14
- end
15
-
16
- it 'check_path method should return an empty string when name contains of 1 part' do
17
- expect(@client.check_path('name')).to eq('')
18
- end
19
-
20
- it 'check_path method should return a path string when name contains of 2 or more parts' do
21
- expect(@client.check_path('name_name')).to be_a(String)
22
- expect(@client.check_path('name_name')).not_to be_empty
23
- end
24
-
25
- it 'params should return an empty hash when no param variables present' do
26
- expect(Client.new.params).to be_a(Hash)
27
- expect(Client.new.params).to be_empty
28
- end
29
-
30
- it 'calling a method present in the EVEApi should success' do
31
- expect { @client.server_server_status }.not_to raise_error
32
- end
33
-
34
- it 'calling a method not present in the EVEApi should fail' do
35
- expect { @client.some_bs_method }.to raise_error(RuntimeError)
36
- end
37
-
38
- it 'calling api_methods should return an Array of method symobls' do
39
- expect(@client.api_methods).to be_an(Array)
40
- end
41
-
42
- Client.new.working_methods.each do |m|
43
- before :each do
44
- @client.key_id = '4278167'
45
- @client.vcode = 'supersecretstuff'
46
- @client.character_id = '95512059'
47
- end
48
- it "calling api method #{m}" do
49
- expect { @client.send(m) }.not_to raise_error
50
- end
51
- end
52
- end
53
-
54
- describe EVEApi::Request, :vcr do
55
- it 'there should be a EVEApi::Response class' do
56
- expect { Request }.not_to raise_error
57
- end
58
- end
59
-
60
- describe EVEApi::Crest, :vcr do
61
- before :each do
62
- @crest = Crest.new
63
- end
64
-
65
- it 'Crest.new should succeed' do
66
- expect { @crest }.not_to raise_error
67
- end
68
-
69
- it 'alliances crest methods should return an Array of alliances' do
70
- expect { @crest.alliances }.not_to raise_error
71
- expect(@crest.alliances).to be_an(Array)
72
- end
73
- end