summaryrefslogtreecommitdiff
path: root/spec/ruby/core/string/shared/strip.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/string/shared/strip.rb')
-rw-r--r--spec/ruby/core/string/shared/strip.rb18
1 files changed, 6 insertions, 12 deletions
diff --git a/spec/ruby/core/string/shared/strip.rb b/spec/ruby/core/string/shared/strip.rb
index 9c232b4694..39c7232ff9 100644
--- a/spec/ruby/core/string/shared/strip.rb
+++ b/spec/ruby/core/string/shared/strip.rb
@@ -2,19 +2,13 @@ require_relative '../../../spec_helper'
require_relative '../fixtures/classes'
describe :string_strip, shared: true do
- ruby_version_is '3.0' do
- it "returns String instances when called on a subclass" do
- StringSpecs::MyString.new(" hello ").send(@method).should be_an_instance_of(String)
- StringSpecs::MyString.new(" ").send(@method).should be_an_instance_of(String)
- StringSpecs::MyString.new("").send(@method).should be_an_instance_of(String)
- end
+ it "returns a String in the same encoding as self" do
+ " hello ".encode("US-ASCII").send(@method).encoding.should == Encoding::US_ASCII
end
- ruby_version_is ''...'3.0' do
- it "returns subclass instances when called on a subclass" do
- StringSpecs::MyString.new(" hello ").send(@method).should be_an_instance_of(StringSpecs::MyString)
- StringSpecs::MyString.new(" ").send(@method).should be_an_instance_of(StringSpecs::MyString)
- StringSpecs::MyString.new("").send(@method).should be_an_instance_of(StringSpecs::MyString)
- end
+ it "returns String instances when called on a subclass" do
+ StringSpecs::MyString.new(" hello ").send(@method).should.instance_of?(String)
+ StringSpecs::MyString.new(" ").send(@method).should.instance_of?(String)
+ StringSpecs::MyString.new("").send(@method).should.instance_of?(String)
end
end
ass='logmsg'> char_is_identifier_start() and char_is_identifier_utf8() * This is also faster than calling pm_encoding_utf_8_alpha_char/pm_encoding_utf_8_alnum_char as those compute the character width and do extra checks. https://github.com/ruby/prism/commit/4cb276ac4c 2024-01-11[ruby/prism] Exclude encodings that are dynamicKevin Newton https://github.com/ruby/prism/commit/6749146c0e 2023-12-06[ruby/prism] Update documentation for encodingsKevin Newton https://github.com/ruby/prism/commit/18e6df0d4f 2023-12-06[ruby/prism] Provide flags for changing encodingsKevin Newton https://github.com/ruby/prism/commit/e838eaff6f 2023-11-30[ruby/prism] Document remaining encodingsKevin Newton https://github.com/ruby/prism/commit/b9510aed40 2023-11-30[ruby/prism] Group encodings into a single arrayKevin Newton https://github.com/ruby/prism/commit/f4b7beadc9 2023-11-30[ruby/prism] Do not expose encodings that do not need to be exposedKevin Newton https://github.com/ruby/prism/commit/c52c7f37ea 2023-11-30[ruby/prism] Remove public ASCII functions that can now be staticKevin Newton https://github.com/ruby/prism/commit/9461384b0c 2023-11-30[PRISM] Consolidate prism encoding filesKevin Newton