Skip to content

Commit 82ea848

Browse files
committed
feat: add amory, babcock to short signs lists
Add the SCU ID's for Amory and Babcock on the Green Line to shorten the text shown on screens at these stations.
1 parent 4419f3f commit 82ea848

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

lib/pa_ess/utilities.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ defmodule PaEss.Utilities do
99
@comma "21012"
1010
@period "21014"
1111
@stopped_regex ~r/Stopped (\d+) stops? away/
12-
@short_sign_scu_ids ["SCOUSCU001"]
12+
@short_sign_scu_ids ["SCOUSCU001", "GAMOSCU001", "GBABSCU001"]
1313
@width 24
1414
@short_width 18
1515

test/pa_ess/utilities_test.exs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ defmodule Content.Audio.UtilitiesTest do
5959
assert replace_abbreviations("OL, OK") == "Orange Line, OK"
6060
end
6161

62-
test "case insenstive replacement of 'SVC' with 'Service'" do
62+
test "case insensitive replacement of 'SVC' with 'Service'" do
6363
assert replace_abbreviations("SvC, OK") == "Service, OK"
6464
end
6565
end
@@ -78,4 +78,21 @@ defmodule Content.Audio.UtilitiesTest do
7878
assert ["1", "21012", "21000", "2"] = pad_takes(["1", "21012", "2"])
7979
assert ["1", "21000", "2", "21014"] = pad_takes(["1", "2", "21014"])
8080
end
81+
82+
describe "sign_length/1" do
83+
test "returns :short for stations with shorter signs" do
84+
assert :short = sign_length("SCOUSCU001")
85+
assert :short = sign_length("GAMOSCU001")
86+
assert :short = sign_length("GBABSCU001")
87+
end
88+
end
89+
90+
describe "max_text_length/1" do
91+
test "returns a smaller character count for stations with shorter signs" do
92+
short_width = 18
93+
assert ^short_width = max_text_length("SCOUSCU001")
94+
assert ^short_width = max_text_length("GAMOSCU001")
95+
assert ^short_width = max_text_length("GBABSCU001")
96+
end
97+
end
8198
end

0 commit comments

Comments
 (0)