Sha256: ad082a86403fc106a806b7f8077697aa51f8ba2a20fa230110a1d48c4dcde668

Contents?: true

Size: 947 Bytes

Versions: 25

Compression:

Stored size: 947 Bytes

Contents

#encoding: UTF-8
require File.dirname(__FILE__) + '/spec_helper'

describe Twitter::Unicode do

  it "should lazy-init constants" do
    Twitter::Unicode.const_defined?(:UFEB6).should == false
    Twitter::Unicode::UFEB6.should_not be_nil
    Twitter::Unicode::UFEB6.should be_kind_of(String)
    Twitter::Unicode.const_defined?(:UFEB6).should == true
  end

  it "should return corresponding character" do
    Twitter::Unicode::UFEB6.should == [0xfeb6].pack('U')
  end

  it "should allow lowercase notation" do
    Twitter::Unicode::Ufeb6.should == Twitter::Unicode::UFEB6
    Twitter::Unicode::Ufeb6.should === Twitter::Unicode::UFEB6
  end

  it "should allow underscore notation" do
    Twitter::Unicode::U_FEB6.should == Twitter::Unicode::UFEB6
    Twitter::Unicode::U_FEB6.should === Twitter::Unicode::UFEB6
  end

  it "should raise on invalid codepoints" do
    lambda { Twitter::Unicode::FFFFFF }.should raise_error(NameError)
  end

end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
twitter-text-1.4.11 spec/unicode_spec.rb
twitter-text-1.4.10 spec/unicode_spec.rb
twitter-text-1.4.9 spec/unicode_spec.rb
twitter-text-1.4.8 spec/unicode_spec.rb
twitter-text-1.4.7 spec/unicode_spec.rb
twitter-text-1.4.6 spec/unicode_spec.rb
twitter-text-1.4.5 spec/unicode_spec.rb
twitter-text-1.3.4 spec/unicode_spec.rb
twitter-text-1.3.3 spec/unicode_spec.rb
twitter-text-1.3.2 spec/unicode_spec.rb
twitter-text-1.4.2 spec/unicode_spec.rb
twitter-text-1.4.1 spec/unicode_spec.rb
twitter-text-1.3.1 spec/unicode_spec.rb
twitter-text-1.3.0 spec/unicode_spec.rb
twitter-text-1.2.5 spec/unicode_spec.rb
twitter-text-1.2.4 spec/unicode_spec.rb
twitter-text-1.2.3 spec/unicode_spec.rb
twitter-text-1.2.2 spec/unicode_spec.rb
twitter-text-1.2.1 spec/unicode_spec.rb
twitter-text-1.2.0 spec/unicode_spec.rb