betfair_api_ng_rails 1.1.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +26 -1
  3. data/Rakefile +8 -8
  4. data/betfair_api_ng_rails.gemspec +12 -7
  5. data/lib/betfair_api_ng_rails.rb +162 -98
  6. data/lib/betfair_api_ng_rails/account.rb +4 -0
  7. data/lib/betfair_api_ng_rails/account_manager.rb +36 -0
  8. data/lib/betfair_api_ng_rails/account_session.rb +5 -0
  9. data/lib/betfair_api_ng_rails/account_session_manager.rb +29 -0
  10. data/lib/betfair_api_ng_rails/api/caching/helper.rb +34 -0
  11. data/lib/betfair_api_ng_rails/api/caching/response_cache.rb +57 -0
  12. data/lib/betfair_api_ng_rails/api/concerns/errorable.rb +1 -3
  13. data/lib/betfair_api_ng_rails/api/config.rb +20 -8
  14. data/lib/betfair_api_ng_rails/api/connection.rb +28 -10
  15. data/lib/betfair_api_ng_rails/api/connection_ext/caching.rb +60 -0
  16. data/lib/betfair_api_ng_rails/api/connection_ext/error_handling.rb +5 -1
  17. data/lib/betfair_api_ng_rails/api/connection_ext/logging.rb +34 -0
  18. data/lib/betfair_api_ng_rails/api/connection_ext/parsing.rb +2 -4
  19. data/lib/betfair_api_ng_rails/api/connection_ext/ssoid_refreshing.rb +40 -0
  20. data/lib/betfair_api_ng_rails/api/constants.rb +39 -18
  21. data/lib/betfair_api_ng_rails/api/data/account_details_response.rb +27 -0
  22. data/lib/betfair_api_ng_rails/api/data/account_funds_response.rb +26 -0
  23. data/lib/betfair_api_ng_rails/api/data/account_statement_report.rb +17 -0
  24. data/lib/betfair_api_ng_rails/api/data/competition.rb +3 -4
  25. data/lib/betfair_api_ng_rails/api/data/competition_result.rb +1 -3
  26. data/lib/betfair_api_ng_rails/api/data/concerns/attributable.rb +2 -6
  27. data/lib/betfair_api_ng_rails/api/data/concerns/hashable.rb +11 -4
  28. data/lib/betfair_api_ng_rails/api/data/constants.rb +2 -4
  29. data/lib/betfair_api_ng_rails/api/data/country_code_result.rb +1 -3
  30. data/lib/betfair_api_ng_rails/api/data/event.rb +1 -2
  31. data/lib/betfair_api_ng_rails/api/data/event_result.rb +1 -3
  32. data/lib/betfair_api_ng_rails/api/data/limit_on_close_order.rb +22 -0
  33. data/lib/betfair_api_ng_rails/api/data/limit_order.rb +23 -0
  34. data/lib/betfair_api_ng_rails/api/data/market_book.rb +2 -4
  35. data/lib/betfair_api_ng_rails/api/data/market_filter.rb +3 -2
  36. data/lib/betfair_api_ng_rails/api/data/market_on_close_order.rb +20 -0
  37. data/lib/betfair_api_ng_rails/api/data/order.rb +1 -3
  38. data/lib/betfair_api_ng_rails/api/data/place_execution_report.rb +24 -0
  39. data/lib/betfair_api_ng_rails/api/data/place_instruction.rb +25 -0
  40. data/lib/betfair_api_ng_rails/api/data/place_instruction_report.rb +27 -0
  41. data/lib/betfair_api_ng_rails/api/data/statement_item.rb +30 -0
  42. data/lib/betfair_api_ng_rails/api/data/statement_legacy_data.rb +40 -0
  43. data/lib/betfair_api_ng_rails/api/endpoint_factory.rb +21 -0
  44. data/lib/betfair_api_ng_rails/api/endpoints/australian.rb +17 -0
  45. data/lib/betfair_api_ng_rails/api/endpoints/base.rb +42 -0
  46. data/lib/betfair_api_ng_rails/api/endpoints/italian.rb +17 -0
  47. data/lib/betfair_api_ng_rails/api/endpoints/spanish.rb +17 -0
  48. data/lib/betfair_api_ng_rails/api/endpoints/uk.rb +17 -0
  49. data/lib/betfair_api_ng_rails/api/enums/execution_report_error_code.rb +22 -1
  50. data/lib/betfair_api_ng_rails/api/enums/execution_report_status.rb +12 -1
  51. data/lib/betfair_api_ng_rails/api/enums/include_item.rb +23 -0
  52. data/lib/betfair_api_ng_rails/api/enums/instruction_report_error_code.rb +25 -1
  53. data/lib/betfair_api_ng_rails/api/enums/instruction_report_status.rb +8 -1
  54. data/lib/betfair_api_ng_rails/api/enums/item_class.rb +19 -0
  55. data/lib/betfair_api_ng_rails/api/enums/order_status.rb +7 -1
  56. data/lib/betfair_api_ng_rails/api/enums/order_type.rb +11 -2
  57. data/lib/betfair_api_ng_rails/api/enums/persistence_type.rb +8 -1
  58. data/lib/betfair_api_ng_rails/api/enums/side.rb +7 -2
  59. data/lib/betfair_api_ng_rails/api/enums/wallet.rb +20 -0
  60. data/lib/betfair_api_ng_rails/api/formatter_factory.rb +2 -4
  61. data/lib/betfair_api_ng_rails/api/formatters/js_tree_formatter.rb +2 -4
  62. data/lib/betfair_api_ng_rails/api/hashalator.rb +6 -6
  63. data/lib/betfair_api_ng_rails/api/helper.rb +2 -4
  64. data/lib/betfair_api_ng_rails/api/http/factory.rb +19 -14
  65. data/lib/betfair_api_ng_rails/api/http/helpers/information_response.rb +2 -4
  66. data/lib/betfair_api_ng_rails/api/http/helpers/keep_alive_response.rb +3 -4
  67. data/lib/betfair_api_ng_rails/api/http/helpers/session_response.rb +3 -4
  68. data/lib/betfair_api_ng_rails/api/http/proxy_requester.rb +87 -0
  69. data/lib/betfair_api_ng_rails/api/http/requester.rb +3 -3
  70. data/lib/betfair_api_ng_rails/api/http/responser.rb +4 -3
  71. data/lib/betfair_api_ng_rails/api/invalid_endpoint_error.rb +6 -0
  72. data/lib/betfair_api_ng_rails/api/logs/console_logger.rb +13 -0
  73. data/lib/betfair_api_ng_rails/api/logs/file_logger.rb +23 -0
  74. data/lib/betfair_api_ng_rails/api/parsers/base.rb +14 -6
  75. data/lib/betfair_api_ng_rails/api/parsers/get_account_details.rb +13 -0
  76. data/lib/betfair_api_ng_rails/api/parsers/get_account_funds.rb +14 -0
  77. data/lib/betfair_api_ng_rails/api/parsers/get_account_statement.rb +15 -0
  78. data/lib/betfair_api_ng_rails/api/parsers/list_base.rb +18 -0
  79. data/lib/betfair_api_ng_rails/api/parsers/list_competitions.rb +5 -7
  80. data/lib/betfair_api_ng_rails/api/parsers/list_countries.rb +5 -7
  81. data/lib/betfair_api_ng_rails/api/parsers/list_event_types.rb +5 -7
  82. data/lib/betfair_api_ng_rails/api/parsers/list_events.rb +5 -7
  83. data/lib/betfair_api_ng_rails/api/parsers/list_market_book.rb +5 -7
  84. data/lib/betfair_api_ng_rails/api/parsers/list_market_catalogue.rb +5 -7
  85. data/lib/betfair_api_ng_rails/api/parsers/list_market_types.rb +5 -7
  86. data/lib/betfair_api_ng_rails/api/parsers/list_time_ranges.rb +5 -7
  87. data/lib/betfair_api_ng_rails/api/parsers/list_venues.rb +5 -7
  88. data/lib/betfair_api_ng_rails/api/parsers/place_orders.rb +14 -0
  89. data/lib/betfair_api_ng_rails/api/parsers/single_base.rb +19 -0
  90. data/lib/betfair_api_ng_rails/api/provider.rb +11 -14
  91. data/lib/betfair_api_ng_rails/api/request_method.rb +43 -0
  92. data/lib/betfair_api_ng_rails/api/request_methods/account.rb +51 -0
  93. data/lib/betfair_api_ng_rails/api/request_methods/all.rb +26 -0
  94. data/lib/betfair_api_ng_rails/api/request_methods/betting.rb +30 -0
  95. data/lib/betfair_api_ng_rails/api/session_manager.rb +34 -31
  96. data/lib/betfair_api_ng_rails/bad_response_error.rb +4 -0
  97. data/lib/betfair_api_ng_rails/errors.rb +3 -2
  98. data/lib/betfair_api_ng_rails/railtie.rb +7 -2
  99. data/lib/betfair_api_ng_rails/version.rb +1 -1
  100. data/lib/generators/betfair_api_ng_rails/install/templates/betfair_api_ng_rails.rb +20 -11
  101. data/lib/generators/betfair_api_ng_rails/install/templates/betfair_api_ng_rails.yml +5 -7
  102. data/spec/lib/betfair_api_ng_rails/account_manager_spec.rb +76 -0
  103. data/spec/lib/betfair_api_ng_rails/account_session_manager_spec.rb +59 -0
  104. data/spec/lib/betfair_api_ng_rails/account_session_spec.rb +13 -0
  105. data/spec/lib/betfair_api_ng_rails/account_spec.rb +18 -0
  106. data/spec/lib/betfair_api_ng_rails/api/caching/helper_spec.rb +89 -0
  107. data/spec/lib/betfair_api_ng_rails/api/caching/response_cache_spec.rb +131 -0
  108. data/spec/lib/betfair_api_ng_rails/api/config_spec.rb +37 -0
  109. data/spec/lib/betfair_api_ng_rails/api/connection_spec.rb +99 -0
  110. data/spec/lib/betfair_api_ng_rails/api/data/account_statement_report_spec.rb +11 -0
  111. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/competition_result_spec.rb +0 -0
  112. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/competition_spec.rb +0 -0
  113. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/concerns/attributable_spec.rb +0 -0
  114. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/concerns/hashable_spec.rb +16 -32
  115. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/concerns/jsonable_spec.rb +0 -0
  116. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/country_code_result_spec.rb +0 -0
  117. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/event_result_spec.rb +0 -0
  118. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/event_spec.rb +0 -0
  119. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/event_type_result_spec.rb +0 -0
  120. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/event_type_spec.rb +0 -0
  121. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/ex_best_offers_overrides_spec.rb +0 -0
  122. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/exchange_prices_spec.rb +0 -0
  123. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/market_book_spec.rb +1 -6
  124. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/market_catalogue_spec.rb +0 -0
  125. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/market_description_spec.rb +0 -0
  126. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/market_filter_spec.rb +0 -0
  127. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/market_type_result_spec.rb +0 -0
  128. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/match_spec.rb +0 -0
  129. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/order_spec.rb +0 -0
  130. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/price_projection_spec.rb +0 -0
  131. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/price_size_spec.rb +0 -0
  132. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/runner_catalog_spec.rb +0 -0
  133. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/runner_spec.rb +0 -0
  134. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/starting_prices_spec.rb +0 -0
  135. data/spec/lib/betfair_api_ng_rails/api/data/statement_item_spec.rb +9 -0
  136. data/spec/lib/betfair_api_ng_rails/api/data/statement_legacy_data_spec.rb +6 -0
  137. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/time_range_result_spec.rb +0 -0
  138. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/time_range_spec.rb +1 -3
  139. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/data/venue_result_spec.rb +0 -0
  140. data/spec/lib/betfair_api_ng_rails/api/endpoint_factory_spec.rb +27 -0
  141. data/spec/lib/betfair_api_ng_rails/api/endpoints/australian_spec.rb +6 -0
  142. data/spec/lib/betfair_api_ng_rails/api/endpoints/base_spec.rb +5 -0
  143. data/spec/lib/betfair_api_ng_rails/api/endpoints/italian_spec.rb +6 -0
  144. data/spec/lib/betfair_api_ng_rails/api/endpoints/spanish_spec.rb +7 -0
  145. data/spec/lib/betfair_api_ng_rails/api/endpoints/uk_spec.rb +6 -0
  146. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/formatters/js_tree_formatter_spec.rb +0 -0
  147. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/hashalator_spec.rb +27 -46
  148. data/spec/lib/betfair_api_ng_rails/api/http/factory_spec.rb +40 -0
  149. data/spec/lib/betfair_api_ng_rails/api/logs/console_logger_spec.rb +18 -0
  150. data/spec/lib/betfair_api_ng_rails/api/logs/file_logger_spec.rb +33 -0
  151. data/spec/lib/betfair_api_ng_rails/api/provider_spec.rb +53 -0
  152. data/spec/lib/betfair_api_ng_rails/api/request_method_spec.rb +38 -0
  153. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/api/request_methods_spec.rb +47 -32
  154. data/spec/lib/betfair_api_ng_rails/api/session_manager_spec.rb +77 -0
  155. data/spec/lib/betfair_api_ng_rails/integration/get_account_statement_spec.rb +57 -0
  156. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_competitions_spec.rb +7 -9
  157. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_countries_spec.rb +7 -9
  158. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_event_types_spec.rb +7 -9
  159. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_events_spec.rb +7 -9
  160. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_market_book_spec.rb +7 -9
  161. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_market_catalogue_spec.rb +7 -16
  162. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_market_types_spec.rb +7 -9
  163. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_time_ranges_spec.rb +7 -9
  164. data/spec/{betfair_api_ng_rails → lib/betfair_api_ng_rails}/integration/list_venues_spec.rb +7 -9
  165. data/spec/lib/betfair_api_ng_rails/integration/place_orders_spec.rb +55 -0
  166. data/spec/spec_helper.rb +9 -1
  167. data/spec/support/base_yaml_loader.rb +2 -4
  168. data/spec/support/data/models.yml +37 -1
  169. data/spec/support/data_models_yaml_loader.rb +1 -3
  170. data/spec/support/have_attr_accessor.rb +18 -0
  171. data/spec/support/helper.rb +1 -3
  172. data/spec/support/shared_examples/base_endpoint.rb +5 -0
  173. data/spec/support/shared_examples/concrete_endpoint.rb +28 -0
  174. data/spec/support/shared_examples/data_model.rb +2 -11
  175. data/spec/support/shared_examples/request_method.rb +5 -8
  176. data/spec/support/shared_examples/simple_list_filtering_request.rb +10 -19
  177. metadata +252 -117
  178. data/lib/betfair_api_ng_rails/api/request_methods.rb +0 -41
  179. data/spec/betfair_api_ng_rails/api/connection_spec.rb +0 -76
  180. data/spec/betfair_api_ng_rails/api/provider_spec.rb +0 -91
  181. data/spec/betfair_api_ng_rails/api/session_manager_spec.rb +0 -59
