Sha256: f2734ed362cd3d1d1aa5c2e7d8c28382cb7a56dc8a4d45f8eefc756fb0927e18
Contents?: true
Size: 1.05 KB
Versions: 20
Compression:
Stored size: 1.05 KB
Contents
require 'spec_helper' describe PragmaticSegmenter::Languages do describe '.get_language_by_code' do context "when language code defined" do PragmaticSegmenter::Languages::LANGUAGE_CODES.each do |code, lang| it "returns '#{lang}' for '#{code}'" do expect(described_class.get_language_by_code(code)).to eql(lang) end end end context "when language code not defined" do it "returns 'PragmaticSegmenter::Languages::Common'" do expect(described_class.get_language_by_code('xxyyzz')).to eql(PragmaticSegmenter::Languages::Common) end end context "when language code empty string" do it "returns 'PragmaticSegmenter::Languages::Common'" do expect(described_class.get_language_by_code('')).to eql(PragmaticSegmenter::Languages::Common) end end context "when language code nil" do it "returns 'PragmaticSegmenter::Languages::Common'" do expect(described_class.get_language_by_code(nil)).to eql(PragmaticSegmenter::Languages::Common) end end end end
Version data entries
20 entries across 20 versions & 1 rubygems