ratis 3.3.6 → 3.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +7 -0
  2. data/.rvmrc +1 -1
  3. data/CHANGELOG +8 -1
  4. data/Gemfile +1 -1
  5. data/Gemfile.lock +33 -35
  6. data/lib/ratis.rb +1 -1
  7. data/lib/ratis/landmark.rb +4 -3
  8. data/lib/ratis/landmark_category.rb +11 -7
  9. data/lib/ratis/location.rb +1 -0
  10. data/lib/ratis/route_stops.rb +0 -6
  11. data/lib/ratis/version.rb +1 -1
  12. data/lib/ratis/walkstop.rb +54 -0
  13. data/ratis.gemspec +3 -5
  14. data/spec/ratis/area_spec.rb +1 -1
  15. data/spec/ratis/closest_stop_spec.rb +2 -2
  16. data/spec/ratis/itinerary_spec.rb +8 -711
  17. data/spec/ratis/landmark_category_spec.rb +40 -32
  18. data/spec/ratis/landmark_spec.rb +4 -33
  19. data/spec/ratis/location_spec.rb +69 -177
  20. data/spec/ratis/next_bus2_spec.rb +21 -21
  21. data/spec/ratis/next_bus_spec.rb +19 -21
  22. data/spec/ratis/pattern_spec.rb +3 -3
  23. data/spec/ratis/plantrip_spec.rb +92 -0
  24. data/spec/ratis/point_2_point_spec.rb +12 -12
  25. data/spec/ratis/request_spec.rb +0 -1
  26. data/spec/ratis/route_pattern_spec.rb +16 -15
  27. data/spec/ratis/route_stops_spec.rb +10 -10
  28. data/spec/ratis/routes_spec.rb +5 -5
  29. data/spec/ratis/schedule_nearby_spec.rb +1 -1
  30. data/spec/ratis/timetable_spec.rb +3 -3
  31. data/spec/ratis/walkstop_spec.rb +94 -0
  32. data/spec/spec_helper.rb +16 -11
  33. data/spec/support/vcr_cassettes/Nextbus2_running_LATE.yml +142 -574
  34. data/spec/support/vcr_cassettes/Nextbus_running_LATE.yml +101 -137
  35. data/spec/support/vcr_cassettes/Point2Point.yml +63 -162
  36. data/spec/support/vcr_cassettes/Ratis_Area/_all/only_makes_one_request.yml +52 -0
  37. data/spec/support/vcr_cassettes/Ratis_ClosestStop/_where/only_makes_one_request.yml +70 -0
  38. data/spec/support/vcr_cassettes/Ratis_ClosestStop/_where/parses_out_the_stop_fields_correctly.yml +70 -0
  39. data/spec/support/vcr_cassettes/Ratis_ClosestStop/_where/returns_multiple_locations.yml +70 -0
  40. data/spec/support/vcr_cassettes/Ratis_ClosestStop/_where/should_return_a_collection_of_Ratis_Stop_s_.yml +70 -0
  41. data/spec/support/vcr_cassettes/Ratis_LandmarkCategory/_all/only_makes_one_request.yml +117 -0
  42. data/spec/support/vcr_cassettes/Ratis_LandmarkCategory/_all/should_return_a_collection_of_Ratis_LandmarkCategory_s_.yml +117 -0
  43. data/spec/support/vcr_cassettes/Ratis_LandmarkCategory/_all/should_return_all_landmark_categories.yml +117 -0
  44. data/spec/support/vcr_cassettes/Ratis_LandmarkCategory/_web_categories/does_something.yml +117 -0
  45. data/spec/support/vcr_cassettes/Ratis_Location/_where/only_makes_one_request.yml +54 -0
  46. data/spec/support/vcr_cassettes/Ratis_Location/_where/parses_out_fields_correctly.yml +54 -0
  47. data/spec/support/vcr_cassettes/Ratis_Location/_where/should_return_a_collection_of_Ratis_Location_s_.yml +54 -0
  48. data/spec/support/vcr_cassettes/Ratis_NextBus/_where/multiple_services_returned/only_makes_one_request.yml +109 -0
  49. data/spec/support/vcr_cassettes/Ratis_NextBus/_where/multiple_services_returned/returns_the_next_4_bus_times.yml +109 -0
  50. data/spec/support/vcr_cassettes/Ratis_NextBus/_where/multiple_services_returned/should_map_all_the_services_to_service_openstruct_objects.yml +109 -0
  51. data/spec/support/vcr_cassettes/Ratis_NextBus/_where/multiple_services_returned/should_raise_error_if_datetime_condition_is_not_a_DateTime_or_Time.yml +211 -0
  52. data/spec/support/vcr_cassettes/Ratis_NextBus/_where/single_service_return/only_makes_one_request.yml +75 -0
  53. data/spec/support/vcr_cassettes/Ratis_NextBus/_where/single_service_return/returns_the_next_bus_times.yml +75 -0
  54. data/spec/support/vcr_cassettes/Ratis_NextBus/_where/single_service_return/should_raise_error_if_datetime_condition_is_not_a_DateTime_or_Time.yml +143 -0
  55. data/spec/support/vcr_cassettes/Ratis_NextBus/_where/single_service_return/should_set_all_the_service_values_to_instance_vars.yml +75 -0
  56. data/spec/support/vcr_cassettes/Ratis_NextBus2/_where/Developer_can_find_a_late_bus_to_a_stop/runs/should_set_the_run_values_to_instance_vars.yml +180 -0
  57. data/spec/support/vcr_cassettes/Ratis_NextBus2/_where/Developer_can_find_a_late_bus_to_a_stop/single_next_bus/only_makes_one_request.yml +180 -0
  58. data/spec/support/vcr_cassettes/Ratis_NextBus2/_where/Developer_can_find_a_late_bus_to_a_stop/single_next_bus/requests_the_correct_SOAP_action.yml +180 -0
  59. data/spec/support/vcr_cassettes/Ratis_NextBus2/_where/Developer_can_find_a_late_bus_to_a_stop/stops/should_set_the_stop_values_to_instance_vars.yml +180 -0
  60. data/spec/support/vcr_cassettes/Ratis_Pattern/_all/only_makes_one_request.yml +56 -0
  61. data/spec/support/vcr_cassettes/Ratis_Pattern/_all/should_parse_the_route_info_fields.yml +56 -0
  62. data/spec/support/vcr_cassettes/Ratis_Pattern/_all/should_return_a_collection_Pattern_RouteInfo_s_.yml +56 -0
  63. data/spec/support/vcr_cassettes/Ratis_Pattern/_all/should_return_no_data_error_when_date_is_in_the_past.yml +53 -0
  64. data/spec/support/vcr_cassettes/Ratis_Plantrip/_where/creates_Ratis_Itineraries_for_each_trip_itinerary.yml +88 -0
  65. data/spec/support/vcr_cassettes/Ratis_Plantrip/_where/only_makes_one_request.yml +88 -0
  66. data/spec/support/vcr_cassettes/Ratis_Plantrip/_where/returns_a_Plantrip_object.yml +88 -0
  67. data/spec/support/vcr_cassettes/Ratis_Plantrip/_where/should_set_all_the_Plantrip_values_to_instance_vars.yml +88 -0
  68. data/spec/support/vcr_cassettes/Ratis_Point2Point/Routesonly_N/_where/gets_the_groups.yml +134 -0
  69. data/spec/support/vcr_cassettes/Ratis_Point2Point/Routesonly_N/_where/gets_the_trips_within_each_group.yml +134 -0
  70. data/spec/support/vcr_cassettes/Ratis_Point2Point/Routesonly_N/_where/only_makes_one_request.yml +134 -0
  71. data/spec/support/vcr_cassettes/Ratis_Point2Point/Routesonly_N/_where/parses_out_the_off_stop_fields.yml +134 -0
  72. data/spec/support/vcr_cassettes/Ratis_Point2Point/Routesonly_N/_where/parses_out_the_on_stop_fields.yml +134 -0
  73. data/spec/support/vcr_cassettes/Ratis_Point2Point/Routesonly_N/_where/parses_out_the_service.yml +134 -0
  74. data/spec/support/vcr_cassettes/Ratis_Point2Point/Routesonly_N/_where/parses_out_the_trip.yml +134 -0
  75. data/spec/support/vcr_cassettes/Ratis_Point2Point/Routesonly_N/_where/should_only_return_result_groups_for_filtered_route.yml +62 -0
  76. data/spec/support/vcr_cassettes/Ratis_Point2Point/Routesonly_N/_where/should_only_return_result_groups_for_filtered_routes.yml +68 -0
  77. data/spec/support/vcr_cassettes/Ratis_Point2Point/Routesonly_N/_where/should_raise_error_if_the_trip_is_NOT_possible_for_a_route_being_attempted_to_filter_on.yml +53 -0
  78. data/spec/support/vcr_cassettes/Ratis_Point2Point/Routesonly_Y/_where/services_from_origin_to_destination/only_makes_one_request.yml +72 -0
  79. data/spec/support/vcr_cassettes/Ratis_Point2Point/Routesonly_Y/_where/services_from_origin_to_destination/parses_out_service_fields.yml +72 -0
  80. data/spec/support/vcr_cassettes/Ratis_Point2Point/Routesonly_Y/_where/services_from_origin_to_destination/returns_a_routes_only_response_for_each_matched_service.yml +72 -0
  81. data/spec/support/vcr_cassettes/Ratis_Point2Point/Routesonly_Y/_where/services_from_origin_to_destination/returns_all_matching_services_that_fit_the_origin/destination_for_a_given_time_frame.yml +72 -0
  82. data/spec/support/vcr_cassettes/Ratis_Point2Point/Routesonly_Y/_where/services_from_origin_to_destination/should_NOT_filter_by_passed_in_routes.yml +72 -0
  83. data/spec/support/vcr_cassettes/Ratis_RoutePattern/_where/only_makes_one_request.yml +152 -0
  84. data/spec/support/vcr_cassettes/Ratis_RoutePattern/_where/should_parse_the_stop_fields.yml +152 -0
  85. data/spec/support/vcr_cassettes/Ratis_RoutePattern/_where/should_return_a_collection_Ratis_RoutePattern_Point_s_.yml +152 -0
  86. data/spec/support/vcr_cassettes/Ratis_RoutePattern/_where/should_return_a_collection_Ratis_RoutePattern_Stop_s_.yml +152 -0
  87. data/spec/support/vcr_cassettes/Ratis_RouteStops/_all/only_makes_one_request.yml +94 -0
  88. data/spec/support/vcr_cassettes/Ratis_RouteStops/_all/parses_out_the_stop_fields_correctly.yml +94 -0
  89. data/spec/support/vcr_cassettes/Ratis_RouteStops/_all/should_return_a_collection_of_Ratis_RouteStops_Stop_s_.yml +94 -0
  90. data/spec/support/vcr_cassettes/Ratis_Routes/_all/only_makes_one_request.yml +779 -0
  91. data/spec/support/vcr_cassettes/Ratis_Routes/_all/returns_all_routes.yml +779 -0
  92. data/spec/support/vcr_cassettes/Ratis_Routes/_all/should_set_directions_and_short_name_to_variables.yml +779 -0
  93. data/spec/support/vcr_cassettes/Ratis_ScheduleNearby/_where/only_makes_one_request.yml +92 -0
  94. data/spec/support/vcr_cassettes/Ratis_ScheduleNearby/_where/returns_a_non_nil_ScheduleNearby.yml +92 -0
  95. data/spec/support/vcr_cassettes/Ratis_ScheduleNearby/_where/returns_a_single_service_at_the_stop.yml +92 -0
  96. data/spec/support/vcr_cassettes/Ratis_ScheduleNearby/_where/returns_all_the_stops.yml +92 -0
  97. data/spec/support/vcr_cassettes/Ratis_ScheduleNearby/_where/should_return_no_data_error_when_date_is_in_the_past.yml +53 -0
  98. data/spec/support/vcr_cassettes/Ratis_Timetable/_where/only_makes_one_request.yml +722 -0
  99. data/spec/support/vcr_cassettes/Ratis_Timetable/_where/should_parse_the_timetable/stop/trip_fields.yml +722 -0
  100. data/spec/support/vcr_cassettes/Ratis_Timetable/_where/should_return_a_collection_Timetable_Stop_s_.yml +722 -0
  101. data/spec/support/vcr_cassettes/Ratis_Walkstop/_where/only_makes_one_request.yml +53 -0
  102. data/spec/support/vcr_cassettes/Ratis_Walkstop/_where/should_set_all_the_walkstop_values_to_instance_vars.yml +53 -0
  103. metadata +241 -219
  104. data/lib/ratis/walk.rb +0 -37
  105. data/spec/ratis/walk_spec.rb +0 -72
  106. data/spec/support/vcr_cassettes/Nextbus.yml +0 -145
  107. data/spec/support/vcr_cassettes/Nextbus2.yml +0 -336
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 63bc8b3066b080ec3f2706b9cd8efed6aa3e3e86
4
+ data.tar.gz: c5f42c32ff8c73e273837051041e12fabab12ebe
5
+ SHA512:
6
+ metadata.gz: 4639c70cb1ef9e3afda8c01156f30d36d5af366cefa037ac9baaccf69642dfb26a9f8c8295a14f0330260433604155bbe033ece07fb35ecea0612be909b1ec40
7
+ data.tar.gz: 3284568935fce3919221bae7a30159126ffe76c2e5b490bde313df460627364ece0d7fb49de934383eb2dd59dd16c0a9c1adacf13fd7a5020f58c862b410f21c
data/.rvmrc CHANGED
@@ -1 +1 @@
1
- rvm use 1.8.7-p371@ratis --create
1
+ rvm use ruby-2.0.0-p0@ratis --create
data/CHANGELOG CHANGED
@@ -34,4 +34,11 @@
34
34
  - Timetable::Trip now contains the trip's headsign
