summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-07-01 09:08:25 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-07-01 09:08:25 +0900
commitc684b1aa26c51d9163eec06890e990b430dc34c5 (patch)
tree0dc39ec49dba3fd59548cc9951a71b0150000eba
parent5df20a5da57bfce736a6fd7de26c1110e3154b44 (diff)
downloadruby-c684b1aa26c51d9163eec06890e990b430dc34c5.tar.gz
Fix TODO in stringio/truncate_spec.rb
-rw-r--r--spec/ruby/library/stringio/truncate_spec.rb15
1 files changed, 3 insertions, 12 deletions
diff --git a/spec/ruby/library/stringio/truncate_spec.rb b/spec/ruby/library/stringio/truncate_spec.rb
index 18af8bbb80..e8d7f1a15d 100644
--- a/spec/ruby/library/stringio/truncate_spec.rb
+++ b/spec/ruby/library/stringio/truncate_spec.rb
@@ -6,11 +6,9 @@ describe "StringIO#truncate when passed [length]" do
@io = StringIO.new('123456789')
end
- # TODO: Report to Ruby-Core: The RDoc says it always returns 0
- it "returns the passed length" do
- @io.truncate(4).should eql(4)
- @io.truncate(10).should eql(10)
- end if ENV['USER'] == 'nobu'
+ it "returns an Integer" do
+ @io.truncate(4).should be_kind_of(Integer)
+ end
it "truncated the underlying string down to the passed length" do
@io.truncate(4)
@@ -47,13 +45,6 @@ describe "StringIO#truncate when passed [length]" do
@io.string.should == "1234"
end
- it "returns the passed length Object, NOT the result of #to_int" do
- obj = mock("to_int")
- obj.should_receive(:to_int).and_return(4)
-
- @io.truncate(obj).should equal(obj)
- end if ENV['USER'] == 'nobu'
-
it "raises a TypeError when the passed length can't be converted to an Integer" do
-> { @io.truncate(Object.new) }.should raise_error(TypeError)
end