From 004db18cb0f690486336f0fa141ad383c79f9558 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Mon, 9 Nov 2009 21:27:58 +0100 Subject: String#bytesize is not needed for Ruby >= 1.8.7 --- activesupport/test/core_ext/string_ext_test.rb | 7 ------- 1 file changed, 7 deletions(-) (limited to 'activesupport/test/core_ext/string_ext_test.rb') diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb index 584a41b631..0f988e78a4 100644 --- a/activesupport/test/core_ext/string_ext_test.rb +++ b/activesupport/test/core_ext/string_ext_test.rb @@ -350,13 +350,6 @@ class TestGetTextString < Test::Unit::TestCase end end -class StringBytesizeTest < Test::Unit::TestCase - def test_bytesize - assert_respond_to 'foo', :bytesize - assert_equal 3, 'foo'.bytesize - end -end - class OutputSafetyTest < ActiveSupport::TestCase def setup @string = "hello" -- cgit v1.2.3 From c0bb4c6ed2f5a5676569746e7bfd70405346ef8f Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Mon, 9 Nov 2009 21:35:43 +0100 Subject: String#start_with? and String#end_with? are not needed for Ruby >= 1.8.7, leaves their plural aliases though --- activesupport/test/core_ext/string_ext_test.rb | 8 -------- 1 file changed, 8 deletions(-) (limited to 'activesupport/test/core_ext/string_ext_test.rb') diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb index 0f988e78a4..dd9e9e0ebb 100644 --- a/activesupport/test/core_ext/string_ext_test.rb +++ b/activesupport/test/core_ext/string_ext_test.rb @@ -185,17 +185,9 @@ class StringInflectionsTest < Test::Unit::TestCase assert s.starts_with?('hel') assert !s.starts_with?('el') - assert s.start_with?('h') - assert s.start_with?('hel') - assert !s.start_with?('el') - assert s.ends_with?('o') assert s.ends_with?('lo') assert !s.ends_with?('el') - - assert s.end_with?('o') - assert s.end_with?('lo') - assert !s.end_with?('el') end def test_string_squish -- cgit v1.2.3 From b6598c683bb8f8ef484f54755cced77a5d6200bb Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Mon, 9 Nov 2009 21:39:32 +0100 Subject: String#each_char is not needed for Ruby >= 1.8.7 --- activesupport/test/core_ext/string_ext_test.rb | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'activesupport/test/core_ext/string_ext_test.rb') diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb index dd9e9e0ebb..ffcd086716 100644 --- a/activesupport/test/core_ext/string_ext_test.rb +++ b/activesupport/test/core_ext/string_ext_test.rb @@ -206,17 +206,6 @@ class StringInflectionsTest < Test::Unit::TestCase # And changes the original string: assert_equal original, expected end - - if RUBY_VERSION < '1.9' - def test_each_char_with_utf8_string_when_kcode_is_utf8 - with_kcode('UTF8') do - '€2.99'.each_char do |char| - assert_not_equal 1, char.length - break - end - end - end - end end class StringBehaviourTest < Test::Unit::TestCase -- cgit v1.2.3 From eeac054d59dd9373313596dc3ef9db30c4b227d5 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Mon, 9 Nov 2009 16:57:10 -0800 Subject: Fix missing dependency --- activesupport/test/core_ext/string_ext_test.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'activesupport/test/core_ext/string_ext_test.rb') diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb index ffcd086716..1e8a1c4f08 100644 --- a/activesupport/test/core_ext/string_ext_test.rb +++ b/activesupport/test/core_ext/string_ext_test.rb @@ -5,6 +5,7 @@ require 'inflector_test_cases' require 'active_support/core_ext/string' require 'active_support/core_ext/time' +require 'active_support/core_ext/kernel/reporting' class StringInflectionsTest < Test::Unit::TestCase include InflectorTestCases -- cgit v1.2.3 From 7eb4f2ecc53831d850682d88634ccf41676e40a2 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 14 Nov 2009 01:13:54 -0800 Subject: Consolidate date & time landscape: require 'active_support/time' --- activesupport/test/core_ext/string_ext_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/test/core_ext/string_ext_test.rb') diff --git a/activesupport/test/core_ext/string_ext_test.rb b/activesupport/test/core_ext/string_ext_test.rb index 1e8a1c4f08..56ed296dac 100644 --- a/activesupport/test/core_ext/string_ext_test.rb +++ b/activesupport/test/core_ext/string_ext_test.rb @@ -4,7 +4,7 @@ require 'abstract_unit' require 'inflector_test_cases' require 'active_support/core_ext/string' -require 'active_support/core_ext/time' +require 'active_support/time' require 'active_support/core_ext/kernel/reporting' class StringInflectionsTest < Test::Unit::TestCase -- cgit v1.2.3