@@ -1,18 +1,16 @@
1
1
  require 'spec_helper'
2
2
 
3
- module TestModule
4
- extend BetfairApiNgRails::Api::RequestMethods
5
- end
6
-
7
3
  describe "listMarketTypes request method" do
8
-
9
4
  it_behaves_like 'simple list filtering request', 'listMarketTypes' do
10
-
11
5
  let(:method_name) { "list_market_types" }
12
6
  let(:result_class) { BetfairApiNgRails::MarketTypeResult }
13
- let(:result_hash) { "{\"result\": [{\"marketCount\": 1, \"marketType\": \"MATCH_ODDS\"}]}" }
14
-
7
+ let(:result_hash) do
8
+ <<-JSON
9
+ {"result":
10
+ [{"marketCount": 1, "marketType": "MATCH_ODDS"}
11
+ ]}
12
+ JSON
13
+ end
15
14
  end
16
-
17
15
  end
18
16
 
@@ -1,18 +1,16 @@
1
1
  require 'spec_helper'
2
2
 
3
- module TestModule
4
- extend BetfairApiNgRails::Api::RequestMethods
5
- end
6
-
7
3
  describe "listTimeRanges request method" do
8
-
9
4
  it_behaves_like 'simple list filtering request', 'listTimeRanges' do
