diff options
Diffstat (limited to 'spec/ruby/library/stringio/print_spec.rb')
| -rw-r--r-- | spec/ruby/library/stringio/print_spec.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/spec/ruby/library/stringio/print_spec.rb b/spec/ruby/library/stringio/print_spec.rb index 6ac6430900..48728e5f14 100644 --- a/spec/ruby/library/stringio/print_spec.rb +++ b/spec/ruby/library/stringio/print_spec.rb @@ -3,7 +3,7 @@ require_relative 'fixtures/classes' describe "StringIO#print" do before :each do - @io = StringIO.new('example') + @io = StringIO.new(+'example') end it "prints $_ when passed no arguments" do @@ -29,7 +29,7 @@ describe "StringIO#print" do end it "returns nil" do - @io.print(1, 2, 3).should be_nil + @io.print(1, 2, 3).should == nil end it "pads self with \\000 when the current position is after the end" do @@ -52,10 +52,10 @@ describe "StringIO#print" do it "updates the current position" do @io.print(1, 2, 3) - @io.pos.should eql(3) + @io.pos.should.eql?(3) @io.print(1, 2, 3) - @io.pos.should eql(6) + @io.pos.should.eql?(6) end it "correctly updates the current position when honoring the output record separator global" do @@ -64,7 +64,7 @@ describe "StringIO#print" do begin @io.print(5, 6, 7, 8) - @io.pos.should eql(5) + @io.pos.should.eql?(5) ensure suppress_warning {$\ = old_rs} end @@ -73,7 +73,7 @@ end describe "StringIO#print when in append mode" do before :each do - @io = StringIO.new("example", "a") + @io = StringIO.new(+"example", "a") end it "appends the passed argument to the end of self" do @@ -86,17 +86,17 @@ describe "StringIO#print when in append mode" do it "correctly updates self's position" do @io.print(", testing") - @io.pos.should eql(16) + @io.pos.should.eql?(16) end end describe "StringIO#print when self is not writable" do it "raises an IOError" do - io = StringIO.new("test", "r") - -> { io.print("test") }.should raise_error(IOError) + io = StringIO.new(+"test", "r") + -> { io.print("test") }.should.raise(IOError) - io = StringIO.new("test") + io = StringIO.new(+"test") io.close_write - -> { io.print("test") }.should raise_error(IOError) + -> { io.print("test") }.should.raise(IOError) end end |
