Skip to content

Commit

Permalink
Update NATFIXME blocks for macos specific behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
herwinw committed Jul 9, 2024
1 parent 829ec1f commit a675d3c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
24 changes: 14 additions & 10 deletions spec/core/io/lineno_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@
end

it "raises an IOError on a duplexed stream with the read side closed" do
NATFIXME 'Support "r+" access mode', exception: Errno::EINVAL do
cmd = platform_is(:windows) ? 'rem' : 'cat'
IO.popen(cmd, 'r+') do |p|
p.close_read
-> { p.lineno }.should raise_error(IOError)
NATFIXME 'Support "r+" access mode', condition: !RUBY_PLATFORM.include?('darwin'), exception: Errno::EINVAL do
NATFIXME 'Implement IO#close_read', condition: RUBY_PLATFORM.include?('darwin'), exception: NoMethodError, message: "undefined method `close_read' for an instance of IO" do
cmd = platform_is(:windows) ? 'rem' : 'cat'
IO.popen(cmd, 'r+') do |p|
p.close_read
-> { p.lineno }.should raise_error(IOError)
end
end
end
end
Expand Down Expand Up @@ -73,11 +75,13 @@
end

it "raises an IOError on a duplexed stream with the read side closed" do
NATFIXME 'Support "r+" access mode', exception: Errno::EINVAL do
cmd = platform_is(:windows) ? 'rem' : 'cat'
IO.popen(cmd, 'r+') do |p|
p.close_read
-> { p.lineno = 0 }.should raise_error(IOError)
NATFIXME 'Support "r+" access mode', condition: !RUBY_PLATFORM.include?('darwin'), exception: Errno::EINVAL do
NATFIXME 'Implement IO#close_read', condition: RUBY_PLATFORM.include?('darwin'), exception: NoMethodError, message: "undefined method `close_read' for an instance of IO" do
cmd = platform_is(:windows) ? 'rem' : 'cat'
IO.popen(cmd, 'r+') do |p|
p.close_read
-> { p.lineno = 0 }.should raise_error(IOError)
end
end
end
end
Expand Down
3 changes: 2 additions & 1 deletion spec/core/io/popen_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
@io.read.should == "foo\n"
end

it "sees an infinitely looping subprocess exit when read pipe is closed" do
# NATFIXME: Infinite loop/timeout on macos
xit "sees an infinitely looping subprocess exit when read pipe is closed" do
io = IO.popen ruby_cmd('r = loop{puts "y"; 0} rescue 1; exit r'), 'r'
io.close

Expand Down

0 comments on commit a675d3c

Please sign in to comment.