Sha256: 9923adc02e92d98e4bf253ba72263506badca95ce7a1095fa1b60ca2a6768590

Contents?: true

Size: 1.04 KB

Versions: 2

Compression:

Stored size: 1.04 KB

Contents

# encoding: utf-8
require 'spec_helper'

describe Zh do

  it "Should retun zh-tw" do
    expect(Zh.to_tw('面包')).to eq '麵包'
    expect(Zh.to_tw('本壘打')).to eq '全壘打'
    expect(Zh.to_tw('本垒打')).to eq '全壘打'
  end

  it "Should return zh-hk" do
    expect(Zh.to_hk('面包')).to eq '麵包'
    expect(Zh.to_hk('寮国')).to eq '老撾'
    expect(Zh.to_hk('老撾')).to eq '老撾'
    expect(Zh.to_hk('老挝')).to eq '老撾'
  end

  it "Should return zh-sg" do
    expect(Zh.to_sg('新西蘭')).to eq '纽西兰'
    expect(Zh.to_sg('即食麵')).to eq '快速面'
    expect(Zh.to_sg('速食麵')).to eq '快速面'
    expect(Zh.to_sg('泡麵')).to eq '快速面'
    expect(Zh.to_sg('方便面')).to eq '快速面'
  end

  it 'Should return zh-cn' do
    expect(Zh.to_cn('冰淇淋')).to eq '冰激凌'
    expect(Zh.to_cn('印表機')).to eq '打印机'
    expect(Zh.to_cn('打印機')).to eq '打印机'
  end

  it "should create an json file and put latest json in it" do
    expect(Zh.update_data).to eq true
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
zh-0.1.0 spec/zh_spec.rb
zh-0.0.1 spec/zh_spec.rb