Skip to content

Instantly share code, notes, and snippets.

@vvs
Created March 14, 2010 09:28
Show Gist options
  • Save vvs/331883 to your computer and use it in GitHub Desktop.
Save vvs/331883 to your computer and use it in GitHub Desktop.
it "raises an Errno::EINVAL if the new mode is not compatible with the descriptor's current mode" do
# if the next line *succeeds* in creating an IO for some reason (bug or behavior change in 1.9)
# all the rest of the specs will fail!
lambda { IO.send(@method, @fd, "r") }.should raise_error(Errno::EINVAL)
IO.new(@fd, "w").close
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment