summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/scan_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/scan_spec.rb')
-rw-r--r--spec/ruby/core/string/scan_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/ruby/core/string/scan_spec.rb b/spec/ruby/core/string/scan_spec.rb
index 024e97022a..5f86dbbecc 100644
--- a/spec/ruby/core/string/scan_spec.rb
+++ b/spec/ruby/core/string/scan_spec.rb
@@ -198,4 +198,12 @@ describe "String#scan with pattern and block" do
third.should == 'c';
end
end
+
+ ruby_version_is '3.0' do
+ it "yields String instances for subclasses" do
+ a = []
+ StringSpecs::MyString.new("abc").scan(/./) { |s| a << s.class }
+ a.should == [String, String, String]
+ end
+ end
end