Skip to content

Commit 207e8b9

Browse files
authored
Merge branch 'main' into sorbet
2 parents 3dc95fa + 0096efe commit 207e8b9

File tree

3 files changed

+3
-20
lines changed

3 files changed

+3
-20
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ GEM
156156
dotenv (= 3.1.8)
157157
railties (>= 6.1)
158158
drb (2.2.3)
159-
en14960 (0.4.0)
159+
en14960 (0.4.2)
160160
sorbet-runtime (~> 0.5)
161161
erb (5.0.2)
162162
erb_lint (0.9.0)

app/controllers/safety_standards_controller.rb

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -250,23 +250,7 @@ def build_runout_result(platform_height, has_stop_wall)
250250

251251
sig { params(platform_height: Float, user_height: Float).returns(T.untyped) }
252252
def build_wall_height_result(platform_height, user_height)
253-
# Workaround for EN14960 v0.4.0 bug where it returns Integer 0 instead of Float 0.0
254-
# when platform_height < 0.6
255-
256-
EN14960.calculate_wall_height(
257-
platform_height, user_height
258-
)
259-
rescue TypeError => e
260-
if e.message.include?("got type Integer with value 0")
261-
# Return the expected response for no walls required
262-
EN14960::CalculatorResponse.new(
263-
value: 0.0,
264-
value_suffix: "m",
265-
breakdown: [["No walls required", "Platform height < 0.6m"]]
266-
)
267-
else
268-
raise e
269-
end
253+
EN14960.calculate_wall_height(platform_height, user_height)
270254
end
271255

272256
sig { returns(T::Hash[Symbol, T.untyped]) }

spec/support/safety_standards_test_helpers.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,7 @@ def expect_wall_height_breakdown_content(
221221
)
222222
if no_walls
223223
expect(page).to have_content("Required Wall Height: 0.0m")
224-
expect(page).to have_content("No walls required")
225-
expect(page).to have_content("Platform height < 0.6m")
224+
expect(page).to have_content("No containing walls required")
226225
else
227226
expect(page).to have_content("Required Wall Height: #{height}m")
228227
expect(page).to have_content(range)

0 commit comments

Comments
 (0)