Skip to content

Commit 3656138

Browse files
committed
Update test string comparison method
1 parent 8b544b4 commit 3656138

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/interscript.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def transliterate(system_code, string)
6464
end
6565
end
6666

67-
output.unicode_normalize
67+
output ? output.unicode_normalize : output
6868
end
6969

7070
private

spec/interscript_spec.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99

1010
system["tests"]&.reduce([]) do |testresults, test|
1111
it "test for #{test}" do
12-
result = Interscript.transliterate system_name, test["source"]
13-
expect(result.unicode_normalize).to eq(test["expected"].unicode_normalize)
12+
result = Interscript.transliterate(system_name, test["source"]) || ""
13+
expected = (test["expected"] || "").unicode_normalize
14+
15+
expect(result).to eq(expected)
1416
end
1517
end
1618
end

0 commit comments

Comments
 (0)