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-3.0.2/spec/ruby/library/stringio/getc_spec.rb
require_relative '../../spec_helper'
require 'stringio'
require_relative 'shared/getc'

describe "StringIO#getc" do
  it_behaves_like :stringio_getc, :getc

  it "returns the character at the current position" do
    io = StringIO.new("example")

    io.getc.should == ?e
    io.getc.should == ?x
    io.getc.should == ?a
  end
end

describe "StringIO#getc when self is not readable" do
  it_behaves_like :stringio_getc_not_readable, :getc
end