10
-
11
5
  let(:method_name) { "list_time_ranges" }
12
6
  let(:result_class) { BetfairApiNgRails::TimeRangeResult }
13
- let(:result_hash) { "{\"result\": [{\"marketCount\": 1, \"timeRange\": { \"to\": \"18-04-2014\", \"from\": \"18-04-2014\" }}]}" }
14
-
7
+ let(:result_hash) do
8
+ <<-JSON
9
+ {"result": [
10
+ {"marketCount": 1, "timeRange": { "to": "18-04-2014", "from": "18-04-2014" }}
11
+ ]}
12
+ JSON
13
+ end
15
14
  end
16
-
17
15
  end
18
16
 
@@ -1,18 +1,16 @@
1
1
  require 'spec_helper'
2
2
 
3
- module TestModule
4
- extend BetfairApiNgRails::Api::RequestMethods
5
- end
6
-
7
3
  describe "listVenues request method" do
8
-
9
4
  it_behaves_like 'simple list filtering request', 'listVenues' do
10
-
11
5
  let(:method_name) { "list_venues" }
12
6
  let(:result_class) { BetfairApiNgRails::VenueResult }
13
- let(:result_hash) { "{\"result\": [{\"marketCount\": 1, \"venue\": \"Madrid\"}]}" }
14
-
7
+ let(:result_hash) do
8
+ <<-JSON
9
+ {"result": [
10
+ {"marketCount": 1, "venue": "Madrid"}
11
+ ]}
12
+ JSON
13
+ end
15
14
  end
16
-
17
15
  end
18
16
 
@@ -0,0 +1,55 @@
1
+ require 'spec_helper'
2
+ require 'pry-nav'
3
+
4
+ describe "placeOrders request method" do
5
+ let(:method_name) { "place_orders" }
6
+ let(:result_class) { BetfairApiNgRails::PlaceExecutionReport }
7
+ let(:account) { BetfairApiNgRails::Account.new('user001', 'password', '42f2f434f3g43') }
8
+ let(:result_hash) do
9
+ <<-JSON
10
+ {"result":
11
+ {
12
+ "customerRef": "q2f3f",
13
+ "status": "SOME_STATUS",
14
+ "errorCode": "",
15
+ "marketId": "1.112312312",
16
+ "instructionReports":[
17
+ {}
18
+ ]
19
+ }
20
+ }
21
+ JSON
22
+ end
23
+ let(:parameters) do
24
+ { market_id: '1.111111', customer_ref: 'dqd23d23', instructions: [] }
25
+ end
26
+ let(:logger) { double(:logger) }
27
+
28
+ before(:each) do
29
+ BetfairApiNgRails.config.formatter = nil
30
+ BetfairApiNgRails.log = logger
31
+ allow(logger).to receive(:write)
32
+ allow(BetfairApiNgRails).to receive_message_chain(:account_manager, :get).and_return account
33
+ end
34
+
35
+ context 'when no error occured' do
36
+ it_behaves_like 'request method' do
37
+ it { is_expected.not_to be_nil }
38
+ its(:customer_ref) { is_expected.to eq("q2f3f") }
39
+ its(:status) { is_expected.to eq("SOME_STATUS") }
40
+ its(:error_code) { is_expected.to eq("") }
41
+ its(:market_id) { is_expected.to eq("1.112312312") }
42
+ its(:instruction_reports) { is_expected.to_not be_empty }
43
+ end
44
+ end
45
+
46
+ context 'when api error occured' do
47
+ it_behaves_like 'request method' do
48
+ let(:result_hash) { "{\"error\":{\"code\":-32700,\"message\":\"DSC-3000\"}}" }
49
+
50
+ it "raise APINGException" do
51
+ expect{ subject }.to raise_error
52
+ end
53
+ end
54
+ end
55
+ end
@@ -6,6 +6,10 @@ require 'betfair_api_ng_rails'
6
6
 
7
7
  Dir[File.join(File.dirname(__FILE__), 'support/**/*.rb')].each { |f| require f }
8
8
 
9
+ module TestModule
10
+ extend BetfairApiNgRails::Api::RequestMethods::All
11
+ end
12
+
9
13
  RSpec.configure do |config|
10
14
  config.mock_with :rspec
11
15
 
@@ -13,4 +17,8 @@ RSpec.configure do |config|
13
17
  config.run_all_when_everything_filtered = true
14
18
 
15
19
  config.order = "random"
16
- end
20
+ end
21
+
22
+ BetfairApiNgRails.config do |config|
23
+ config.endpoint = :uk
24
+ end
@@ -1,7 +1,6 @@
1
1
  require 'yaml'
2
2
 
3
3
  class BaseYamlLoader
4
-
5
4
  attr_reader :data
6
5
 
7
6
  def initialize(file_name)
@@ -12,10 +11,9 @@ class BaseYamlLoader
12
11
  data.fetch resource_name, {}
13
12
  end
14
13
 
15
- private
14
+ private
16
15
 
17
16
  def file_path(file_name)
18
17
  File.join(File.dirname(__FILE__), "data/#{file_name}.yml")
19
18
  end
20
-
21
- end
19
+ end
@@ -133,6 +133,7 @@ marketFilter:
133
133
  marketTypeCodes: 'some'
134
134
  marketStartTime: 'some'
135
135
  withOrders: 'some'
136
+ marketIds: '1.123231'
136
137
 
137
138
  marketDescription: &marketDescription
138
139
  persistenceEnabled: 'dqwdqw'
@@ -202,4 +203,39 @@ marketCatalogue:
202
203
  competition:
203
204
  <<: *competition
204
205
  event:
205
- <<: *event
206
+ <<: *event
207
+
208
+ statementLegacyData: &statementLegacyData
209
+ avgPrice: '1.63'
210
+ betSize: '20'
211
+ betType: 'E'
212
+ betCategoryType: 'A'
213
+ comissionRate: '2'
214
+ eventId: '1123123123'
215
+ eventTypeId: '1'
216
+ fullMarketName: 'Some/Another'
217
+ grossBetAmount: '3'
218
+ marketName: 'Some'
219
+ marketType: 'BB'
220
+ placedDate: '23-04-2015'
221
+ selectionId: '124243'
222
+ selectionName: 'Team 1 Win'
223
+ startDate: '20-01-2015'
224
+ transactionType: 'A'
225
+ transactionId: '8n474nro82yr37h'
226
+ winLose: 'BET_WIN'
227
+
228
+ statementItem: &statementItem
229
+ refId: '2m3847mx3'
230
+ itemDate: '1-01-2014'
231
+ amount: '20'
232
+ balance: '300'
233
+ itemClass: 'UNKNOWN'
234
+ itemClassData: 'fnawiafx48 '
235
+ legacyData:
236
+ <<: *statementLegacyData
237
+
238
+ accountStatementReport:
239
+ moreAvailable: 'false'
240
+ accountStatement:
241
+ - <<: *statementItem
@@ -1,7 +1,5 @@
1
1
  class DataModelsYamlLoader < BaseYamlLoader
2
-
3
2
  def initialize
4
3
  super 'models'
5
4
  end
6
-
7
- end
5
+ end
@@ -0,0 +1,18 @@
1
+ RSpec::Matchers.define :have_attr_accessor do |field|
2
+ match do |object_instance|
3
+ object_instance.respond_to?(field) &&
4
+ object_instance.respond_to?("#{field}=")
5
+ end
6
+
7
+ failure_message do |object_instance|
8
+ "expected attr_accessor for #{field} on #{object_instance}"
9
+ end
10
+
11
+ failure_message_when_negated do |object_instance|
12
+ "expected attr_accessor for #{field} not to be defined on #{object_instance}"
13
+ end
14
+
15
+ description do
16
+ "checks to see if there is an `#{field}` attr accessor"
17
+ end
18
+ end
@@ -1,9 +1,7 @@
1
1
  class Helper
2
2
  class << self
3
-
4
3
  def key_to_attribute(key)
5
4
  key.to_s.gsub(/^([a-z])/) { $1.capitalize }.scan(/[A-Z][a-z]*/).join("_").downcase