35
35
 
36
36
  3.3.5
37
- - Refactored Ratis::Location to be usable in Trip Planner
37
+ - Refactored Ratis::Location to be usable in Trip Planner
38
+
39
+ 3.3.7
40
+ - all tests now use VCR
41
+ - fixes for failing tests
42
+ - changed itinerary_spec to plantrip_spec
43
+ - created new empty itinerary_spec as stub
44
+ - changed walk_spec to walkstop_spec
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source :rubygems
1
+ source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
4
 
data/Gemfile.lock CHANGED
@@ -1,55 +1,55 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ratis (3.3.4)
4
+ ratis (3.3.6)
5
5
  savon (< 2.0)
6
6
 
7
7
  GEM
8
- remote: http://rubygems.org/
8
+ remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (3.2.13)
11
- i18n (= 0.6.1)
10
+ activesupport (3.2.16)
11
+ i18n (~> 0.6, >= 0.6.4)
12
12
  multi_json (~> 1.0)
13
13
  addressable (2.3.5)
14
14
  akami (1.2.0)
15
15
  gyoku (>= 0.4.0)
16
16
  nokogiri (>= 1.4.0)
17
17
  builder (3.2.2)
18
- chronic (0.9.1)
18
+ chronic (0.10.2)
19
19
  columnize (0.3.6)
