aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/library/stringio/closed_read_spec.rb
blob: 971eb5f71c75ce496595249637172448c9c447fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
require File.expand_path('../../../spec_helper', __FILE__)
require File.expand_path('../fixtures/classes', __FILE__)

describe "StringIO#closed_read?" do
  it "returns true if self is not readable" do
    io = StringIO.new("example", "r+")
    io.close_write
    io.closed_read?.should be_false
    io.close_read
    io.closed_read?.should be_true
  end
end