6
5
  end
7
-
8
6
  end
9
- end
7
+ end
@@ -0,0 +1,5 @@
1
+ shared_examples 'base endpoint' do
2
+ it { is_expected.to respond_to :api_url }
3
+ it { is_expected.to respond_to :login_url }
4
+ it { is_expected.to respond_to :keep_alive_url }
5
+ end
@@ -0,0 +1,28 @@
1
+ shared_examples 'concrete endpoint' do |api_domain, login_domain|
2
+ describe '#api_url' do
3
+ describe 'builded URL' do
4
+ subject(:url) { described_class.new.api_url(:betting) }
5
+
6
+ it { is_expected.to include(api_domain) }
7
+ it { is_expected.to include('betting') }
8
+ end
9
+ end
10
+
11
+ describe '#login_url' do
12
+ describe 'builded URL' do
13
+ subject(:url) { described_class.new.login_url }
14
+
15
+ it { is_expected.to include(login_domain) }
16
+ it { is_expected.to include('/certlogin') }
17
+ end
18
+ end
19
+
20
+ describe '#keep_alive_url' do
21
+ describe 'builded URL' do
22
+ subject(:url) { described_class.new.keep_alive_url }
23
+
24
+ it { is_expected.to include(login_domain) }
25
+ it { is_expected.to include('/keepAlive') }
26
+ end
27
+ end
28
+ end
@@ -6,30 +6,21 @@ shared_examples 'data model' do |resourceHash|
6
6
  subject { data }
7
7
 
8
8
  describe "loading from json" do
9
-
10
9
  it { is_expected.to be_kind_of described_class }
11
10
 
12
11
  resourceHash.each do |k, v|
13
12
  next unless v.is_a?(String)
14
-
15
- its(Helper.key_to_attribute(k)) { is_expected.to eq v }
16
13
 
14
+ its(Helper.key_to_attribute(k)) { is_expected.to eq v }
17
15
  end
18
-
19
16
  end
20
17
 
21
18
  if described_class.method_defined?(:to_hash)
22
-
23
19
  describe "serialize to hash" do
24
-
25
20
  subject { data.to_hash }
26
21
 
27
22
  it { is_expected.to be_kind_of Hash }
28
-
29
23
  it { is_expected.to eq json }
30
-
31
24
  end
32
-
33
25
  end
34
-
35
- end
26
+ end
@@ -1,18 +1,15 @@
1
1
  shared_examples 'request method' do
2
-
3
2
  let(:ssoid) { 'vnboeirubvyebvuekrybobvuiberlvbre' }
4
- let(:connection) { BetfairApiNgRails::Api::Connection.new }
5
3
  let(:http_response) { double(:http_response, code: '200', body: result_hash) }
6
4
  let(:result) { BetfairApiNgRails::Api::Http::Responser.new(http_response) }
7
5
  let(:filter) { BetfairApiNgRails::MarketFilter.new }
8
- let(:api_http_requester) { double(:api_http_requester, do_request: result, set_api_req_body: true) }
6
+ let(:api_http_requester) { double(:api_http_requester, do_request: result, set_api_req_body: true, result: '') }
9
7
 
10
8
  before(:each) do
11
- expect(BetfairApiNgRails::Api::SessionManager).to receive(:new_ssoid).and_return ssoid
12
- expect(BetfairApiNgRails::Api::Http::Factory).to receive(:provider_requester).with(ssoid).and_return api_http_requester
13
- BetfairApiNgRails.connection = connection
9
+ allow(api_http_requester).to receive(:do_request).and_return result
10
+ expect_any_instance_of(BetfairApiNgRails::Api::SessionManager).to receive(:get_ssoid).and_return ssoid
11
+ expect(BetfairApiNgRails::Api::Http::Factory).to receive(:provider_requester).and_return api_http_requester
14
12
  end
15
13
 
16
14
  subject { TestModule.send(method_name, parameters) }
17
-
18
- end
15
+ end
@@ -1,53 +1,44 @@
1
1
  shared_examples 'simple list filtering request' do |method|
2
2
 
3
3
  let(:parameters) { {filter: filter} }
4
-
5
- before(:each) { BetfairApiNgRails.config.formatter = nil }
4
+ let(:logger) { double(:logger) }
5
+ let(:account) { BetfairApiNgRails::Account.new('user001', 'password', '42f2f434f3g43') }
6
+
7
+ before(:each) do
8
+ BetfairApiNgRails.config.formatter = nil
9
+ BetfairApiNgRails.log = logger
10
+ allow(logger).to receive(:write)
11
+ allow(BetfairApiNgRails).to receive_message_chain(:account_manager, :get).and_return account
12
+ end
6
13
 
7
14
  context 'when no error occured' do
8
-
9
15
  it_behaves_like 'request method' do
10
-
11
16
  it { is_expected.not_to be_empty }
12
17
 
13
18
  its(:first) { is_expected.to be_kind_of result_class }
14
-
15
19
  end
16
-
17
20
  end
18
21
 
19
22
  context 'when api error occured' do
20
-
21
23
  it_behaves_like 'request method' do
22
-
23
24
  let(:result_hash) { "{\"error\":{\"code\":-32700,\"message\":\"DSC-3000\"}}" }
24
25
 
25
26
  it "raise APINGException" do
26
27
  expect{ subject }.to raise_error
27
28
  end
28
-
29
29
  end
30
-
31
30
  end
32
31
 
33
32
  if BetfairApiNgRails::Api::Constants::ALLOWED_FORMATTING.include?(method)
34
-
35
33
  context 'when enabled formatting' do
36
-
37
34
  before(:each) { BetfairApiNgRails.config.formatter = :js_tree }
38
35
 
39
36
  it_behaves_like 'request method' do
40
-
41
37
  it { is_expected.not_to be_empty }
42
38
 
43
39
  its(:first) { is_expected.to be_kind_of Hash }
44
-
45
40
  its('first.keys') { is_expected.to include(:id, :text, :children, :data) }
46
-
47
41
  end
48
-
49
42
  end
50
-
51
43
  end
52
-
53
- end
44
+ end
metadata CHANGED
@@ -1,99 +1,141 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: betfair_api_ng_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sergio1990
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-28 00:00:00.000000000 Z
11
+ date: 2015-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: bundler
14
+ name: activesupport
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
20
- type: :development
19
+ version: 4.0.4
20
+ type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.3'
26
+ version: 4.0.4
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 4.0.4
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 4.0.4
41
+ - !ruby/object:Gem::Dependency
42
+ name: colorize
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - '>='
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 0.7.2
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
32
53
  - !ruby/object:Gem::Version
33
- version: '0'
54
+ version: 0.7.2
55
+ - !ruby/object:Gem::Dependency
56
+ name: redis
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - '='
60
+ - !ruby/object:Gem::Version
61
+ version: 3.0.7
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - '='
67
+ - !ruby/object:Gem::Version
68
+ version: 3.0.7
69
+ - !ruby/object:Gem::Dependency
70
+ name: bundler
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.3'
34
76
  type: :development
35
77
  prerelease: false
36
78
  version_requirements: !ruby/object:Gem::Requirement
37
79
  requirements:
38
- - - '>='
80
+ - - "~>"
39
81
  - !ruby/object:Gem::Version
40
- version: '0'
82
+ version: '1.3'
41
83
  - !ruby/object:Gem::Dependency
42
- name: activesupport
84
+ name: rake
43
85
  requirement: !ruby/object:Gem::Requirement
44
86
  requirements:
45
- - - '>='
87
+ - - ">="
46
88
  - !ruby/object:Gem::Version
47
- version: 3.1.0
89
+ version: 10.3.0
48
90
  type: :development
49
91
  prerelease: false
50
92
  version_requirements: !ruby/object:Gem::Requirement
51
93
  requirements:
52
- - - '>='
94
+ - - ">="
53
95
  - !ruby/object:Gem::Version
54
- version: 3.1.0
96
+ version: 10.3.0
55
97
  - !ruby/object:Gem::Dependency
56
98
  name: rspec
57
99
  requirement: !ruby/object:Gem::Requirement
58
100
  requirements:
