File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ RSpec . describe Interscript ::Detector do
2+ it "should return valid data when map_pattern is selected and multiple is true" do
3+ out = Interscript . detect (
4+ "привет" , "privet" ,
5+ map_pattern : "icao-ukr-*" ,
6+ multiple : true ,
7+ compiler : Interscript ::Compiler ::Ruby
8+ )
9+ expected = { "icao-ukr-Cyrl-Latn-9303" => 1.0 }
10+ expect ( out ) . to eq ( expected )
11+ end
12+
13+ it "should return valid data when map_pattern isn't selected and multiple is false" do
14+ out = Interscript . detect ( "привет" , "privet" , compiler : Interscript ::Compiler ::Ruby )
15+ expect ( out ) . to be_a ( String )
16+ end
17+
18+ it "should return valid data when map_pattern isn't selected and multiple is true" do
19+ out = Interscript . detect (
20+ "привет" , "privet" ,
21+ multiple : true ,
22+ compiler : Interscript ::Compiler ::Ruby ,
23+ )
24+ expect ( out ) . to be_a ( Hash )
25+ expect ( out . keys . all? { |i | i . class == String } ) . to be true
26+ expect ( out . values . all? { |i | Numeric === i } ) . to be true
27+ end
28+ end
You can’t perform that action at this time.
0 commit comments