Skip to content

Commit ff49207

Browse files
eregonAndrii Konchyn
authored andcommitted
Improve IO::Buffer specs
1 parent e2b77c2 commit ff49207

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

core/io/buffer/for_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
buffer.get_string.should == @string.b
6767

6868
buffer.should_not.readonly?
69+
buffer.should_not.locked?
6970

7071
buffer.set_string("ghost shell")
7172
@string.should == "ghost shellg"

core/io/buffer/map_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def open_big_file_fixture
7373
@buffer.should.valid?
7474
end
7575

76-
platform_is_not :windows, :openbsd do
76+
guard -> { Process.respond_to?(:fork) } do
7777
it "is shareable across processes" do
7878
file_name = tmp("shared_buffer")
7979
@file = File.open(file_name, "w+")
@@ -312,7 +312,7 @@ def open_big_file_fixture
312312
@file.read.should == "abcâdef\n".b
313313
end
314314

315-
platform_is_not :windows do
315+
guard -> { Process.respond_to?(:fork) } do
316316
it "is not shared across processes" do
317317
file_name = tmp("shared_buffer")
318318
@file = File.open(file_name, "w+")

core/io/buffer/transfer_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,9 @@
9191
context "with a slice of a buffer" do
9292
it "transfers source to a new slice, not touching the buffer" do
9393
@buffer = IO::Buffer.new(4)
94-
slice = @buffer.slice(0, 2)
9594
@buffer.set_string("test")
95+
slice = @buffer.slice(0, 2)
96+
slice.get_string.should == "te"
9697

9798
new_slice = slice.transfer
9899
slice.null?.should == true

0 commit comments

Comments
 (0)