diff options
Diffstat (limited to 'spec/ruby/core/io/shared/pos.rb')
-rw-r--r-- | spec/ruby/core/io/shared/pos.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/spec/ruby/core/io/shared/pos.rb b/spec/ruby/core/io/shared/pos.rb index d83a6c6692..3fdd3eb2b3 100644 --- a/spec/ruby/core/io/shared/pos.rb +++ b/spec/ruby/core/io/shared/pos.rb @@ -60,7 +60,13 @@ describe :io_set_pos, shared: true do end end - it "does not accept Integers that don't fit in a C long" do + it "raises TypeError when cannot convert implicitly argument to Integer" do + File.open @fname do |io| + -> { io.send @method, Object.new }.should raise_error(TypeError, "no implicit conversion of Object into Integer") + end + end + + it "does not accept Integers that don't fit in a C off_t" do File.open @fname do |io| -> { io.send @method, 2**128 }.should raise_error(RangeError) end |