Skip to content

Commit a9fd582

Browse files
committed
style(WO80): standardrb on the equivalence + conformance specs
1 parent a043a79 commit a9fd582

3 files changed

Lines changed: 8 additions & 7 deletions

File tree

‎lib/interscript/equivalence.rb‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ def check(samples)
3535
if a == b
3636
matched += 1
3737
else
38-
distinguishing << { sample: sample, first: a, second: b }
38+
distinguishing << {sample: sample, first: a, second: b}
3939
end
4040
end
4141
ratio = tested.zero? ? 1.0 : matched.fdiv(tested)
42-
{ tested: tested, matched: matched, ratio: ratio,
43-
distinguishing: distinguishing }
42+
{tested: tested, matched: matched, ratio: ratio,
43+
distinguishing: distinguishing}
4444
end
4545
end
4646
end

‎spec/interscript/equivalence_spec.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def identical_pair(dir)
3030

3131
it "reports full agreement for identical systems" do
3232
Dir.mktmpdir do |dir|
33-
a, b = identical_pair(dir)
33+
identical_pair(dir)
3434
Interscript.load_path.unshift(dir)
3535
begin
3636
result = described_class.check("tst-a-1", "tst-b-1", samples: ["ab", "abc", "b"])
@@ -63,7 +63,7 @@ def identical_pair(dir)
6363
begin
6464
result = described_class.check("tst-c-1", "tst-c-2", samples: ["a", "b"])
6565
expect(result[:ratio]).to eq(0.5)
66-
expect(result[:distinguishing]).to eq([{ sample: "a", first: "x", second: "y" }])
66+
expect(result[:distinguishing]).to eq([{sample: "a", first: "x", second: "y"}])
6767
ensure
6868
Interscript.load_path.delete(dir)
6969
end

‎spec/interscript/ml/conformance_spec.rb‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
failures << "#{v["src"].inspect} -> #{got.inspect} (expected #{v["out"].inspect})" if got != v["out"]
2323
end
2424
expect(failures).to be_empty,
25-
"#{vectors['model']}: #{failures.length}/#{vectors['vectors'].length} mismatched\n" +
26-
failures.first(3).join("\n")
25+
"#{vectors["model"]}: #{failures.length}/#{vectors["vectors"].length} mismatched
26+
" +
27+
failures.first(3).join("\n")
2728
end
2829
end

0 commit comments

Comments
 (0)