File tree Expand file tree Collapse file tree 2 files changed +35
-1
lines changed
Expand file tree Collapse file tree 2 files changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ def close
3535 return if closed?
3636
3737 begin
38- flush
38+ self . flush
3939 rescue
4040 # We really can't do anything here unless we want #close to raise exceptions.
4141 ensure
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ # Released under the MIT License.
4+ # Copyright, 2025, by Samuel Williams.
5+
6+ require "io/stream/generic"
7+
8+ describe IO ::Stream ::Generic do
9+ let ( :stream ) { subject . new }
10+
11+ with "#closed?" do
12+ it "should return false by default" do
13+ expect ( stream . closed? ) . to be_falsey
14+ end
15+ end
16+
17+ with "#read" do
18+ it "should raise NotImplementedError" do
19+ expect { stream . read ( 10 ) } . to raise_exception ( NotImplementedError )
20+ end
21+ end
22+
23+ with "#flush" do
24+ it "should raise NotImplementedError" do
25+ expect { stream . write ( "hello" ) ; stream . flush } . to raise_exception ( NotImplementedError )
26+ end
27+ end
28+
29+ with "#close" do
30+ it "should raise NotImplementedError" do
31+ expect { stream . close } . to raise_exception ( NotImplementedError )
32+ end
33+ end
34+ end
You can’t perform that action at this time.
0 commit comments