summaryrefslogtreecommitdiff
path: root/spec/ruby/library/stringio/new_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/library/stringio/new_spec.rb')
-rw-r--r--spec/ruby/library/stringio/new_spec.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/ruby/library/stringio/new_spec.rb b/spec/ruby/library/stringio/new_spec.rb
index 328455134e..ec4b32aa11 100644
--- a/spec/ruby/library/stringio/new_spec.rb
+++ b/spec/ruby/library/stringio/new_spec.rb
@@ -2,7 +2,9 @@ require_relative '../../spec_helper'
require 'stringio'
describe "StringIO.new" do
- it "warns when called with a block" do
- -> { eval("StringIO.new {}") }.should complain(/StringIO::new\(\) does not take block; use StringIO::open\(\) instead/)
+ it "does not use the given block and warns to use StringIO::open" do
+ -> {
+ StringIO.new { raise }
+ }.should complain(/warning: StringIO::new\(\) does not take block; use StringIO::open\(\) instead/)
end
end