Sha256: 9c1417cb4b5b3ca6ac08dc0bc44826c28902cc462d4d4b60bce08c0b9fe5633d

Contents?: true

Size: 721 Bytes

Versions: 1

Compression:

Stored size: 721 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe "Ruby 1.8 Extensions" do
  
  describe "string ascii detection" do
    it "should say it is US-ASCII only if it is" do
      "abc".should be_ascii_only
    end
    
    it "should not say it is US-ASCII only if it isn't" do
      "かきくけこ".should_not be_ascii_only
    end
    
    it "should not say it is US-ASCII only if it is a mix" do
      "abcかきくけこ123".should_not be_ascii_only
    end
    
    it "should handle edge cases" do
      ["\x00", "\x01", "\x40", "\x7f", "\x73"].each do |str|
        str.should be_ascii_only
      end

      ["\x81", "\x99", "\xFF"].each do |str|
        str.should_not be_ascii_only
      end

    end
  end
end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rack-mail_exception-0.0.1 vendor/mail/spec/mail/version_specific/escape_paren_1_8_spec.rb