diff options
Diffstat (limited to 'spec/ruby/core/io/new_spec.rb')
| -rw-r--r-- | spec/ruby/core/io/new_spec.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/ruby/core/io/new_spec.rb b/spec/ruby/core/io/new_spec.rb index ce922a4856..979ac0efcb 100644 --- a/spec/ruby/core/io/new_spec.rb +++ b/spec/ruby/core/io/new_spec.rb @@ -1,8 +1,16 @@ -require File.expand_path('../../../spec_helper', __FILE__) -require File.expand_path('../shared/new', __FILE__) +require_relative '../../spec_helper' +require_relative 'shared/new' + +# NOTE: should be synchronized with library/stringio/initialize_spec.rb describe "IO.new" do it_behaves_like :io_new, :new + + it "does not use the given block and warns to use IO::open" do + -> { + @io = IO.send(@method, @fd) { raise } + }.should complain(/warning: IO::new\(\) does not take block; use IO::open\(\) instead/) + end end describe "IO.new" do |