20
- crack (0.4.0)
20
+ crack (0.4.1)
21
21
  safe_yaml (~> 0.9.0)
22
- diff-lcs (1.2.4)
22
+ debugger (1.6.5)
23
+ columnize (>= 0.3.1)
24
+ debugger-linecache (~> 1.2.0)
25
+ debugger-ruby_core_source (~> 1.3.1)
26
+ debugger-linecache (1.2.0)
27
+ debugger-ruby_core_source (1.3.1)
28
+ diff-lcs (1.2.5)
23
29
  gyoku (0.4.6)
24
30
  builder (>= 2.1.2)
25
- hashdiff (0.0.6)
31
+ hashdiff (0.1.1)
26
32
  httpi (1.1.1)
27
33
  rack
28
- i18n (0.6.1)
29
- linecache (0.46)
30
- rbx-require-relative (> 0.0.4)
31
- multi_json (1.7.7)
32
- nokogiri (1.5.10)
34
+ i18n (0.6.9)
35
+ mini_portile (0.5.2)
36
+ multi_json (1.8.2)
37
+ nokogiri (1.6.1)
38
+ mini_portile (~> 0.5.0)
33
39
  nori (1.1.5)
34
40
  rack (1.5.2)
35
- rake (10.1.0)
36
- rbx-require-relative (0.0.9)
41
+ rake (10.1.1)
37
42
  redcarpet (2.1.1)
38
- rspec (2.13.0)
39
- rspec-core (~> 2.13.0)
40
- rspec-expectations (~> 2.13.0)
41
- rspec-mocks (~> 2.13.0)
42
- rspec-core (2.13.1)
43
- rspec-expectations (2.13.0)
43
+ rspec (2.14.1)
44
+ rspec-core (~> 2.14.0)
45
+ rspec-expectations (~> 2.14.0)
46
+ rspec-mocks (~> 2.14.0)
47
+ rspec-core (2.14.7)
48
+ rspec-expectations (2.14.4)
44
49
  diff-lcs (>= 1.1.3, < 2.0)
45
50
  rspec-instafail (0.2.4)
46
- rspec-mocks (2.13.1)
47
- ruby-debug (0.10.4)
48
- columnize (>= 0.1)
49
- ruby-debug-base (~> 0.10.4.0)
50
- ruby-debug-base (0.10.4)
51
- linecache (>= 0.3)
52
- safe_yaml (0.9.4)
51
+ rspec-mocks (2.14.4)
52
+ safe_yaml (0.9.7)
53
53
  savon (1.2.0)
54
54
  akami (~> 1.2.0)
55
55
  builder (>= 2.1.2)
@@ -58,14 +58,13 @@ GEM
58
58
  nokogiri (>= 1.4.0)
59
59
  nori (~> 1.1.0)
60
60
  wasabi (~> 2.5.0)
61
- vcr (2.5.0)
61
+ vcr (2.8.0)
62
62
  wasabi (2.5.1)
63
63
  httpi (~> 1.0)
64
64
  nokogiri (>= 1.4.0)
65
- webmock (1.13.0)
65
+ webmock (1.16.1)
66
66
  addressable (>= 2.2.7)
67
67
  crack (>= 0.3.2)
68
- yard (0.8.6.2)
69
68
 
70
69
  PLATFORMS
71
70
  ruby
@@ -74,14 +73,13 @@ DEPENDENCIES
74
73
  activesupport (< 4.0)
75
74
  bundler (>= 1.0.0)
76
75
  chronic
76
+ debugger
77
77
  hashdiff
78
- nokogiri (< 1.6.0)
78
+ nokogiri (> 1.6.0)
79
79
  rake
80
80
  ratis!
81
81
  redcarpet (~> 2.1.1)
82
- rspec (~> 2.13.0)
82
+ rspec (~> 2.14.0)
83
83
  rspec-instafail
84
- ruby-debug
85
84
  vcr
86
85
  webmock
87
- yard
data/lib/ratis.rb CHANGED
@@ -33,7 +33,7 @@ require 'ratis/stop'
33
33
  require 'ratis/timetable'
34
34
  require 'ratis/timetable/stop'
35
35
  require 'ratis/timetable/trip'
36
- require 'ratis/walk'
36
+ require 'ratis/walkstop'
37
37
  require 'ratis/area'
38
38
 
39
39
  module Ratis
@@ -12,12 +12,13 @@ module Ratis
12
12
  raise ArgumentError.new('You must provide a type') if type.blank?
13
13
  Ratis.all_conditions_used? conditions
14
14
 
