diff options
Diffstat (limited to 'spec/ruby/library/stringio/putc_spec.rb')
| -rw-r--r-- | spec/ruby/library/stringio/putc_spec.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/ruby/library/stringio/putc_spec.rb b/spec/ruby/library/stringio/putc_spec.rb index 1ce53b7ef2..742f8623eb 100644 --- a/spec/ruby/library/stringio/putc_spec.rb +++ b/spec/ruby/library/stringio/putc_spec.rb @@ -3,7 +3,7 @@ require_relative 'fixtures/classes' describe "StringIO#putc when passed [String]" do before :each do - @io = StringIO.new('example') + @io = StringIO.new(+'example') end it "overwrites the character at the current position" do @@ -22,7 +22,7 @@ describe "StringIO#putc when passed [String]" do it "returns the passed String" do str = "test" - @io.putc(str).should equal(str) + @io.putc(str).should.equal?(str) end it "correctly updates the current position" do @@ -54,7 +54,7 @@ end describe "StringIO#putc when passed [Object]" do before :each do - @io = StringIO.new('example') + @io = StringIO.new(+'example') end it "it writes the passed Integer % 256 to self" do @@ -79,13 +79,13 @@ describe "StringIO#putc when passed [Object]" do end it "raises a TypeError when the passed argument can't be coerced to Integer" do - -> { @io.putc(Object.new) }.should raise_error(TypeError) + -> { @io.putc(Object.new) }.should.raise(TypeError) end end describe "StringIO#putc when in append mode" do it "appends to the end of self" do - io = StringIO.new("test", "a") + io = StringIO.new(+"test", "a") io.putc(?t) io.string.should == "testt" end @@ -93,11 +93,11 @@ end describe "StringIO#putc when self is not writable" do it "raises an IOError" do - io = StringIO.new("test", "r") - -> { io.putc(?a) }.should raise_error(IOError) + io = StringIO.new(+"test", "r") + -> { io.putc(?a) }.should.raise(IOError) - io = StringIO.new("test") + io = StringIO.new(+"test") io.close_write - -> { io.putc("t") }.should raise_error(IOError) + -> { io.putc("t") }.should.raise(IOError) end end |