59
- - - ~>
101
+ - - "~>"
60
102
  - !ruby/object:Gem::Version
61
103
  version: 3.0.0.beta
62
104
  type: :development
63
105
  prerelease: false
64
106
  version_requirements: !ruby/object:Gem::Requirement
65
107
  requirements:
66
- - - ~>
108
+ - - "~>"
67
109
  - !ruby/object:Gem::Version
68
110
  version: 3.0.0.beta
69
111
  - !ruby/object:Gem::Dependency
70
112
  name: rspec-its
71
113
  requirement: !ruby/object:Gem::Requirement
72
114
  requirements:
73
- - - '>='
115
+ - - '='
74
116
  - !ruby/object:Gem::Version
75
- version: '0'
117
+ version: 1.0.1
76
118
  type: :development
77
119
  prerelease: false
78
120
  version_requirements: !ruby/object:Gem::Requirement
79
121
  requirements:
80
- - - '>='
122
+ - - '='
81
123
  - !ruby/object:Gem::Version
82
- version: '0'
124
+ version: 1.0.1
83
125
  - !ruby/object:Gem::Dependency
84
126
  name: pry-nav
85
127
  requirement: !ruby/object:Gem::Requirement
86
128
  requirements:
87
- - - '>='
129
+ - - '='
88
130
  - !ruby/object:Gem::Version
89
- version: '0'
131
+ version: 0.2.3
90
132
  type: :development
91
133
  prerelease: false
92
134
  version_requirements: !ruby/object:Gem::Requirement
93
135
  requirements:
94
- - - '>='
136
+ - - '='
95
137
  - !ruby/object:Gem::Version
96
- version: '0'
138
+ version: 0.2.3
97
139
  description: Betfair API-NG for Rails
98
140
  email:
99
141
  - sergeg1990@gmail.com
@@ -101,20 +143,32 @@ executables: []
101
143
  extensions: []
102
144
  extra_rdoc_files: []
103
145
  files:
104
- - .gitignore
146
+ - ".gitignore"
105
147
  - Gemfile
106
148
  - LICENSE.txt
107
149
  - README.md
108
150
  - Rakefile
109
151
  - betfair_api_ng_rails.gemspec
110
152
  - lib/betfair_api_ng_rails.rb
153
+ - lib/betfair_api_ng_rails/account.rb
154
+ - lib/betfair_api_ng_rails/account_manager.rb
155
+ - lib/betfair_api_ng_rails/account_session.rb
156
+ - lib/betfair_api_ng_rails/account_session_manager.rb
157
+ - lib/betfair_api_ng_rails/api/caching/helper.rb
158
+ - lib/betfair_api_ng_rails/api/caching/response_cache.rb
111
159
  - lib/betfair_api_ng_rails/api/concerns/errorable.rb
112
160
  - lib/betfair_api_ng_rails/api/config.rb
113
161
  - lib/betfair_api_ng_rails/api/connection.rb
162
+ - lib/betfair_api_ng_rails/api/connection_ext/caching.rb
114
163
  - lib/betfair_api_ng_rails/api/connection_ext/error_handling.rb
115
164
  - lib/betfair_api_ng_rails/api/connection_ext/formatting.rb
165
+ - lib/betfair_api_ng_rails/api/connection_ext/logging.rb
116
166
  - lib/betfair_api_ng_rails/api/connection_ext/parsing.rb
167
+ - lib/betfair_api_ng_rails/api/connection_ext/ssoid_refreshing.rb
117
168
  - lib/betfair_api_ng_rails/api/constants.rb
169
+ - lib/betfair_api_ng_rails/api/data/account_details_response.rb
170
+ - lib/betfair_api_ng_rails/api/data/account_funds_response.rb
171
+ - lib/betfair_api_ng_rails/api/data/account_statement_report.rb
118
172
  - lib/betfair_api_ng_rails/api/data/base.rb
119
173
  - lib/betfair_api_ng_rails/api/data/competition.rb
120
174
  - lib/betfair_api_ng_rails/api/data/competition_result.rb
@@ -129,28 +183,44 @@ files:
129
183
  - lib/betfair_api_ng_rails/api/data/event_type_result.rb
130
184
  - lib/betfair_api_ng_rails/api/data/ex_best_offers_overrides.rb
131
185
  - lib/betfair_api_ng_rails/api/data/exchange_prices.rb
186
+ - lib/betfair_api_ng_rails/api/data/limit_on_close_order.rb
187
+ - lib/betfair_api_ng_rails/api/data/limit_order.rb
132
188
  - lib/betfair_api_ng_rails/api/data/market_book.rb
133
189
  - lib/betfair_api_ng_rails/api/data/market_catalogue.rb
134
190
  - lib/betfair_api_ng_rails/api/data/market_description.rb
135
191
  - lib/betfair_api_ng_rails/api/data/market_filter.rb
192
+ - lib/betfair_api_ng_rails/api/data/market_on_close_order.rb
136
193
  - lib/betfair_api_ng_rails/api/data/market_type_result.rb
137
194
  - lib/betfair_api_ng_rails/api/data/match.rb
138
195
  - lib/betfair_api_ng_rails/api/data/order.rb
196
+ - lib/betfair_api_ng_rails/api/data/place_execution_report.rb
197
+ - lib/betfair_api_ng_rails/api/data/place_instruction.rb
198
+ - lib/betfair_api_ng_rails/api/data/place_instruction_report.rb
139
199
  - lib/betfair_api_ng_rails/api/data/price_projection.rb
140
200
  - lib/betfair_api_ng_rails/api/data/price_size.rb
141
201
  - lib/betfair_api_ng_rails/api/data/runner.rb
142
202
  - lib/betfair_api_ng_rails/api/data/runner_catalog.rb
143
203
  - lib/betfair_api_ng_rails/api/data/starting_prices.rb
204
+ - lib/betfair_api_ng_rails/api/data/statement_item.rb
205
+ - lib/betfair_api_ng_rails/api/data/statement_legacy_data.rb
144
206
  - lib/betfair_api_ng_rails/api/data/time_range.rb
145
207
  - lib/betfair_api_ng_rails/api/data/time_range_result.rb
146
208
  - lib/betfair_api_ng_rails/api/data/venue_result.rb
209
+ - lib/betfair_api_ng_rails/api/endpoint_factory.rb
210
+ - lib/betfair_api_ng_rails/api/endpoints/australian.rb
211
+ - lib/betfair_api_ng_rails/api/endpoints/base.rb
212
+ - lib/betfair_api_ng_rails/api/endpoints/italian.rb
213
+ - lib/betfair_api_ng_rails/api/endpoints/spanish.rb
214
+ - lib/betfair_api_ng_rails/api/endpoints/uk.rb
147
215
  - lib/betfair_api_ng_rails/api/enums/bet_status.rb
148
216
  - lib/betfair_api_ng_rails/api/enums/concerns/enumable.rb
149
217
  - lib/betfair_api_ng_rails/api/enums/execution_report_error_code.rb
150
218
  - lib/betfair_api_ng_rails/api/enums/execution_report_status.rb
151
219
  - lib/betfair_api_ng_rails/api/enums/group_by.rb
220
+ - lib/betfair_api_ng_rails/api/enums/include_item.rb
152
221
  - lib/betfair_api_ng_rails/api/enums/instruction_report_error_code.rb
153
222
  - lib/betfair_api_ng_rails/api/enums/instruction_report_status.rb
223
+ - lib/betfair_api_ng_rails/api/enums/item_class.rb
154
224
  - lib/betfair_api_ng_rails/api/enums/market_betting_type.rb
155
225
  - lib/betfair_api_ng_rails/api/enums/market_projection.rb
156
226
  - lib/betfair_api_ng_rails/api/enums/market_sort.rb
@@ -167,6 +237,7 @@ files:
167
237
  - lib/betfair_api_ng_rails/api/enums/side.rb
168
238
  - lib/betfair_api_ng_rails/api/enums/sort_dir.rb
169
239
  - lib/betfair_api_ng_rails/api/enums/time_granularity.rb
240
+ - lib/betfair_api_ng_rails/api/enums/wallet.rb
170
241
  - lib/betfair_api_ng_rails/api/formatter_factory.rb
