mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update to ruby/spec@ccf0d85
This commit is contained in:
parent
afcbb501ac
commit
b9f34062f0
28 changed files with 692 additions and 31 deletions
20
spec/ruby/core/string/shared/strip.rb
Normal file
20
spec/ruby/core/string/shared/strip.rb
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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
|
||||
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
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue