diff options
Diffstat (limited to 'spec/ruby/core/string/chop_spec.rb')
-rw-r--r-- | spec/ruby/core/string/chop_spec.rb | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/spec/ruby/core/string/chop_spec.rb b/spec/ruby/core/string/chop_spec.rb index 9b4e7363c6..99c2c82190 100644 --- a/spec/ruby/core/string/chop_spec.rb +++ b/spec/ruby/core/string/chop_spec.rb @@ -1,4 +1,5 @@ # -*- encoding: utf-8 -*- +# frozen_string_literal: false require_relative '../../spec_helper' require_relative 'fixtures/classes' @@ -49,28 +50,12 @@ describe "String#chop" do s.chop.should_not equal(s) end - ruby_version_is ''...'2.7' do - it "taints result when self is tainted" do - "hello".taint.chop.should.tainted? - "".taint.chop.should.tainted? - end - - it "untrusts result when self is untrusted" do - "hello".untrust.chop.should.untrusted? - "".untrust.chop.should.untrusted? - end - end - - ruby_version_is ''...'3.0' do - it "returns subclass instances when called on a subclass" do - StringSpecs::MyString.new("hello\n").chop.should be_an_instance_of(StringSpecs::MyString) - end + it "returns String instances when called on a subclass" do + StringSpecs::MyString.new("hello\n").chop.should be_an_instance_of(String) end - ruby_version_is '3.0' do - it "returns String instances when called on a subclass" do - StringSpecs::MyString.new("hello\n").chop.should be_an_instance_of(String) - end + it "returns a String in the same encoding as self" do + "abc\n\n".encode("US-ASCII").chop.encoding.should == Encoding::US_ASCII end end |