From: Ryan Davis Date: 2012-08-20T17:05:14+09:00 Subject: Re: How to get the minitest capture_io method found in my specs? On Aug 20, 2012, at 00:10 , Milli Sami wrote: > This is my `spec/helper.rb` file: > > require 'minitest/autorun' > require 'minitest/spec' > require_relative '../lib/launcher' > > class MiniTest::Spec > include MiniTest::Assertions > end This isn't necessary. In fact, you only need the autorun and launcher lines. > And this is the spec file: > > require 'helper' > > describe Launcher do > it "should get the stdout" do > out, err = capture_io do > warn "You did a bad thing" > end > err.should =~ /bad/ > end > end I'd start by cleaning up the above. it works for me: 10011 % ruby -Ilib -rminitest/autorun -e 'describe true do it "works" do x = capture_io do puts "hi" end; p x end end' Run options: --seed 27063 # Running tests: ["hi\n", ""] . Finished tests in 0.000760s, 1315.7895 tests/s, 0.0000 assertions/s. 1 tests, 0 assertions, 0 failures, 0 errors, 0 skips If you still can't get it to work, please file a bug. This is no the right forum for minitest support.