diff options
Diffstat (limited to 'spec/ruby/core/io/shared/binwrite.rb')
| -rw-r--r-- | spec/ruby/core/io/shared/binwrite.rb | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/spec/ruby/core/io/shared/binwrite.rb b/spec/ruby/core/io/shared/binwrite.rb index 950a6f51ab..64793b1936 100644 --- a/spec/ruby/core/io/shared/binwrite.rb +++ b/spec/ruby/core/io/shared/binwrite.rb @@ -21,14 +21,12 @@ describe :io_binwrite, shared: true do IO.send(@method, @filename, "abcde").should == 5 end - ruby_version_is "3.0" do - it "accepts options as a keyword argument" do - IO.send(@method, @filename, "hi", 0, flags: File::CREAT).should == 2 + it "accepts options as a keyword argument" do + IO.send(@method, @filename, "hi", 0, flags: File::CREAT).should == 2 - -> { - IO.send(@method, @filename, "hi", 0, {flags: File::CREAT}) - }.should raise_error(ArgumentError, "wrong number of arguments (given 4, expected 2..3)") - end + -> { + IO.send(@method, @filename, "hi", 0, {flags: File::CREAT}) + }.should.raise(ArgumentError, "wrong number of arguments (given 4, expected 2..3)") end it "creates a file if missing" do @@ -83,7 +81,7 @@ describe :io_binwrite, shared: true do end it "raises an error if readonly mode is specified" do - -> { IO.send(@method, @filename, "abcde", mode: "r") }.should raise_error(IOError) + -> { IO.send(@method, @filename, "abcde", mode: "r") }.should.raise(IOError) end it "truncates if empty :opts provided and offset skipped" do |
