Sha256: 42a768f9921466a5b1674955601e6927e45c2a387cf0e6a7c351c8cb47d0f8c0

Contents?: true

Size: 722 Bytes

Versions: 2

Compression:

Stored size: 722 Bytes

Contents

# -*- coding: UTF-8 -*-

require 'spec_helper'

describe 'persian character methods' do
  it 'should return unicode character from codepoint hex' do
    codepoint = 0x062B
    char = 'ث'

    expect(Persian::Unicode.codepoint_to_char(codepoint)).to eq(char)
  end

  it 'should return text between RIGHT-TO-LETF EMBEDDING(U+202B) and Pop Directional Format(U+202C)' do
    before = 'مست+'
    after = '‫مست+‬'
    expect(Persian::Unicode.rle(before)).to eq(after)
  end

  it 'should text between return LETF-TO-RIGHT EMBEDDING(U+202A) and Pop Directional Format(U+202C)' do
    before = 'من c++ بلدم'
    after = '‪من c++ بلدم‬'

    expect(Persian::Unicode.lre(before)).to eq(after)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
persian-0.2.2 spec/unicode_spec.rb
persian-0.2.1 spec/unicode_spec.rb