HEX
Server: Apache
System: Linux s198.coreserver.jp 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC 2025 x86_64
User: nagasaki (10062)
PHP: 7.1.33
Disabled: NONE
Upload Files
File: //usr/local/rvm/src/ruby-2.7.4/spec/ruby/core/string/shared/grapheme_clusters.rb
require_relative '../../../spec_helper'
require_relative '../fixtures/classes'

describe :string_grapheme_clusters, shared: true do
  it "passes each grapheme cluster in self to the given block" do
    a = []
    # test string: abc[rainbow flag emoji][paw prints]
    "ab\u{1f3f3}\u{fe0f}\u{200d}\u{1f308}\u{1F43E}".send(@method) { |c| a << c }
    a.should == ['a', 'b', "\u{1f3f3}\u{fe0f}\u{200d}\u{1f308}", "\u{1F43E}"]
  end

  it "returns self" do
    s = StringSpecs::MyString.new "ab\u{1f3f3}\u{fe0f}\u{200d}\u{1f308}\u{1F43E}"
    s.send(@method) {}.should equal(s)
  end
end