Skip to content

Commit

Permalink
fix: StopTimes.get is probably supposed to be StopTimes.arrival_depar…
Browse files Browse the repository at this point in the history
…ture
  • Loading branch information
losvedir committed Jul 20, 2022
1 parent 51f419a commit 6ef6552
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/concentrate/group_filter/scheduled_stop_times.ex
Expand Up @@ -62,7 +62,7 @@ defmodule Concentrate.GroupFilter.ScheduledStopTimes do
trip_id = StopTimeUpdate.trip_id(stop_time_update)
stop_sequence = StopTimeUpdate.stop_sequence(stop_time_update)

case gtfs_stop_times.get(trip_id, stop_sequence, trip_date) do
case gtfs_stop_times.arrival_departure(trip_id, stop_sequence, trip_date) do
{arrival_time, departure_time} ->
stop_time_update
|> StopTimeUpdate.update_arrival_time(arrival_time)
Expand Down
8 changes: 4 additions & 4 deletions test/concentrate/group_filter/scheduled_stop_times_test.exs
Expand Up @@ -5,10 +5,10 @@ defmodule Concentrate.GroupFilter.ScheduledStopTimesTest do
alias Concentrate.{TripDescriptor, StopTimeUpdate}

defmodule FakeStopTimes do
def get("trip1", 10, {2022, 1, 1}), do: {1_610_000_000, 1_610_000_001}
def get("trip1", 20, {2022, 1, 1}), do: {1_620_000_000, 1_620_000_001}
def get("trip1", 30, {2022, 1, 1}), do: {1_630_000_000, 1_630_000_001}
def get(_, _, _), do: :unknown
def arrival_departure("trip1", 10, {2022, 1, 1}), do: {1_610_000_000, 1_610_000_001}
def arrival_departure("trip1", 20, {2022, 1, 1}), do: {1_620_000_000, 1_620_000_001}
def arrival_departure("trip1", 30, {2022, 1, 1}), do: {1_630_000_000, 1_630_000_001}
def arrival_departure(_, _, _), do: :unknown
end

# see config/test.exs
Expand Down

0 comments on commit 6ef6552

Please sign in to comment.