Changeset 8459
- Timestamp:
- 12/21/07 11:21:20 (2 years ago)
- Files:
-
- trunk/activesupport/lib/active_support/multibyte/chars.rb (modified) (1 diff)
- trunk/activesupport/Rakefile (modified) (1 diff)
- trunk/activesupport/test/multibyte_chars_test.rb (modified) (2 diffs)
- trunk/activesupport/test/multibyte_conformance.rb (modified) (1 diff)
- trunk/activesupport/test/multibyte_handler_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/lib/active_support/multibyte/chars.rb
r8402 r8459 126 126 else 127 127 def utf8_pragma? 128 !@string.nil? && (Encoding.default_external == Encoding::UTF_8)128 false 129 129 end 130 130 end trunk/activesupport/Rakefile
r8438 r8459 17 17 task :default => :test 18 18 Rake::TestTask.new { |t| 19 t.libs << "test" 19 20 t.pattern = 'test/**/*_test.rb' 20 21 t.verbose = true trunk/activesupport/test/multibyte_chars_test.rb
r7273 r8459 1 require File.dirname(__FILE__) + '/abstract_unit'1 require 'abstract_unit' 2 2 3 $KCODE = 'UTF8' 3 $KCODE = 'UTF8' if RUBY_VERSION < '1.9' 4 4 5 5 class CharsTest < Test::Unit::TestCase … … 86 86 end 87 87 end 88 88 89 89 def test_pragma 90 with_kcode('UTF8') do 91 assert " ".chars.send(:utf8_pragma?), "UTF8 pragma should be on because KCODE is UTF8" 92 end 93 with_kcode('none') do 94 assert !" ".chars.send(:utf8_pragma?), "UTF8 pragma should be off" 90 if RUBY_VERSION < '1.9' 91 with_kcode('UTF8') do 92 assert " ".chars.send(:utf8_pragma?), "UTF8 pragma should be on because KCODE is UTF8" 93 end 94 with_kcode('none') do 95 assert !" ".chars.send(:utf8_pragma?), "UTF8 pragma should be off because KCODE is not UTF8" 96 end 97 else 98 assert !" ".chars.send(:utf8_pragma?), "UTF8 pragma should be off in Ruby 1.9" 95 99 end 96 100 end 97 101 98 102 def test_handler_setting 99 103 handler = ''.chars.handler trunk/activesupport/test/multibyte_conformance.rb
r8365 r8459 1 require File.dirname(__FILE__) + '/abstract_unit'1 require 'abstract_unit' 2 2 require 'open-uri' 3 3 4 $KCODE = 'UTF8' 4 $KCODE = 'UTF8' if RUBY_VERSION < '1.9' 5 5 6 UNIDATA_URL = "http://www.unicode.org/Public/#{ActiveSupport::Multibyte::UNICODE_VERSION}/ucd" 6 7 UNIDATA_FILE = '/NormalizationTest.txt' trunk/activesupport/test/multibyte_handler_test.rb
r8301 r8459 1 require File.dirname(__FILE__) + '/abstract_unit'2 3 $KCODE = 'UTF8' 1 require 'abstract_unit' 2 3 $KCODE = 'UTF8' if RUBY_VERSION < '1.9' 4 4 5 5 class String