This is my
require 'minitest/autorun' require 'minitest/spec' require_relative '../lib/launcher' class MiniTest::Spec include MiniTest::Assertions end
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
But when I run the spec:
± rake spec /Users/millisami/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -S rspec
Failures: 1) Launcher should be a launcher for cloud Failure/Error: out, err = capture_io do NoMethodError: undefined method `capture_io' for
# ./spec/launcher_spec.rb:5:in `block (2 levels) in <top
Finished in 0.00044 seconds 1 example, 1 failure Failed examples: rspec ./spec/launcher_spec.rb:4 # launcher should be a launcher for
/Users/millisami/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -S rspec
./spec/launcher_spec.rb -Ispec:lib failed
Tasks: TOP => spec
But when I do this with the default MiniTest::Unit way, it works?
And why not the spec way?