171
242
  - lib/betfair_api_ng_rails/api/formatters/js_tree_formatter.rb
172
243
  - lib/betfair_api_ng_rails/api/hashalator.rb
@@ -175,9 +246,17 @@ files:
175
246
  - lib/betfair_api_ng_rails/api/http/helpers/information_response.rb
176
247
  - lib/betfair_api_ng_rails/api/http/helpers/keep_alive_response.rb
177
248
  - lib/betfair_api_ng_rails/api/http/helpers/session_response.rb
249
+ - lib/betfair_api_ng_rails/api/http/proxy_requester.rb
178
250
  - lib/betfair_api_ng_rails/api/http/requester.rb
179
251
  - lib/betfair_api_ng_rails/api/http/responser.rb
252
+ - lib/betfair_api_ng_rails/api/invalid_endpoint_error.rb
253
+ - lib/betfair_api_ng_rails/api/logs/console_logger.rb
254
+ - lib/betfair_api_ng_rails/api/logs/file_logger.rb
180
255
  - lib/betfair_api_ng_rails/api/parsers/base.rb
256
+ - lib/betfair_api_ng_rails/api/parsers/get_account_details.rb
257
+ - lib/betfair_api_ng_rails/api/parsers/get_account_funds.rb
258
+ - lib/betfair_api_ng_rails/api/parsers/get_account_statement.rb
259
+ - lib/betfair_api_ng_rails/api/parsers/list_base.rb
181
260
  - lib/betfair_api_ng_rails/api/parsers/list_competitions.rb
182
261
  - lib/betfair_api_ng_rails/api/parsers/list_countries.rb
183
262
  - lib/betfair_api_ng_rails/api/parsers/list_event_types.rb
@@ -187,62 +266,93 @@ files:
187
266
  - lib/betfair_api_ng_rails/api/parsers/list_market_types.rb
188
267
  - lib/betfair_api_ng_rails/api/parsers/list_time_ranges.rb
189
268
  - lib/betfair_api_ng_rails/api/parsers/list_venues.rb
269
+ - lib/betfair_api_ng_rails/api/parsers/place_orders.rb
270
+ - lib/betfair_api_ng_rails/api/parsers/single_base.rb
190
271
  - lib/betfair_api_ng_rails/api/provider.rb
191
- - lib/betfair_api_ng_rails/api/request_methods.rb
272
+ - lib/betfair_api_ng_rails/api/request_method.rb
273
+ - lib/betfair_api_ng_rails/api/request_methods/account.rb
274
+ - lib/betfair_api_ng_rails/api/request_methods/all.rb
275
+ - lib/betfair_api_ng_rails/api/request_methods/betting.rb
192
276
  - lib/betfair_api_ng_rails/api/session_manager.rb
277
+ - lib/betfair_api_ng_rails/bad_response_error.rb
193
278
  - lib/betfair_api_ng_rails/errors.rb
194
279
  - lib/betfair_api_ng_rails/railtie.rb
195
280
  - lib/betfair_api_ng_rails/version.rb
196
281
  - lib/generators/betfair_api_ng_rails/install/install_generator.rb
197
282
  - lib/generators/betfair_api_ng_rails/install/templates/betfair_api_ng_rails.rb
198
283
  - lib/generators/betfair_api_ng_rails/install/templates/betfair_api_ng_rails.yml
199
- - spec/betfair_api_ng_rails/api/connection_spec.rb
200
- - spec/betfair_api_ng_rails/api/data/competition_result_spec.rb
201
- - spec/betfair_api_ng_rails/api/data/competition_spec.rb
202
- - spec/betfair_api_ng_rails/api/data/concerns/attributable_spec.rb
203
- - spec/betfair_api_ng_rails/api/data/concerns/hashable_spec.rb
204
- - spec/betfair_api_ng_rails/api/data/concerns/jsonable_spec.rb
205
- - spec/betfair_api_ng_rails/api/data/country_code_result_spec.rb
206
- - spec/betfair_api_ng_rails/api/data/event_result_spec.rb
207
- - spec/betfair_api_ng_rails/api/data/event_spec.rb
208
- - spec/betfair_api_ng_rails/api/data/event_type_result_spec.rb
209
- - spec/betfair_api_ng_rails/api/data/event_type_spec.rb
210
- - spec/betfair_api_ng_rails/api/data/ex_best_offers_overrides_spec.rb
211
- - spec/betfair_api_ng_rails/api/data/exchange_prices_spec.rb
212
- - spec/betfair_api_ng_rails/api/data/market_book_spec.rb
213
- - spec/betfair_api_ng_rails/api/data/market_catalogue_spec.rb
214
- - spec/betfair_api_ng_rails/api/data/market_description_spec.rb
215
- - spec/betfair_api_ng_rails/api/data/market_filter_spec.rb
216
- - spec/betfair_api_ng_rails/api/data/market_type_result_spec.rb
217
- - spec/betfair_api_ng_rails/api/data/match_spec.rb
218
- - spec/betfair_api_ng_rails/api/data/order_spec.rb
219
- - spec/betfair_api_ng_rails/api/data/price_projection_spec.rb
220
- - spec/betfair_api_ng_rails/api/data/price_size_spec.rb
221
- - spec/betfair_api_ng_rails/api/data/runner_catalog_spec.rb
222
- - spec/betfair_api_ng_rails/api/data/runner_spec.rb
223
- - spec/betfair_api_ng_rails/api/data/starting_prices_spec.rb
224
- - spec/betfair_api_ng_rails/api/data/time_range_result_spec.rb
225
- - spec/betfair_api_ng_rails/api/data/time_range_spec.rb
226
- - spec/betfair_api_ng_rails/api/data/venue_result_spec.rb
227
- - spec/betfair_api_ng_rails/api/formatters/js_tree_formatter_spec.rb
228
- - spec/betfair_api_ng_rails/api/hashalator_spec.rb
229
- - spec/betfair_api_ng_rails/api/provider_spec.rb
230
- - spec/betfair_api_ng_rails/api/request_methods_spec.rb
231
- - spec/betfair_api_ng_rails/api/session_manager_spec.rb
232
- - spec/betfair_api_ng_rails/integration/list_competitions_spec.rb
233
- - spec/betfair_api_ng_rails/integration/list_countries_spec.rb
234
- - spec/betfair_api_ng_rails/integration/list_event_types_spec.rb
235
- - spec/betfair_api_ng_rails/integration/list_events_spec.rb
236
- - spec/betfair_api_ng_rails/integration/list_market_book_spec.rb
237
- - spec/betfair_api_ng_rails/integration/list_market_catalogue_spec.rb
238
- - spec/betfair_api_ng_rails/integration/list_market_types_spec.rb
239
- - spec/betfair_api_ng_rails/integration/list_time_ranges_spec.rb
240
- - spec/betfair_api_ng_rails/integration/list_venues_spec.rb
284
+ - spec/lib/betfair_api_ng_rails/account_manager_spec.rb
285
+ - spec/lib/betfair_api_ng_rails/account_session_manager_spec.rb
286
+ - spec/lib/betfair_api_ng_rails/account_session_spec.rb
287
+ - spec/lib/betfair_api_ng_rails/account_spec.rb
288
+ - spec/lib/betfair_api_ng_rails/api/caching/helper_spec.rb
289
+ - spec/lib/betfair_api_ng_rails/api/caching/response_cache_spec.rb
290
+ - spec/lib/betfair_api_ng_rails/api/config_spec.rb
291
+ - spec/lib/betfair_api_ng_rails/api/connection_spec.rb
292
+ - spec/lib/betfair_api_ng_rails/api/data/account_statement_report_spec.rb
293
+ - spec/lib/betfair_api_ng_rails/api/data/competition_result_spec.rb
294
+ - spec/lib/betfair_api_ng_rails/api/data/competition_spec.rb
295
+ - spec/lib/betfair_api_ng_rails/api/data/concerns/attributable_spec.rb
296
+ - spec/lib/betfair_api_ng_rails/api/data/concerns/hashable_spec.rb
297
+ - spec/lib/betfair_api_ng_rails/api/data/concerns/jsonable_spec.rb
298
+ - spec/lib/betfair_api_ng_rails/api/data/country_code_result_spec.rb
299
+ - spec/lib/betfair_api_ng_rails/api/data/event_result_spec.rb
300
+ - spec/lib/betfair_api_ng_rails/api/data/event_spec.rb
301
+ - spec/lib/betfair_api_ng_rails/api/data/event_type_result_spec.rb
302
+ - spec/lib/betfair_api_ng_rails/api/data/event_type_spec.rb
303
+ - spec/lib/betfair_api_ng_rails/api/data/ex_best_offers_overrides_spec.rb
304
+ - spec/lib/betfair_api_ng_rails/api/data/exchange_prices_spec.rb
305
+ - spec/lib/betfair_api_ng_rails/api/data/market_book_spec.rb
306
+ - spec/lib/betfair_api_ng_rails/api/data/market_catalogue_spec.rb
307
+ - spec/lib/betfair_api_ng_rails/api/data/market_description_spec.rb
308
+ - spec/lib/betfair_api_ng_rails/api/data/market_filter_spec.rb
309
+ - spec/lib/betfair_api_ng_rails/api/data/market_type_result_spec.rb
310
+ - spec/lib/betfair_api_ng_rails/api/data/match_spec.rb
311
+ - spec/lib/betfair_api_ng_rails/api/data/order_spec.rb
312
+ - spec/lib/betfair_api_ng_rails/api/data/price_projection_spec.rb
313
+ - spec/lib/betfair_api_ng_rails/api/data/price_size_spec.rb
314
+ - spec/lib/betfair_api_ng_rails/api/data/runner_catalog_spec.rb
315
+ - spec/lib/betfair_api_ng_rails/api/data/runner_spec.rb
316
+ - spec/lib/betfair_api_ng_rails/api/data/starting_prices_spec.rb
317
+ - spec/lib/betfair_api_ng_rails/api/data/statement_item_spec.rb
318
+ - spec/lib/betfair_api_ng_rails/api/data/statement_legacy_data_spec.rb
319
+ - spec/lib/betfair_api_ng_rails/api/data/time_range_result_spec.rb
320
+ - spec/lib/betfair_api_ng_rails/api/data/time_range_spec.rb
321
+ - spec/lib/betfair_api_ng_rails/api/data/venue_result_spec.rb
322
+ - spec/lib/betfair_api_ng_rails/api/endpoint_factory_spec.rb
323
+ - spec/lib/betfair_api_ng_rails/api/endpoints/australian_spec.rb
324
+ - spec/lib/betfair_api_ng_rails/api/endpoints/base_spec.rb
325
+ - spec/lib/betfair_api_ng_rails/api/endpoints/italian_spec.rb
326
+ - spec/lib/betfair_api_ng_rails/api/endpoints/spanish_spec.rb
327
+ - spec/lib/betfair_api_ng_rails/api/endpoints/uk_spec.rb
328
+ - spec/lib/betfair_api_ng_rails/api/formatters/js_tree_formatter_spec.rb
329
+ - spec/lib/betfair_api_ng_rails/api/hashalator_spec.rb
330
+ - spec/lib/betfair_api_ng_rails/api/http/factory_spec.rb
331
+ - spec/lib/betfair_api_ng_rails/api/logs/console_logger_spec.rb
332
+ - spec/lib/betfair_api_ng_rails/api/logs/file_logger_spec.rb
333
+ - spec/lib/betfair_api_ng_rails/api/provider_spec.rb
334
+ - spec/lib/betfair_api_ng_rails/api/request_method_spec.rb
335
+ - spec/lib/betfair_api_ng_rails/api/request_methods_spec.rb
336
+ - spec/lib/betfair_api_ng_rails/api/session_manager_spec.rb
337
+ - spec/lib/betfair_api_ng_rails/integration/get_account_statement_spec.rb
338
+ - spec/lib/betfair_api_ng_rails/integration/list_competitions_spec.rb
339
+ - spec/lib/betfair_api_ng_rails/integration/list_countries_spec.rb
340
+ - spec/lib/betfair_api_ng_rails/integration/list_event_types_spec.rb
341
+ - spec/lib/betfair_api_ng_rails/integration/list_events_spec.rb
342
+ - spec/lib/betfair_api_ng_rails/integration/list_market_book_spec.rb
343
+ - spec/lib/betfair_api_ng_rails/integration/list_market_catalogue_spec.rb
344
+ - spec/lib/betfair_api_ng_rails/integration/list_market_types_spec.rb
345
+ - spec/lib/betfair_api_ng_rails/integration/list_time_ranges_spec.rb
346
+ - spec/lib/betfair_api_ng_rails/integration/list_venues_spec.rb
347
+ - spec/lib/betfair_api_ng_rails/integration/place_orders_spec.rb
241
348
  - spec/spec_helper.rb
