summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string')
-rw-r--r--spec/ruby/core/string/split_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/ruby/core/string/split_spec.rb b/spec/ruby/core/string/split_spec.rb
index b89a28c149..b451921c66 100644
--- a/spec/ruby/core/string/split_spec.rb
+++ b/spec/ruby/core/string/split_spec.rb
@@ -411,5 +411,17 @@ describe "String#split with Regexp" do
returned_object.should == "chunky bacon"
a.should == ["Chunky", "Bacon"]
end
+
+ describe "for a String subclass" do
+ a = []
+ StringSpecs::MyString.new("a|b").split("|") { |str| a << str }
+ first, last = a
+
+ first.should be_an_instance_of(StringSpecs::MyString)
+ first.should == "a"
+
+ last.should be_an_instance_of(StringSpecs::MyString)
+ last.should == "b"
+ end
end
end