aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/base_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-01-04 03:19:20 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2008-01-04 03:19:20 +0000
commit25db1fc2014905d00795231dab2068f7a3497b04 (patch)
tree8785873adb2ab165569e8701c30c11e8ec844d9d /activerecord/test/base_test.rb
parent2a9ad9ccbc706e546bf02ec95f864944e7d7983b (diff)
downloadrails-25db1fc2014905d00795231dab2068f7a3497b04.tar.gz
rails-25db1fc2014905d00795231dab2068f7a3497b04.tar.bz2
rails-25db1fc2014905d00795231dab2068f7a3497b04.zip
Ruby 1.9 compat: test multibyte chars proxy for 1.8 only
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8553 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/base_test.rb')
-rwxr-xr-xactiverecord/test/base_test.rb26
1 files changed, 14 insertions, 12 deletions
diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb
index 7ea21156f1..5f8f1537d9 100755
--- a/activerecord/test/base_test.rb
+++ b/activerecord/test/base_test.rb
@@ -1229,19 +1229,21 @@ class BasicsTest < Test::Unit::TestCase
topic = Topic.create('author_name' => author_name)
assert_equal author_name, Topic.find(topic.id).author_name
end
-
- def test_quote_chars
- str = 'The Narrator'
- topic = Topic.create(:author_name => str)
- assert_equal str, topic.author_name
-
- assert_kind_of ActiveSupport::Multibyte::Chars, str.chars
- topic = Topic.find_by_author_name(str.chars)
-
- assert_kind_of Topic, topic
- assert_equal str, topic.author_name, "The right topic should have been found by name even with name passed as Chars"
+
+ if RUBY_VERSION < '1.9'
+ def test_quote_chars
+ str = 'The Narrator'
+ topic = Topic.create(:author_name => str)
+ assert_equal str, topic.author_name
+
+ assert_kind_of ActiveSupport::Multibyte::Chars, str.chars
+ topic = Topic.find_by_author_name(str.chars)
+
+ assert_kind_of Topic, topic
+ assert_equal str, topic.author_name, "The right topic should have been found by name even with name passed as Chars"
+ end
end
-
+
def test_class_level_destroy
should_be_destroyed_reply = Reply.create("title" => "hello", "content" => "world")
Topic.find(1).replies << should_be_destroyed_reply