summaryrefslogtreecommitdiff
path: root/spec/ruby/library/stringio/ungetc_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/stringio/ungetc_spec.rb')
-rw-r--r--spec/ruby/library/stringio/ungetc_spec.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/spec/ruby/library/stringio/ungetc_spec.rb b/spec/ruby/library/stringio/ungetc_spec.rb
index 91ef2100a1..8753ac9666 100644
--- a/spec/ruby/library/stringio/ungetc_spec.rb
+++ b/spec/ruby/library/stringio/ungetc_spec.rb
@@ -3,7 +3,7 @@ require_relative 'fixtures/classes'
describe "StringIO#ungetc when passed [char]" do
before :each do
- @io = StringIO.new('1234')
+ @io = StringIO.new(+'1234')
end
it "writes the passed char before the current position" do
@@ -14,13 +14,13 @@ describe "StringIO#ungetc when passed [char]" do
it "returns nil" do
@io.pos = 1
- @io.ungetc(?A).should be_nil
+ @io.ungetc(?A).should == nil
end
it "decreases the current position by one" do
@io.pos = 2
@io.ungetc(?A)
- @io.pos.should eql(1)
+ @io.pos.should.eql?(1)
end
it "pads with \\000 when the current position is after the end" do
@@ -39,20 +39,20 @@ describe "StringIO#ungetc when passed [char]" do
end
it "raises a TypeError when the passed length can't be converted to an Integer or String" do
- -> { @io.ungetc(Object.new) }.should raise_error(TypeError)
+ -> { @io.ungetc(Object.new) }.should.raise(TypeError)
end
end
describe "StringIO#ungetc when self is not readable" do
it "raises an IOError" do
- io = StringIO.new("test", "w")
+ io = StringIO.new(+"test", "w")
io.pos = 1
- -> { io.ungetc(?A) }.should raise_error(IOError)
+ -> { io.ungetc(?A) }.should.raise(IOError)
- io = StringIO.new("test")
+ io = StringIO.new(+"test")
io.pos = 1
io.close_read
- -> { io.ungetc(?A) }.should raise_error(IOError)
+ -> { io.ungetc(?A) }.should.raise(IOError)
end
end
@@ -60,13 +60,13 @@ end
#
# describe "StringIO#ungetc when self is not writable" do
# it "raises an IOError" do
-# io = StringIO.new("test", "r")
+# io = StringIO.new(+"test", "r")
# io.pos = 1
-# lambda { io.ungetc(?A) }.should raise_error(IOError)
+# lambda { io.ungetc(?A) }.should.raise(IOError)
#
-# io = StringIO.new("test")
+# io = StringIO.new(+"test")
# io.pos = 1
# io.close_write
-# lambda { io.ungetc(?A) }.should raise_error(IOError)
+# lambda { io.ungetc(?A) }.should.raise(IOError)
# end
# end