Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jul 19, 2025. It is now read-only.

Commit 79da837

Browse files
Convert configured mass threshold to integer
Currently a configured mass threshold will be returned as a string when flay expects an integer when it tries to compare mass to mass threshold. This also renames the assertion since the previous title was incorrect.
1 parent 582134f commit 79da837

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

‎lib/cc/engine/analyzers/engine_config.rb‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ def languages
1515
end
1616

1717
def mass_threshold_for(language)
18-
fetch_language(language).fetch("mass_threshold", nil)
18+
threshold = fetch_language(language).fetch("mass_threshold", nil)
19+
20+
if threshold
21+
threshold.to_i
22+
end
1923
end
2024

2125
def paths_for(language)

‎spec/cc/engine/analyzers/engine_config_spec.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ module CC::Engine::Analyzers
7272
end
7373

7474
describe "mass_threshold_for" do
75-
it "returns empty hash if language is not present" do
75+
it "returns configured mass threshold as integer" do
7676
engine_config = EngineConfig.new({
7777
"config" => {
7878
"languages" => {
7979
"EliXiR" => {
80-
"mass_threshold" => 13
80+
"mass_threshold" => "13"
8181
}
8282
}
8383
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /