summaryrefslogtreecommitdiff
path: root/spec/ruby/core/io/eof_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2020-05-03 12:28:29 +0200
committerBenoit Daloze <eregontp@gmail.com>2020-05-03 12:28:29 +0200
commit5aaa75e7c1f4b7912c10ffdcb1cac581e20eda39 (patch)
treee1694f5a4a5558884b1b8f3890b186793e5e982f /spec/ruby/core/io/eof_spec.rb
parentf646d20aaeb8f02bcd3d0c5c3f5a372da654502a (diff)
Update to ruby/spec@032ee74
Diffstat (limited to 'spec/ruby/core/io/eof_spec.rb')
-rw-r--r--spec/ruby/core/io/eof_spec.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/spec/ruby/core/io/eof_spec.rb b/spec/ruby/core/io/eof_spec.rb
index 8fd3c37132..315345d942 100644
--- a/spec/ruby/core/io/eof_spec.rb
+++ b/spec/ruby/core/io/eof_spec.rb
@@ -12,7 +12,7 @@ describe "IO#eof?" do
end
it "returns true on an empty stream that has just been opened" do
- File.open(@name) { |empty| empty.eof?.should == true }
+ File.open(@name) { |empty| empty.should.eof? }
end
it "raises IOError on stream not opened for reading" do
@@ -34,35 +34,35 @@ describe "IO#eof?" do
it "returns false when not at end of file" do
@io.read 1
- @io.eof?.should == false
+ @io.should_not.eof?
end
it "returns true after reading with read with no parameters" do
@io.read()
- @io.eof?.should == true
+ @io.should.eof?
end
it "returns true after reading with read" do
@io.read(File.size(@name))
- @io.eof?.should == true
+ @io.should.eof?
end
it "returns true after reading with sysread" do
@io.sysread(File.size(@name))
- @io.eof?.should == true
+ @io.should.eof?
end
it "returns true after reading with readlines" do
@io.readlines
- @io.eof?.should == true
+ @io.should.eof?
end
it "returns false on just opened non-empty stream" do
- @io.eof?.should == false
+ @io.should_not.eof?
end
it "does not consume the data from the stream" do
- @io.eof?.should == false
+ @io.should_not.eof?
@io.getc.should == 'V'
end
@@ -78,7 +78,7 @@ describe "IO#eof?" do
it "returns true on one-byte stream after single-byte read" do
File.open(File.dirname(__FILE__) + '/fixtures/one_byte.txt') { |one_byte|
one_byte.read(1)
- one_byte.eof?.should == true
+ one_byte.should.eof?
}
end
end
@@ -92,16 +92,16 @@ describe "IO#eof?" do
it "returns true on receiving side of Pipe when writing side is closed" do
@r, @w = IO.pipe
@w.close
- @r.eof?.should == true
+ @r.should.eof?
end
it "returns false on receiving side of Pipe when writing side wrote some data" do
@r, @w = IO.pipe
@w.puts "hello"
- @r.eof?.should == false
+ @r.should_not.eof?
@w.close
- @r.eof?.should == false
+ @r.should_not.eof?
@r.read
- @r.eof?.should == true
+ @r.should.eof?
end
end