15
- response = Request.get 'Getlandmarks', {'Appid' => app_id,
16
- 'Type' => type,
15
+ response = Request.get 'Getlandmarks', {'Appid' => app_id,
16
+ 'Type' => type,
17
17
  'Zipcode' => zipcode}
18
+
18
19
  return [] unless response.success?
19
20
 
20
- response.to_array(:getlandmarks_response, :landmarks, :landmark).map do |landmark|
21
+ response.to_array(:getlandmarks_response, :landmark).map do |landmark|
21
22
  atis_landmark = Landmark.new
22
23
  atis_landmark.type = landmark[:type]
23
24
  atis_landmark.verbose = landmark[:verbose]
@@ -4,17 +4,21 @@ module Ratis
4
4
 
5
5
  attr_accessor :type, :description, :human_type, :human_description
6
6
 
7
+ def initialize(ti)
8
+ @type = ti[:type]
9
+ @description = ti[:description]
10
+ @human_type = type.gsub(/web/i, "")
11
+ @human_description = description.gsub(/web\s*/i, "")
12
+ end
13
+
7
14
  def self.all
8
15
  response = Request.get 'Getcategories'
16
+
9
17
  return [] unless response.success?
10
18
 
11
- response.to_array(:getcategories_response, :types, :typeinfo).map do |ti|
12
- lc = LandmarkCategory.new
13
- lc.type = ti[:type]
14
- lc.description = ti[:description]
15
- lc.human_type = lc.type.gsub(/web/i, "")
16
- lc.human_description = lc.description.gsub(/web\s*/i, "")
17
- lc
19
+ categories = response.to_array(:getcategories_response, :types, :typeinfo)
20
+ categories.map do |category|
21
+ Ratis::LandmarkCategory.new(category)
18
22
  end
19
23
  end
20
24
 
@@ -35,6 +35,7 @@ module Ratis
35
35
  raise ArgumentError.new('You must provide a location') unless location
36
36
  raise ArgumentError.new('You must provide media of A|W|I') unless ['A','W','I'].include? media
37
37
  raise ArgumentError.new('You must provide a numeric max_answers') unless (Integer max_answers rescue false)
38
+
38
39
  Ratis.all_conditions_used? conditions
39
40
 
40
41
  response = Request.get 'Locate', {'Appid' => app_id,
@@ -1,11 +1,5 @@
1
1
  module Ratis
2
2
 
3
- ################################# EXAMPLE ############################################
4
- #
5
- # Ratis::RouteStops.all :route => 8, :direction => 'S', :order => 'S'
6
- #
7
- ######################################################################################
8
-
9
3
  class RouteStops
10
4
 
11
5
  def self.all(conditions)
data/lib/ratis/version.rb CHANGED
@@ -5,7 +5,7 @@ module Ratis
5
5
  def version
6
6
  @version ||= begin
7
7
 
8
- string = '3.3.6'
8
+ string = '3.3.7'
9
9
 
10
10
  def string.parts
11
11
  split('.').map { |p| p.to_i }
@@ -0,0 +1,54 @@
1
+ module Ratis
2
+
3
+ class Walkstop
4
+
5
+ attr_accessor :legs, :walk_distance, :walk_units, :walk_time,
6
+ :start_lat, :start_long, :end_lat, :end_long,
7
+ :start_text, :end_text, :success
8
+
9
+ def initialize(response)
10
+ @success = response.success?
11
+ @legs = []
12
+
13
+ if @success
14
+ walkstop_response = response[:walkstop_response]
15
+ @legs = response.to_array(:walkstop_response, :walk, :leg)
16
+ @walk_distance = walkstop_response[:walkinfo][:walkdistance]
17
+ @walk_units = walkstop_response[:walkinfo][:walkunits]
18
+ @walk_time = walkstop_response[:walkinfo][:walktime]
19
+ @start_text = walkstop_response[:starttext]
20
+ @end_text = walkstop_response[:endtext]
21
+ end
22
+ end
23
+
24
+ def self.where(conditions)
25
+ start_lat = conditions.delete :start_lat
26
+ start_long = conditions.delete :start_long
27
+ end_lat = conditions.delete :end_lat
28
+ end_long = conditions.delete :end_long
29
+ app_id = conditions.delete(:app_id) || 'ratis-gem'
30
+
31
+ raise ArgumentError.new('You must provide a start_lat') unless start_lat
32
+ raise ArgumentError.new('You must provide a start_long') unless start_long
33
+ raise ArgumentError.new('You must provide an end_lat') unless end_lat
34
+ raise ArgumentError.new('You must provide an end_long') unless end_long
35
+
36
+ Ratis.all_conditions_used? conditions
37
+
38
+ response = Request.get 'Walkstop',
39
+ 'Startlat' => start_lat,
40
+ 'Startlong' => start_long,
41
+ 'Endlat' => end_lat,
42
+ 'Endlong' => end_long,
43
+ 'Appid' => app_id
44
+
45
+ Walkstop.new(response)
46
+ end
47
+
48
+ def to_hash
49
+ keys = [:legs, :walk_distance, :walk_units, :walk_time]
50
+ Hash[keys.map { |k| [k, send(k)] }]
51
+ end
52
+ end
53
+
54
+ end
data/ratis.gemspec CHANGED
@@ -22,13 +22,11 @@ Gem::Specification.new do |s|
22
22
  s.add_development_dependency 'hashdiff'
23
23
  s.add_development_dependency 'rake'
24
24
  s.add_development_dependency 'redcarpet', '~> 2.1.1'
25
- s.add_development_dependency 'rspec', '~> 2.13.0'
25
+ s.add_development_dependency 'rspec', '~> 2.14.0'
26
26
  s.add_development_dependency 'rspec-instafail'
27
- s.add_development_dependency 'ruby-debug'
28
- s.add_development_dependency 'nokogiri', '< 1.6.0'
27
+ s.add_development_dependency 'debugger'
28
+ s.add_development_dependency 'nokogiri', '> 1.6.0'
29
29
  # s.add_development_dependency 'simplecov'
30
30
  s.add_development_dependency 'vcr'
31
31
  s.add_development_dependency 'webmock'
32
- s.add_development_dependency 'yard'
33
-
34
32
  end
@@ -9,7 +9,7 @@ describe Ratis::Area do
9
9
  end
10
10
  end
11
11
 
12
- describe '#all' do
12
+ describe '#all', vcr: {} do
13
13
  it 'only makes one request' do
14
14
  # false just to stop further processing of response
15
15
  Ratis::Request.should_receive(:get).once.and_call_original
@@ -10,7 +10,7 @@ describe Ratis::ClosestStop do
10
10
  end
11
11
  end
12
12
 
13
- describe '#where' do
13
+ describe '#where', vcr: {} do
14
14
  before do
15
15
  @today = Time.now.strftime("%m/%d/%Y")
16
16
  @conditions = {:latitude => '33.4556',
@@ -61,7 +61,7 @@ describe Ratis::ClosestStop do
61
61
 
62
62
  expect(stop.latitude.to_f).to be_within(0.001).of(33.454494)
63
63
  expect(stop.longitude.to_f).to be_within(0.001).of(-112.070508.to_f)
64
- expect(stop.area).to be_nil
64
+ expect(stop.area).to eq('Phoenix')
65
65
  expect(stop.walk_dir).to eq('SE')
66
66
  expect(stop.stop_position).to eq('Y')
67
67
  expect(stop.description).to eq('FILLMORE ST & 3RD ST')
@@ -1,721 +1,18 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Ratis::Itinerary do
4
-
5
- describe 'single itinerary, single service' do
6
-
7
- before do
8
- stub_atis_request.to_return( atis_response 'Plantrip', '1.27', '0', <<-BODY )
9
- <Input>
10
- <Originlat>33.452082</Originlat>
11
- <Originlong>-112.074374</Originlong>
12
- <Originlandmarkid>0</Originlandmarkid>
13
- <Origintext>Origin</Origintext>
14
- <Destinationlat>33.446347</Destinationlat>
15
- <Destinationlong>-112.068689</Destinationlong>
16
- <Destinationlandmarkid>0</Destinationlandmarkid>
17
- <Destinationtext>Destination</Destinationtext>
18
- <Date>07/26/2012</Date>
19
- <Time>06:43 PM</Time>
20
- <Minimize>T</Minimize>
21
- <Accessible>N</Accessible>
22
- <Arrdep>D</Arrdep>
23
- <Walkspeed> 2.00 </Walkspeed>
24
- <Maxwalk>0.4</Maxwalk>
25
- <Walkorigin>0.4</Walkorigin>
26
- <Walkdestination>0.4</Walkdestination>
27
- </Input>
28
- <Lesserttime>
29
- <Time/>
30
- <Arrdep/>
31
- </Lesserttime>
32
- <Walkable>N</Walkable>
33
- <Walkadjust>0</Walkadjust>
34
- <Itin>
35
- <Legs>
36
- <Leg>
37
- <Onwalkdist>0.21</Onwalkdist>
38
- <Onwalkdir>W</Onwalkdir>
39
- <Onwalkhint>Y</Onwalkhint>
40
- <Onstop>VAN BUREN&#x2F;1ST AVE LIGHT RAIL STATION</Onstop>
41
- <Ontime>1859</Ontime>
42
- <Onstopdata>
43
- <Description>VAN BUREN&#x2F;1ST AVE LIGHT RAIL STATION</Description>
44
- <Area>PH</Area>
45
- <Lat>33.452252</Lat>
46
- <Long>-112.075081</Long>
47
- <Time>1859</Time>
48
- <Date>07/26/12</Date>
49
- <Atisstopid>10880</Atisstopid>
50
- <Stopid>10012</Stopid>
51
- <Stopstatustype>N</Stopstatustype>
52
- <Stopseq>11</Stopseq>
53
- <Stopposition>O</Stopposition>
54
- <Heading>NB</Heading>
55
- <Side>Far</Side>
56
- <Accessible>N</Accessible>
57
- </Onstopdata>
58
- <Service>
59
- <Route>LTRL</Route>
60
- <Sign>Metro light rail To Sycamore&#x2F;Main</Sign>
61
- <Altsign></Altsign>
62
- <Direction>E</Direction>
63
- <Operator>METRO</Operator>
64
- <Servicetype>W</Servicetype>
65
- <Routeid>46880</Routeid>
66
- <Block>17074</Block>
67
- <Trip>14</Trip>
68
- <Peak>N</Peak>
69
- <Routetype>L</Routetype>
70
- <Statustype>N</Statustype>
71
- <Adherence>0</Adherence>
72
- <Polltime></Polltime>
73
- <Lat>0.000000</Lat>
74
- <Long>0.000000</Long>
75
- <Vehicle></Vehicle>
76
- <Patternorigin></Patternorigin>
77
- <Patterndestination></Patterndestination>
78
- <Exception>N</Exception>
79
- <Statusid>0</Statusid>
80
- </Service>
81
- <Fare>
82
- <Onfarezone>0</Onfarezone>
83
- <Offfarezone>0</Offfarezone>
84
- <Legregularfare>1.75</Legregularfare>
85
- <Legregularfarexfer>0.00</Legregularfarexfer>
86
- <Legreducedfare>0.85</Legreducedfare>
87
- <Legreducedfarexfer>0.00</Legreducedfarexfer>
88
- </Fare>
89
- <Offstop>3RD STREET&#x2F;JEFFERSON LIGHT RAIL STATION</Offstop>
90
- <Offtime>1903</Offtime>
91
- <Offstopdata>
92
- <Description>3RD STREET&#x2F;JEFFERSON LIGHT RAIL STATION</Description>
93
- <Area>PH</Area>
94
- <Lat>33.446270</Lat>
95
- <Long>-112.069777</Long>
96
- <Time>1903</Time>
97
- <Date>07/26/12</Date>
98
- <Atisstopid>10892</Atisstopid>
99
- <Stopid>10014</Stopid>
100
- <Stopstatustype>N</Stopstatustype>
101
- <Stopseq>13</Stopseq>
102
- <Stopposition>O</Stopposition>
103
- <Heading>NB</Heading>
104
- <Side>Far</Side>
105
- <Accessible>N</Accessible>
106
- </Offstopdata>
107
- </Leg>
108
- </Legs>
109
- <Finalwalk>0.07</Finalwalk>
110
- <Finalwalkdir>E</Finalwalkdir>
111
- <Finalwalkhint>Y</Finalwalkhint>
112
- <Transittime>4</Transittime>
113
- <Regularfare>1.75</Regularfare>
114
- <Reducedfare>0.85</Reducedfare>
115
- <Fareinfo>1|0|1.75|0.85~W|06:59 PM|07:03 PM|LTRL| |W|E|L|12|0|1956|14|46880|METRO|10880|11|10892|13|BUSFARE|0|0|0|R~</Fareinfo>
116
- <Traceinfo>1|46880|11|13</Traceinfo>
117
- <Exmodified>N</Exmodified>
118
- <Exmodids/>
119
- <Disttransit> 0.63</Disttransit>
120
- <Distauto> 0.92</Distauto>
121
- <Co2transit>0.260</Co2transit>
122
- <Co2auto>0.881</Co2auto>
123
- </Itin>
124
- BODY
125
-
126
- @itineraries = Ratis::Itinerary.where(
127
- :date => '07/26/2012', :time => '1843', :minimize => 'T',
128
- :origin_lat => '33.452082', :origin_long => '-112.074374',
129
- :destination_lat => '33.446347', :destination_long => '-112.068689' )
130
- end
131
-
132
- describe '#where' do
133
-
134
- it 'only makes one request' do
135
- an_atis_request.should have_been_made.times 1
136
- end
137
-
138
- it 'requests the correct SOAP action' do
139
- an_atis_request_for('Plantrip',
140
- 'Date' => '07/26/2012', 'Time' => '1843', 'Minimize' => 'T',
141
- 'Originlat' => '33.452082', 'Originlong' => '-112.074374',
142
- 'Destinationlat' => '33.446347', 'Destinationlong' => '-112.068689'
143
- ).should have_been_made
144
- end
145
-
146
- it 'returns one itinerary' do
147
- @itineraries.should have(1).item
148
- @itineraries.first.should be_a_kind_of Ratis::Itinerary
149
- end
150
-
151
- end
152
-
153
- describe '#legs' do
154
-
155
- it 'returns one leg' do
156
- @itineraries.first.legs.should have(1).item
157
- @itineraries.first.legs.first.should_not be_nil
158
- end
159
-
4
+ before do
5
+ Ratis.reset
6
+ Ratis.configure do |config|
7
+ config.endpoint = 'http://soap.valleymetro.org/cgi-bin-soap-web-262/soap.cgi'
8
+ config.namespace = 'PX_WEB'
160
9
  end
161
-
162
- it 'marshalls the members to their correct type' do
163
- itinerary = @itineraries.first
164
- itinerary.co2_auto = 0.881
165
- itinerary.co2_transit = 0.260
166
- itinerary.final_walk_dir = 'E'
167
- itinerary.reduced_fare = 0.85
168
- itinerary.regular_fare = 1.75
169
- itinerary.transit_time = 4
170
- end
171
-
172
10
  end
173
11
 
174
- describe 'three itineraries, each with multiple service' do
175
-
176
- before do
177
- stub_atis_request.to_return( atis_response 'Plantrip', '1.27', '0', <<-BODY )
178
- <Tid></Tid>
179
- <Input>
180
- <Originlat>33.452082</Originlat>
181
- <Originlong>-112.074374</Originlong>
182
- <Originlandmarkid>7234</Originlandmarkid>
183
- <Origintext>CENTRAL STATION</Origintext>
184
- <Destinationlat>33.432254</Destinationlat>
185
- <Destinationlong>-111.904625</Destinationlong>
186
- <Destinationlandmarkid>7542</Destinationlandmarkid>
187
- <Destinationtext>TEMPE MARKETPLACE</Destinationtext>
188
- <Date>07/31/2012</Date>
189
- <Time>09:14 AM</Time>
190
- <Minimize>T</Minimize>
191
- <Accessible>N</Accessible>
192
- <Arrdep>D</Arrdep>
193
- <Walkspeed> 2.00 </Walkspeed>
194
- <Maxwalk>0.50</Maxwalk>
195
- <Walkorigin>0.50</Walkorigin>
196
- <Walkdestination>0.50</Walkdestination>
197
- </Input>
198
- <Lesserttime>
199
- <Time/>
200
- <Arrdep/>
201
- </Lesserttime>
202
- <Walkable>N</Walkable>
203
- <Walkadjust>0</Walkadjust>
204
- <Itin>
205
- <Legs>
206
- <Leg>
207
- <Onwalkdist>0.21</Onwalkdist>
208
- <Onwalkdir>W</Onwalkdir>
209
- <Onwalkhint>Y</Onwalkhint>
210
- <Onstop>VAN BUREN&#x2F;1ST AVE LIGHT RAIL STATION</Onstop>
211
- <Ontime>0931</Ontime>
212
- <Onstopdata>
213
- <Description>VAN BUREN&#x2F;1ST AVE LIGHT RAIL STATION</Description>
214
- <Area>PH</Area>
215
- <Lat>33.452252</Lat>
216
- <Long>-112.075081</Long>
217
- <Time>0931</Time>
218
- <Date>07/31/12</Date>
219
- <Atisstopid>10880</Atisstopid>
220
- <Stopid>10012</Stopid>
221
- <Stopstatustype>N</Stopstatustype>
222
- <Stopseq>11</Stopseq>
223
- <Stopposition>O</Stopposition>
224
- <Heading>NB</Heading>
225
- <Side>Far</Side>
226
- <Accessible>N</Accessible>
227
- </Onstopdata>
228
- <Service>
229
- <Route>LTRL</Route>
230
- <Sign>Metro light rail To Sycamore&#x2F;Main</Sign>
231
- <Altsign></Altsign>
232
- <Direction>E</Direction>
233
- <Operator>METRO</Operator>
234
- <Servicetype>W</Servicetype>
235
- <Routeid>46860</Routeid>
236
- <Block>17027</Block>
237
- <Trip>3</Trip>
238
- <Peak>N</Peak>
239
- <Routetype>L</Routetype>
240
- <Statustype>N</Statustype>
241
- <Adherence>0</Adherence>
242
- <Polltime></Polltime>
243
- <Lat>0.000000</Lat>
244
- <Long>0.000000</Long>
245
- <Vehicle></Vehicle>
246
- <Patternorigin></Patternorigin>
247
- <Patterndestination></Patterndestination>
248
- <Exception>N</Exception>
249
- <Statusid>0</Statusid>
250
- </Service>
251
- <Fare>
252
- <Onfarezone>0</Onfarezone>
253
- <Offfarezone>0</Offfarezone>
254
- <Legregularfare>1.75</Legregularfare>
255
- <Legregularfarexfer>0.00</Legregularfarexfer>
256
- <Legreducedfare>0.85</Legreducedfare>
257
- <Legreducedfarexfer>0.00</Legreducedfarexfer>
258
- </Fare>
259
- <Offstop>MCCLINTOCK DR&#x2F;APACHE LIGHT RAIL STATION</Offstop>
260
- <Offtime>1007</Offtime>
261
- <Offstopdata>
262
- <Description>MCCLINTOCK DR&#x2F;APACHE LIGHT RAIL STATION</Description>
263
- <Area>TE</Area>
264
- <Lat>33.414688</Lat>
265
- <Long>-111.908882</Long>
266
- <Time>1007</Time>
267
- <Date>07/31/12</Date>
268
- <Atisstopid>10887</Atisstopid>
269
- <Stopid>10025</Stopid>
270
- <Stopstatustype>N</Stopstatustype>
271
- <Stopseq>26</Stopseq>
272
- <Stopposition>O</Stopposition>
273
- <Heading>NB</Heading>
274
- <Side>Far</Side>
275
- <Accessible>N</Accessible>
276
- </Offstopdata>
277
- </Leg>
278
- <Leg>
279
- <Onwalkdist>0</Onwalkdist>
280
- <Onwalkdir> </Onwalkdir>
281
- <Onwalkhint>N</Onwalkhint>
282
- <Onstop>MCCLINTOCK DR &amp; APACHE BLVD</Onstop>
283
- <Ontime>1013</Ontime>
284
- <Onstopdata>
285
- <Description>MCCLINTOCK DR &amp; APACHE BLVD</Description>
286
- <Area>TE</Area>
287
- <Lat>33.414938</Lat>
288
- <Long>-111.909100</Long>
289
- <Time>1013</Time>
290
- <Date>07/31/12</Date>
291
- <Atisstopid>3431</Atisstopid>
292
- <Stopid>15090</Stopid>
293
- <Stopstatustype>N</Stopstatustype>
294
- <Stopseq>32</Stopseq>
295
- <Stopposition>O</Stopposition>
296
- <Heading>NB</Heading>
297
- <Side>Far</Side>
298
- <Accessible>N</Accessible>
299
- </Onstopdata>
300
- <Service>
301
- <Route>81</Route>
302
- <Sign>81 Haydn&#x2F;Mclintk To Raintree&#x2F;Nrthsight</Sign>
303
- <Altsign></Altsign>
304
- <Direction>N</Direction>
305
- <Operator>VEOLIA-TEM</Operator>
306
- <Servicetype>W</Servicetype>
307
- <Routeid>38240</Routeid>
308
- <Block>4082</Block>
309
- <Trip>4</Trip>
310
- <Peak>N</Peak>
311
- <Routetype>B</Routetype>
312
- <Statustype>N</Statustype>
313
- <Adherence>0</Adherence>
314
- <Polltime></Polltime>
315
- <Lat>0.000000</Lat>
316
- <Long>0.000000</Long>
317
- <Vehicle></Vehicle>
318
- <Patternorigin></Patternorigin>
319
- <Patterndestination></Patterndestination>
320
- <Exception>N</Exception>
321
- <Statusid>0</Statusid>
322
- </Service>
323
- <Fare>
324
- <Onfarezone>0</Onfarezone>
325
- <Offfarezone>0</Offfarezone>
326
- <Legregularfare>1.75</Legregularfare>
327
- <Legregularfarexfer>0.00</Legregularfarexfer>
328
- <Legreducedfare>0.85</Legreducedfare>
329
- <Legreducedfarexfer>0.00</Legreducedfarexfer>
330
- </Fare>
331
- <Offstop>TEMPE MARKETPLACE</Offstop>
332
- <Offtime>1020</Offtime>
333
- <Offstopdata>
334
- <Description>TEMPE MARKETPLACE</Description>
335
- <Area>TE</Area>
336
- <Lat>33.432256</Lat>
337
- <Long>-111.904661</Long>
338
- <Time>1020</Time>
339
- <Date>07/31/12</Date>
340
- <Atisstopid>10453</Atisstopid>
341
- <Stopid>14167</Stopid>
342
- <Stopstatustype>N</Stopstatustype>
343
- <Stopseq>36</Stopseq>
344
- <Stopposition> </Stopposition>
345
- <Heading> </Heading>
346
- <Side>unknown</Side>
347
- <Accessible>N</Accessible>
348
- </Offstopdata>
349
- </Leg>
350
- </Legs>
351
- <Finalwalk>0</Finalwalk>
352
- <Finalwalkdir> </Finalwalkdir>
353
- <Finalwalkhint>N</Finalwalkhint>
354
- <Transittime>49</Transittime>
355
- <Regularfare>3.50</Regularfare>
356
- <Reducedfare>1.70</Reducedfare>
357
- <Fareinfo>2|0|3.50|1.70~W|09:31 AM|10:07 AM|LTRL| |W|E|L|10|0|1944|3|46860|METRO|10880|11|10887|26|BUSFARE|0|0|0|R~T|10:13 AM|10:20 AM|81| |W|N|B|2|0|1609|4|38240|VEOLIA-TEM|3431|32|10453|36|BUSFARE|0|0|0|B~</Fareinfo>
358
- <Traceinfo>2|46860|11|26|38240|32|36</Traceinfo>
359
- <Exmodified>N</Exmodified>
360
- <Exmodids/>
361
- <Disttransit>12.39</Disttransit>
362
- <Distauto>12.63</Distauto>
363
- <Co2transit>5.437</Co2transit>
364
- <Co2auto>12.125</Co2auto>
365
- </Itin>
366
- <Itin>
367
- <Legs>
368
- <Leg>
369
- <Onwalkdist>0.21</Onwalkdist>
370
- <Onwalkdir>W</Onwalkdir>
371
- <Onwalkhint>Y</Onwalkhint>
372
- <Onstop>VAN BUREN&#x2F;1ST AVE LIGHT RAIL STATION</Onstop>
373
- <Ontime>0931</Ontime>
374
- <Onstopdata>
375
- <Description>VAN BUREN&#x2F;1ST AVE LIGHT RAIL STATION</Description>
376
- <Area>PH</Area>
377
- <Lat>33.452252</Lat>
378
- <Long>-112.075081</Long>
379
- <Time>0931</Time>
380
- <Date>07/31/12</Date>
381
- <Atisstopid>10880</Atisstopid>
382
- <Stopid>10012</Stopid>
383
- <Stopstatustype>N</Stopstatustype>
384
- <Stopseq>11</Stopseq>
385
- <Stopposition>O</Stopposition>
386
- <Heading>NB</Heading>
387
- <Side>Far</Side>
388
- <Accessible>N</Accessible>
389
- </Onstopdata>
390
- <Service>
391
- <Route>LTRL</Route>
392
- <Sign>Metro light rail To Sycamore&#x2F;Main</Sign>
393
- <Altsign></Altsign>
394
- <Direction>E</Direction>
395
- <Operator>METRO</Operator>
396
- <Servicetype>W</Servicetype>
397
- <Routeid>46860</Routeid>
398
- <Block>17027</Block>
399
- <Trip>3</Trip>
400
- <Peak>N</Peak>
401
- <Routetype>L</Routetype>
402
- <Statustype>N</Statustype>
403
- <Adherence>0</Adherence>
404
- <Polltime></Polltime>
405
- <Lat>0.000000</Lat>
406
- <Long>0.000000</Long>
407
- <Vehicle></Vehicle>
408
- <Patternorigin></Patternorigin>
409
- <Patterndestination></Patterndestination>
410
- <Exception>N</Exception>
411
- <Statusid>0</Statusid>
412
- </Service>
413
- <Fare>
414
- <Onfarezone>0</Onfarezone>
415
- <Offfarezone>0</Offfarezone>
416
- <Legregularfare>1.75</Legregularfare>
417
- <Legregularfarexfer>0.00</Legregularfarexfer>
418
- <Legreducedfare>0.85</Legreducedfare>
419
- <Legreducedfarexfer>0.00</Legreducedfarexfer>
420
- </Fare>
421
- <Offstop>VETERANS WAY&#x2F;COLLEGE LIGHT RAIL STATION</Offstop>
422
- <Offtime>0959</Offtime>
423
- <Offstopdata>
424
- <Description>VETERANS WAY&#x2F;COLLEGE LIGHT RAIL STATION</Description>
425
- <Area>TE</Area>
426
- <Lat>33.426222</Lat>
427
- <Long>-111.936477</Long>
428
- <Time>0959</Time>
429
- <Date>07/31/12</Date>
430
- <Atisstopid>10895</Atisstopid>
431
- <Stopid>10022</Stopid>
432
- <Stopstatustype>N</Stopstatustype>
433
- <Stopseq>22</Stopseq>
434
- <Stopposition>O</Stopposition>
435
- <Heading>NB</Heading>
436
- <Side>Far</Side>
437
- <Accessible>N</Accessible>
438
- </Offstopdata>
439
- </Leg>
440
- <Leg>
441
- <Onwalkdist>0</Onwalkdist>
442
- <Onwalkdir> </Onwalkdir>
443
- <Onwalkhint>N</Onwalkhint>
444
- <Onstop>TEMPE TRANSIT CENTER NORTH SIDE</Onstop>
445
- <Ontime>1031</Ontime>
446
- <Onstopdata>
447
- <Description>TEMPE TRANSIT CENTER NORTH SIDE</Description>
448
- <Area>TE</Area>
449
- <Lat>33.425740</Lat>
450
- <Long>-111.935929</Long>
451
- <Time>1031</Time>
452
- <Date>07/31/12</Date>
453
- <Atisstopid>11042</Atisstopid>
454
- <Stopid>14163</Stopid>
455
- <Stopstatustype>N</Stopstatustype>
456
- <Stopseq>42</Stopseq>
457
- <Stopposition> </Stopposition>
458
- <Heading> </Heading>
459
- <Side>unknown</Side>
460
- <Accessible>N</Accessible>
461
- </Onstopdata>
462
- <Service>
463
- <Route>62</Route>
464
- <Sign>62 Hardy&#x2F;Guadalupe To Tempe Marketplace</Sign>
465
- <Altsign></Altsign>
466
- <Direction>N</Direction>
467
- <Operator>VEOLIA-TEM</Operator>
468
- <Servicetype>W</Servicetype>
469
- <Routeid>37140</Routeid>
470
- <Block>4049</Block>
471
- <Trip>5</Trip>
472
- <Peak>N</Peak>
473
- <Routetype>B</Routetype>
474
- <Statustype>N</Statustype>
475
- <Adherence>0</Adherence>
476
- <Polltime></Polltime>
477
- <Lat>0.000000</Lat>
478
- <Long>0.000000</Long>
479
- <Vehicle></Vehicle>
480
- <Patternorigin></Patternorigin>
481
- <Patterndestination></Patterndestination>
482
- <Exception>N</Exception>
483
- <Statusid>0</Statusid>
484
- </Service>
485
- <Fare>
486
- <Onfarezone>0</Onfarezone>
487
- <Offfarezone>0</Offfarezone>
488
- <Legregularfare>1.75</Legregularfare>
489
- <Legregularfarexfer>0.00</Legregularfarexfer>
490
- <Legreducedfare>0.85</Legreducedfare>
491
- <Legreducedfarexfer>0.00</Legreducedfarexfer>
492
- </Fare>
493
- <Offstop>TEMPE MARKETPLACE</Offstop>
494
- <Offtime>1044</Offtime>
495
- <Offstopdata>
496
- <Description>TEMPE MARKETPLACE</Description>
497
- <Area>TE</Area>
498
- <Lat>33.432256</Lat>
499
- <Long>-111.904661</Long>
500
- <Time>1044</Time>
501
- <Date>07/31/12</Date>
502
- <Atisstopid>10453</Atisstopid>
503
- <Stopid>14167</Stopid>
504
- <Stopstatustype>N</Stopstatustype>
505
- <Stopseq>51</Stopseq>
506
- <Stopposition> </Stopposition>
507
- <Heading> </Heading>
508
- <Side>unknown</Side>
509
- <Accessible>N</Accessible>
510
- </Offstopdata>
511
- </Leg>
512
- </Legs>
513
- <Finalwalk>0</Finalwalk>
514
- <Finalwalkdir> </Finalwalkdir>
515
- <Finalwalkhint>N</Finalwalkhint>
516
- <Transittime>73</Transittime>
517
- <Regularfare>3.50</Regularfare>
518
- <Reducedfare>1.70</Reducedfare>
519
- <Fareinfo>2|0|3.50|1.70~W|09:31 AM|09:59 AM|LTRL| |W|E|L|10|0|1944|3|46860|METRO|10880|11|10895|22|BUSFARE|0|0|0|R~T|10:31 AM|10:44 AM|62| |W|N|B|1|0|1279|5|37140|VEOLIA-TEM|11042|42|10453|51|BUSFARE|0|0|0|B~</Fareinfo>
520
- <Traceinfo>2|46860|11|22|37140|42|51</Traceinfo>
521
- <Exmodified>N</Exmodified>
522
- <Exmodids/>
523
- <Disttransit>11.82</Disttransit>
524
- <Distauto>12.08</Distauto>
525
- <Co2transit>5.520</Co2transit>
526
- <Co2auto>11.597</Co2auto>
527
- </Itin>
528
- <Itin>
529
- <Legs>
530
- <Leg>
531
- <Onwalkdist>0.21</Onwalkdist>
532
- <Onwalkdir>W</Onwalkdir>
533
- <Onwalkhint>Y</Onwalkhint>
534
- <Onstop>VAN BUREN&#x2F;1ST AVE LIGHT RAIL STATION</Onstop>
535
- <Ontime>0931</Ontime>
536
- <Onstopdata>
537
- <Description>VAN BUREN&#x2F;1ST AVE LIGHT RAIL STATION</Description>
538
- <Area>PH</Area>
539
- <Lat>33.452252</Lat>
540
- <Long>-112.075081</Long>
541
- <Time>0931</Time>
542
- <Date>07/31/12</Date>
543
- <Atisstopid>10880</Atisstopid>
544
- <Stopid>10012</Stopid>
545
- <Stopstatustype>N</Stopstatustype>
546
- <Stopseq>11</Stopseq>
547
- <Stopposition>O</Stopposition>
548
- <Heading>NB</Heading>
549
- <Side>Far</Side>
550
- <Accessible>N</Accessible>
551
- </Onstopdata>
552
- <Service>
553
- <Route>LTRL</Route>
554
- <Sign>Metro light rail To Sycamore&#x2F;Main</Sign>
555
- <Altsign></Altsign>
556
- <Direction>E</Direction>
557
- <Operator>METRO</Operator>
558
- <Servicetype>W</Servicetype>
559
- <Routeid>46860</Routeid>
560
- <Block>17027</Block>
561
- <Trip>3</Trip>
562
- <Peak>N</Peak>
563
- <Routetype>L</Routetype>
564
- <Statustype>N</Statustype>
565
- <Adherence>0</Adherence>
566
- <Polltime></Polltime>
567
- <Lat>0.000000</Lat>
568
- <Long>0.000000</Long>
569
- <Vehicle></Vehicle>
570
- <Patternorigin></Patternorigin>
571
- <Patterndestination></Patterndestination>
572
- <Exception>N</Exception>
573
- <Statusid>0</Statusid>
574
- </Service>
575
- <Fare>
576
- <Onfarezone>0</Onfarezone>
577
- <Offfarezone>0</Offfarezone>
578
- <Legregularfare>1.75</Legregularfare>
579
- <Legregularfarexfer>0.00</Legregularfarexfer>
580
- <Legreducedfare>0.85</Legreducedfare>
581
- <Legreducedfarexfer>0.00</Legreducedfarexfer>
582
- </Fare>
583
- <Offstop>MCCLINTOCK DR&#x2F;APACHE LIGHT RAIL STATION</Offstop>
584
- <Offtime>1007</Offtime>
585
- <Offstopdata>
586
- <Description>MCCLINTOCK DR&#x2F;APACHE LIGHT RAIL STATION</Description>
587
- <Area>TE</Area>
588
- <Lat>33.414688</Lat>
589
- <Long>-111.908882</Long>
590
- <Time>1007</Time>
591
- <Date>07/31/12</Date>
592
- <Atisstopid>10887</Atisstopid>
593
- <Stopid>10025</Stopid>
594
- <Stopstatustype>N</Stopstatustype>
595
- <Stopseq>26</Stopseq>
596
- <Stopposition>O</Stopposition>
597
- <Heading>NB</Heading>
598
- <Side>Far</Side>
599
- <Accessible>N</Accessible>
600
- </Offstopdata>
601
- </Leg>
602
- <Leg>
603
- <Onwalkdist>0</Onwalkdist>
604
- <Onwalkdir> </Onwalkdir>
605
- <Onwalkhint>N</Onwalkhint>
606
- <Onstop>MCCLINTOCK DR &amp; APACHE BLVD</Onstop>
607
- <Ontime>1043</Ontime>
608
- <Onstopdata>
609
- <Description>MCCLINTOCK DR &amp; APACHE BLVD</Description>
610
- <Area>TE</Area>
611
- <Lat>33.414938</Lat>
612
- <Long>-111.909100</Long>
613
- <Time>1043</Time>
614
- <Date>07/31/12</Date>
615
- <Atisstopid>3431</Atisstopid>
616
- <Stopid>15090</Stopid>
617
- <Stopstatustype>N</Stopstatustype>
618
- <Stopseq>32</Stopseq>
619
- <Stopposition>O</Stopposition>
620
- <Heading>NB</Heading>
621
- <Side>Far</Side>
622
- <Accessible>N</Accessible>
623
- </Onstopdata>
624
- <Service>
625
- <Route>81</Route>
626
- <Sign>81 Haydn&#x2F;Mclintk To Raintree&#x2F;Nrthsight</Sign>
627
- <Altsign></Altsign>
628
- <Direction>N</Direction>
629
- <Operator>VEOLIA-TEM</Operator>
630
- <Servicetype>W</Servicetype>
631
- <Routeid>38241</Routeid>
632
- <Block>4085</Block>
633
- <Trip>4</Trip>
634
- <Peak>N</Peak>
635
- <Routetype>B</Routetype>
636
- <Statustype>N</Statustype>
637
- <Adherence>0</Adherence>
638
- <Polltime></Polltime>
639
- <Lat>0.000000</Lat>
640
- <Long>0.000000</Long>
641
- <Vehicle></Vehicle>
642
- <Patternorigin></Patternorigin>
643
- <Patterndestination></Patterndestination>
644
- <Exception>N</Exception>
645
- <Statusid>0</Statusid>
646
- </Service>
647
- <Fare>
648
- <Onfarezone>0</Onfarezone>
649
- <Offfarezone>0</Offfarezone>
650
- <Legregularfare>1.75</Legregularfare>
651
- <Legregularfarexfer>0.00</Legregularfarexfer>
652
- <Legreducedfare>0.85</Legreducedfare>
653
- <Legreducedfarexfer>0.00</Legreducedfarexfer>
654
- </Fare>
655
- <Offstop>TEMPE MARKETPLACE</Offstop>
656
- <Offtime>1050</Offtime>
657
- <Offstopdata>
658
- <Description>TEMPE MARKETPLACE</Description>
659
- <Area>TE</Area>
660
- <Lat>33.432256</Lat>
661
- <Long>-111.904661</Long>
662
- <Time>1050</Time>
663
- <Date>07/31/12</Date>
664
- <Atisstopid>10453</Atisstopid>
665
- <Stopid>14167</Stopid>
666
- <Stopstatustype>N</Stopstatustype>
667
- <Stopseq>36</Stopseq>
668
- <Stopposition> </Stopposition>
669
- <Heading> </Heading>
670
- <Side>unknown</Side>
671
- <Accessible>N</Accessible>
672
- </Offstopdata>
673
- </Leg>
674
- </Legs>
675
- <Finalwalk>0</Finalwalk>
676
- <Finalwalkdir> </Finalwalkdir>
677
- <Finalwalkhint>N</Finalwalkhint>
678
- <Transittime>79</Transittime>
679
- <Regularfare>3.50</Regularfare>
680
- <Reducedfare>1.70</Reducedfare>
681
- <Fareinfo>2|0|3.50|1.70~W|09:31 AM|10:07 AM|LTRL| |W|E|L|10|0|1944|3|46860|METRO|10880|11|10887|26|BUSFARE|0|0|0|R~T|10:43 AM|10:50 AM|81| |W|N|B|2|0|1610|4|38241|VEOLIA-TEM|3431|32|10453|36|BUSFARE|0|0|0|B~</Fareinfo>
682
- <Traceinfo>2|46860|11|26|38241|32|36</Traceinfo>
683
- <Exmodified>N</Exmodified>
684
- <Exmodids/>
685
- <Disttransit>12.39</Disttransit>
686
- <Distauto>12.63</Distauto>
687
- <Co2transit>5.437</Co2transit>
688
- <Co2auto>12.125</Co2auto>
689
- </Itin>
690
- BODY
691
-
692
- @itineraries = Ratis::Itinerary.where(
693
- :date => '07/31/2012', :time => '0914', :minimize => 'T',
694
- :origin_lat => '33.452082', :origin_long => '-112.074374',
695
- :destination_lat => '33.432254', :destination_long => '-111.904625' )
696
- end
697
-
698
- describe '#where' do
699
-
700
- it 'only makes one request' do
701
- an_atis_request.should have_been_made.times 1
702
- end
703
-
704
- it 'requests the correct SOAP action' do
705
- an_atis_request_for('Plantrip',
706
- 'Date' => '07/31/2012', 'Time' => '0914', 'Minimize' => 'T',
707
- 'Originlat' => '33.452082', 'Originlong' => '-112.074374',
708
- 'Destinationlat' => '33.432254', 'Destinationlong' => '-111.904625'
709
- ).should have_been_made
710
- end
711
-
712
- it 'returns three itineraries' do
713
- @itineraries.should have(3).item
714
- @itineraries.each { |itin| itin.should be_a_kind_of Ratis::Itinerary }
715
- end
716
-
12
+ describe '#initialize' do
13
+ it "does something" do
14
+ pending
717
15
  end
718
-
719
16
  end
720
17
 
721
18
  end