242
349
  - spec/support/base_yaml_loader.rb
243
350
  - spec/support/data/models.yml
244
351
  - spec/support/data_models_yaml_loader.rb
352
+ - spec/support/have_attr_accessor.rb
245
353
  - spec/support/helper.rb
354
+ - spec/support/shared_examples/base_endpoint.rb
355
+ - spec/support/shared_examples/concrete_endpoint.rb
246
356
  - spec/support/shared_examples/data_model.rb
247
357
  - spec/support/shared_examples/request_method.rb
248
358
  - spec/support/shared_examples/simple_list_filtering_request.rb
@@ -256,68 +366,93 @@ require_paths:
256
366
  - lib
257
367
  required_ruby_version: !ruby/object:Gem::Requirement
258
368
  requirements:
259
- - - '>='
369
+ - - ">="
260
370
  - !ruby/object:Gem::Version
261
371
  version: '0'
262
372
  required_rubygems_version: !ruby/object:Gem::Requirement
263
373
  requirements:
264
- - - '>='
374
+ - - ">="
265
375
  - !ruby/object:Gem::Version
266
376
  version: '0'
267
377
  requirements: []
268
378
  rubyforge_project:
269
- rubygems_version: 2.2.2
379
+ rubygems_version: 2.5.1
270
380
  signing_key:
271
381
  specification_version: 4
272
382
  summary: Provides accessing betfair.com api-ng using non-interactive login
273
383
  test_files:
