Skip to content

Commit

Permalink
Add message matchers for exception specs in IO#pwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
herwinw committed Oct 28, 2023
1 parent c31bcdf commit d3a3f56
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/io/pwrite_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@

it "raises IOError when file is not open in write mode" do
File.open(@fname, "r") do |file|
-> { file.pwrite("foo", 1) }.should raise_error(IOError)
-> { file.pwrite("foo", 1) }.should raise_error(IOError, "not opened for writing")
end
end

it "raises IOError when file is closed" do
file = File.open(@fname, "w+")
file.close
-> { file.pwrite("foo", 1) }.should raise_error(IOError)
-> { file.pwrite("foo", 1) }.should raise_error(IOError, "closed stream")
end

it "raises a NoMethodError if object does not respond to #to_s" do
Expand Down

0 comments on commit d3a3f56

Please sign in to comment.