CapnKernul/minitest-reporters — Issue #4: undefined method `before_suites' running SpecReporter
Author: dchelimsky
Created: 2011-10-30 18:51:34+00:00
State: open

Trying to take this for a spin and can't get the SpecReporter running.

Background info:

```
$ rvm -v

rvm 1.9.1 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]

$ ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.0]
$ rails -v
Rails 3.1.1
```

Script to reproduce issue:

```
rvm @demo --create
gem install rails -v 3.1.1
rails new example --skip-bundle
cd example
echo "source 'http://rubygems.org'
gem 'rails', '3.1.1'
gem 'sqlite3'
gem 'minitest-reporters', :group => :test
" > Gemfile
bundle install
echo "ENV['RAILS_ENV'] = 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'minitest/reporters'
MiniTest::Unit.runner = MiniTest::SuiteRunner.new
MiniTest::Unit.runner.reporters << MiniTest::Reporters::SpecReporter
" > test/test_helper.rb
rails g model thing name:string
echo "require 'test_helper'
class ThingTest < ActiveSupport::TestCase
test 'anything' do; end
end
" > test/unit/thing_test.rb
rake db:migrate
rake test
```

Output:

```
Run options: --seed 415
/Users/david/.rvm/gems/ruby-1.9.2-p290@demo/gems/minitest-reporters-0.4.0/lib/minitest/suite_runner.rb:75:in `block in trigger': undefined method `before_suites' for MiniTest::Reporters::SpecReporter:Class (NoMethodError)
from /Users/david/.rvm/gems/ruby-1.9.2-p290@demo/gems/minitest-reporters-0.4.0/lib/minitest/suite_runner.rb:75:in `each'
from /Users/david/.rvm/gems/ruby-1.9.2-p290@demo/gems/minitest-reporters-0.4.0/lib/minitest/suite_runner.rb:75:in `trigger'
from /Users/david/.rvm/gems/ruby-1.9.2-p290@demo/gems/minitest-reporters-0.4.0/lib/minitest/suite_runner.rb:37:in `_run_anything'
from /Users/david/.rvm/gems/ruby-1.9.2-p290@demo/gems/minitest-2.7.0/lib/minitest/unit.rb:934:in `run_tests'
from /Users/david/.rvm/gems/ruby-1.9.2-p290@demo/gems/minitest-2.7.0/lib/minitest/unit.rb:921:in `block in _run'
from /Users/david/.rvm/gems/ruby-1.9.2-p290@demo/gems/minitest-2.7.0/lib/minitest/unit.rb:920:in `each'
from /Users/david/.rvm/gems/ruby-1.9.2-p290@demo/gems/minitest-2.7.0/lib/minitest/unit.rb:920:in `_run'
from /Users/david/.rvm/gems/ruby-1.9.2-p290@demo/gems/minitest-2.7.0/lib/minitest/unit.rb:909:in `run'
from /Users/david/.rvm/gems/ruby-1.9.2-p290@demo/gems/minitest-2.7.0/lib/minitest/unit.rb:689:in `block in autorun'
```

Now with minitest/spec:

```
echo "ENV['RAILS_ENV'] = 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'minitest/spec'
require 'minitest/reporters'
MiniTest::Unit.runner = MiniTest::SuiteRunner.new
MiniTest::Unit.runner.reporters << MiniTest::Reporters::SpecReporter
" > test/test_helper.rb
echo "require 'test_helper'
describe Thing do
it 'does something' do; end
end
" > test/unit/thing_test.rb
rake spec
```

Same output as above.