274
- - spec/betfair_api_ng_rails/api/connection_spec.rb
275
- - spec/betfair_api_ng_rails/api/data/competition_result_spec.rb
276
- - spec/betfair_api_ng_rails/api/data/competition_spec.rb
277
- - spec/betfair_api_ng_rails/api/data/concerns/attributable_spec.rb
278
- - spec/betfair_api_ng_rails/api/data/concerns/hashable_spec.rb
279
- - spec/betfair_api_ng_rails/api/data/concerns/jsonable_spec.rb
280
- - spec/betfair_api_ng_rails/api/data/country_code_result_spec.rb
281
- - spec/betfair_api_ng_rails/api/data/event_result_spec.rb
282
- - spec/betfair_api_ng_rails/api/data/event_spec.rb
283
- - spec/betfair_api_ng_rails/api/data/event_type_result_spec.rb
284
- - spec/betfair_api_ng_rails/api/data/event_type_spec.rb
285
- - spec/betfair_api_ng_rails/api/data/ex_best_offers_overrides_spec.rb
286
- - spec/betfair_api_ng_rails/api/data/exchange_prices_spec.rb
287
- - spec/betfair_api_ng_rails/api/data/market_book_spec.rb
288
- - spec/betfair_api_ng_rails/api/data/market_catalogue_spec.rb
289
- - spec/betfair_api_ng_rails/api/data/market_description_spec.rb
290
- - spec/betfair_api_ng_rails/api/data/market_filter_spec.rb
291
- - spec/betfair_api_ng_rails/api/data/market_type_result_spec.rb
292
- - spec/betfair_api_ng_rails/api/data/match_spec.rb
293
- - spec/betfair_api_ng_rails/api/data/order_spec.rb
294
- - spec/betfair_api_ng_rails/api/data/price_projection_spec.rb
295
- - spec/betfair_api_ng_rails/api/data/price_size_spec.rb
296
- - spec/betfair_api_ng_rails/api/data/runner_catalog_spec.rb
297
- - spec/betfair_api_ng_rails/api/data/runner_spec.rb
298
- - spec/betfair_api_ng_rails/api/data/starting_prices_spec.rb
299
- - spec/betfair_api_ng_rails/api/data/time_range_result_spec.rb
300
- - spec/betfair_api_ng_rails/api/data/time_range_spec.rb
301
- - spec/betfair_api_ng_rails/api/data/venue_result_spec.rb
302
- - spec/betfair_api_ng_rails/api/formatters/js_tree_formatter_spec.rb
303
- - spec/betfair_api_ng_rails/api/hashalator_spec.rb
304
- - spec/betfair_api_ng_rails/api/provider_spec.rb
305
- - spec/betfair_api_ng_rails/api/request_methods_spec.rb
306
- - spec/betfair_api_ng_rails/api/session_manager_spec.rb
307
- - spec/betfair_api_ng_rails/integration/list_competitions_spec.rb
308
- - spec/betfair_api_ng_rails/integration/list_countries_spec.rb
309
- - spec/betfair_api_ng_rails/integration/list_event_types_spec.rb
310
- - spec/betfair_api_ng_rails/integration/list_events_spec.rb
311
- - spec/betfair_api_ng_rails/integration/list_market_book_spec.rb
312
- - spec/betfair_api_ng_rails/integration/list_market_catalogue_spec.rb
313
- - spec/betfair_api_ng_rails/integration/list_market_types_spec.rb
314
- - spec/betfair_api_ng_rails/integration/list_time_ranges_spec.rb
315
- - spec/betfair_api_ng_rails/integration/list_venues_spec.rb
384
+ - spec/lib/betfair_api_ng_rails/account_manager_spec.rb
385
+ - spec/lib/betfair_api_ng_rails/account_session_manager_spec.rb
386
+ - spec/lib/betfair_api_ng_rails/account_session_spec.rb
387
+ - spec/lib/betfair_api_ng_rails/account_spec.rb
388
+ - spec/lib/betfair_api_ng_rails/api/caching/helper_spec.rb
389
+ - spec/lib/betfair_api_ng_rails/api/caching/response_cache_spec.rb
390
+ - spec/lib/betfair_api_ng_rails/api/config_spec.rb
391
+ - spec/lib/betfair_api_ng_rails/api/connection_spec.rb
392
+ - spec/lib/betfair_api_ng_rails/api/data/account_statement_report_spec.rb
393
+ - spec/lib/betfair_api_ng_rails/api/data/competition_result_spec.rb
394
+ - spec/lib/betfair_api_ng_rails/api/data/competition_spec.rb
395
+ - spec/lib/betfair_api_ng_rails/api/data/concerns/attributable_spec.rb
396
+ - spec/lib/betfair_api_ng_rails/api/data/concerns/hashable_spec.rb
397
+ - spec/lib/betfair_api_ng_rails/api/data/concerns/jsonable_spec.rb
398
+ - spec/lib/betfair_api_ng_rails/api/data/country_code_result_spec.rb
399
+ - spec/lib/betfair_api_ng_rails/api/data/event_result_spec.rb
400
+ - spec/lib/betfair_api_ng_rails/api/data/event_spec.rb
401
+ - spec/lib/betfair_api_ng_rails/api/data/event_type_result_spec.rb
402
+ - spec/lib/betfair_api_ng_rails/api/data/event_type_spec.rb
403
+ - spec/lib/betfair_api_ng_rails/api/data/ex_best_offers_overrides_spec.rb
404
+ - spec/lib/betfair_api_ng_rails/api/data/exchange_prices_spec.rb
405
+ - spec/lib/betfair_api_ng_rails/api/data/market_book_spec.rb
406
+ - spec/lib/betfair_api_ng_rails/api/data/market_catalogue_spec.rb
407
+ - spec/lib/betfair_api_ng_rails/api/data/market_description_spec.rb
408
+ - spec/lib/betfair_api_ng_rails/api/data/market_filter_spec.rb
409
+ - spec/lib/betfair_api_ng_rails/api/data/market_type_result_spec.rb
410
+ - spec/lib/betfair_api_ng_rails/api/data/match_spec.rb
411
+ - spec/lib/betfair_api_ng_rails/api/data/order_spec.rb
412
+ - spec/lib/betfair_api_ng_rails/api/data/price_projection_spec.rb
413
+ - spec/lib/betfair_api_ng_rails/api/data/price_size_spec.rb
414
+ - spec/lib/betfair_api_ng_rails/api/data/runner_catalog_spec.rb
415
+ - spec/lib/betfair_api_ng_rails/api/data/runner_spec.rb
416
+ - spec/lib/betfair_api_ng_rails/api/data/starting_prices_spec.rb
417
+ - spec/lib/betfair_api_ng_rails/api/data/statement_item_spec.rb
418
+ - spec/lib/betfair_api_ng_rails/api/data/statement_legacy_data_spec.rb
419
+ - spec/lib/betfair_api_ng_rails/api/data/time_range_result_spec.rb
420
+ - spec/lib/betfair_api_ng_rails/api/data/time_range_spec.rb
421
+ - spec/lib/betfair_api_ng_rails/api/data/venue_result_spec.rb
422
+ - spec/lib/betfair_api_ng_rails/api/endpoint_factory_spec.rb
423
+ - spec/lib/betfair_api_ng_rails/api/endpoints/australian_spec.rb
424
+ - spec/lib/betfair_api_ng_rails/api/endpoints/base_spec.rb
425
+ - spec/lib/betfair_api_ng_rails/api/endpoints/italian_spec.rb
426
+ - spec/lib/betfair_api_ng_rails/api/endpoints/spanish_spec.rb
427
+ - spec/lib/betfair_api_ng_rails/api/endpoints/uk_spec.rb
428
+ - spec/lib/betfair_api_ng_rails/api/formatters/js_tree_formatter_spec.rb
429
+ - spec/lib/betfair_api_ng_rails/api/hashalator_spec.rb
430
+ - spec/lib/betfair_api_ng_rails/api/http/factory_spec.rb
431
+ - spec/lib/betfair_api_ng_rails/api/logs/console_logger_spec.rb
432
+ - spec/lib/betfair_api_ng_rails/api/logs/file_logger_spec.rb
433
+ - spec/lib/betfair_api_ng_rails/api/provider_spec.rb
434
+ - spec/lib/betfair_api_ng_rails/api/request_method_spec.rb
435
+ - spec/lib/betfair_api_ng_rails/api/request_methods_spec.rb
436
+ - spec/lib/betfair_api_ng_rails/api/session_manager_spec.rb
437
+ - spec/lib/betfair_api_ng_rails/integration/get_account_statement_spec.rb
438
+ - spec/lib/betfair_api_ng_rails/integration/list_competitions_spec.rb
439
+ - spec/lib/betfair_api_ng_rails/integration/list_countries_spec.rb
440
+ - spec/lib/betfair_api_ng_rails/integration/list_event_types_spec.rb
441
+ - spec/lib/betfair_api_ng_rails/integration/list_events_spec.rb
442
+ - spec/lib/betfair_api_ng_rails/integration/list_market_book_spec.rb
443
+ - spec/lib/betfair_api_ng_rails/integration/list_market_catalogue_spec.rb
444
+ - spec/lib/betfair_api_ng_rails/integration/list_market_types_spec.rb
445
+ - spec/lib/betfair_api_ng_rails/integration/list_time_ranges_spec.rb
446
+ - spec/lib/betfair_api_ng_rails/integration/list_venues_spec.rb
447
+ - spec/lib/betfair_api_ng_rails/integration/place_orders_spec.rb
316
448
  - spec/spec_helper.rb
317
449
  - spec/support/base_yaml_loader.rb
318
450
  - spec/support/data/models.yml
319
451
  - spec/support/data_models_yaml_loader.rb
452
+ - spec/support/have_attr_accessor.rb
320
453
  - spec/support/helper.rb
454
+ - spec/support/shared_examples/base_endpoint.rb
455
+ - spec/support/shared_examples/concrete_endpoint.rb
321
456
  - spec/support/shared_examples/data_model.rb
322
457
  - spec/support/shared_examples/request_method.rb
323
458
  - spec/support/shared_examples/simple_list_filtering_request.rb