Permalink
Browse files

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
  • Loading branch information...
1 parent 2a9ad9c commit 25db1fc2014905d00795231dab2068f7a3497b04 @jeremy jeremy committed Jan 4, 2008
Showing with 14 additions and 12 deletions.
  1. +14 −12 activerecord/test/base_test.rb
@@ -1229,19 +1229,21 @@ def test_quote
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

0 comments on commit 25db1fc

Please sign in to comment.