Skip to content

Instantly share code, notes, and snippets.

@superlou
Last active December 11, 2015 16:58
Show Gist options
  • Save superlou/4630923 to your computer and use it in GitHub Desktop.
Save superlou/4630923 to your computer and use it in GitHub Desktop.
Minitest Reporters not working after upgrading to Rails 3.2. Adding the line `MiniTest::Reporters.use!` to test_helpers.rb results in tests not being reported properly. They work again when the line is removed.
require 'test_helper'
class AddressTest < ActiveSupport::TestCase
should belong_to :addressable
should "be tested" do
assert true
end
should "be tested to fail" do
assert false
end
end
lsimons@bestever ~/RubymineProjects/connie $ rake test TEST=test/unit/address_test.rb
NOTICE: CREATE TABLE will create implicit sequence "addresses_id_seq" for serial column "addresses.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "addresses_pkey" for table "addresses"
NOTICE: CREATE TABLE will create implicit sequence "assignees_id_seq" for serial column "assignees.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "assignees_pkey" for table "assignees"
NOTICE: CREATE TABLE will create implicit sequence "auth_requirements_id_seq" for serial column "auth_requirements.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "auth_requirements_pkey" for table "auth_requirements"
NOTICE: CREATE TABLE will create implicit sequence "be_scheduled_rules_id_seq" for serial column "be_scheduled_rules.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "be_scheduled_rules_pkey" for table "be_scheduled_rules"
NOTICE: CREATE TABLE will create implicit sequence "comments_id_seq" for serial column "comments.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "comments_pkey" for table "comments"
NOTICE: CREATE TABLE will create implicit sequence "convention_linkables_id_seq" for serial column "convention_linkables.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "convention_linkables_pkey" for table "convention_linkables"
NOTICE: CREATE TABLE will create implicit sequence "conventions_id_seq" for serial column "conventions.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "conventions_pkey" for table "conventions"
NOTICE: CREATE TABLE will create implicit sequence "duration_rules_id_seq" for serial column "duration_rules.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "duration_rules_pkey" for table "duration_rules"
NOTICE: CREATE TABLE will create implicit sequence "events_id_seq" for serial column "events.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "events_pkey" for table "events"
NOTICE: CREATE TABLE will create implicit sequence "is_related_rules_id_seq" for serial column "is_related_rules.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "is_related_rules_pkey" for table "is_related_rules"
NOTICE: CREATE TABLE will create implicit sequence "jobs_id_seq" for serial column "jobs.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "jobs_pkey" for table "jobs"
NOTICE: CREATE TABLE will create implicit sequence "maps_id_seq" for serial column "maps.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "maps_pkey" for table "maps"
NOTICE: CREATE TABLE will create implicit sequence "meets_occupancy_rules_id_seq" for serial column "meets_occupancy_rules.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "meets_occupancy_rules_pkey" for table "meets_occupancy_rules"
NOTICE: CREATE TABLE will create implicit sequence "periods_id_seq" for serial column "periods.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "periods_pkey" for table "periods"
NOTICE: CREATE TABLE will create implicit sequence "phones_id_seq" for serial column "phones.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "phones_pkey" for table "phones"
NOTICE: CREATE TABLE will create implicit sequence "profiles_id_seq" for serial column "profiles.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "profiles_pkey" for table "profiles"
NOTICE: CREATE TABLE will create implicit sequence "reservations_id_seq" for serial column "reservations.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "reservations_pkey" for table "reservations"
NOTICE: CREATE TABLE will create implicit sequence "reserves_tagged_rules_id_seq" for serial column "reserves_tagged_rules.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "reserves_tagged_rules_pkey" for table "reserves_tagged_rules"
NOTICE: CREATE TABLE will create implicit sequence "roles_id_seq" for serial column "roles.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "roles_pkey" for table "roles"
NOTICE: CREATE TABLE will create implicit sequence "rule_assignments_id_seq" for serial column "rule_assignments.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "rule_assignments_pkey" for table "rule_assignments"
NOTICE: CREATE TABLE will create implicit sequence "schedule_reservables_id_seq" for serial column "schedule_reservables.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "schedule_reservables_pkey" for table "schedule_reservables"
NOTICE: CREATE TABLE will create implicit sequence "schedules_id_seq" for serial column "schedules.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "schedules_pkey" for table "schedules"
NOTICE: CREATE TABLE will create implicit sequence "spaces_id_seq" for serial column "spaces.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "spaces_pkey" for table "spaces"
NOTICE: CREATE TABLE will create implicit sequence "taggings_id_seq" for serial column "taggings.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "taggings_pkey" for table "taggings"
NOTICE: CREATE TABLE will create implicit sequence "tags_id_seq" for serial column "tags.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "tags_pkey" for table "tags"
NOTICE: CREATE TABLE will create implicit sequence "time_spans_id_seq" for serial column "time_spans.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "time_spans_pkey" for table "time_spans"
NOTICE: CREATE TABLE will create implicit sequence "users_id_seq" for serial column "users.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "users_pkey" for table "users"
Rack::File headers parameter replaces cache_control after Rack 1.5.
DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases,simply use Ruby memoization pattern instead. (called from extend at /home/lsimons/RubymineProjects/connie/app/models/schedule.rb:2)
Started
0/: 0 00:00:00
Finished in 0.23173s
2 tests, 0 assertions, 1 failures, 0 errors, 0 skips
Coverage report generated for Unit Tests to /home/lsimons/RubymineProjects/connie/coverage. 626 / 1368 LOC (45.76%) covered.
rake aborted!
Command failed with status (1): [ruby -I"lib:test" -I"/home/lsimons/.rvm/gems/ruby-1.9.3-p327@global/gems/rake-10.0.3/lib" "/home/lsimons/.rvm/gems/ruby-1.9.3-p327@global/gems/rake-10.0.3/lib/rake/rake_test_loader.rb" "test/unit/address_test.rb" ]
/home/lsimons/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.11/lib/rails/test_unit/testing.rake:50:in `block in <top (required)>'
/home/lsimons/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `eval'
/home/lsimons/.rvm/gems/ruby-1.9.3-p327/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => test:single
(See full trace by running task with --trace)
source 'https://rubygems.org'
gem 'rails'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg'
gem 'haml'
gem 'formtastic'
gem 'formtastic-bootstrap'
gem 'twitter-bootstrap-rails'
gem 'awesome_nested_set'
gem 'chronic'
gem 'chronic_duration'
gem 'best_in_place'
gem 'devise'
gem 'cancan'
gem 'icalendar'
gem 'paperclip'
gem 'sunspot_rails'
gem 'sunspot_solr' #pre-packaged Solr distribution for development
gem 'progress_bar'
gem 'acts_as_commentable_with_threading'
gem 'acts-as-taggable-on'
group :test, :development do
gem 'minitest'
gem 'minitest-reporters'
end
group :test do
gem 'mocha', :require => false # Prevent mocha from loading until after test framework
gem 'shoulda'
gem 'factory_girl_rails'
gem 'simplecov', :require => false
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'less-rails'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'therubyracer', :platform => :ruby
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
require 'rubygems'
require 'paperclip/matchers'
# --- Instructions ---
# Sort the contents of this file into a Spork.prefork and a Spork.each_run
# block.
#
# The Spork.prefork block is run only once when the spork server is started.
# You typically want to place most of your (slow) initializer code in here, in
# particular, require'ing any 3rd-party gems that you don't normally modify
# during development.
#
# The Spork.each_run block is run each time you run your specs. In case you
# need to load files that tend to change during development, require them here.
# With Rails, your application modules are loaded automatically, so sometimes
# this block can remain empty.
#
# Note: You can modify files loaded *from* the Spork.each_run block without
# restarting the spork server. However, this file itself will not be reloaded,
# so if you change any of the code inside the each_run block, you still need to
# restart the server. In general, if you have non-trivial code in this file,
# it's advisable to move it into a separate file so you can easily edit it
# without restarting spork. (For example, with RSpec, you could move
# non-trivial code into a file spec/support/my_helper.rb, making sure that the
# spec/support/* files are require'd from inside the each_run block.)
#
# Any code that is left outside the two blocks will be run during preforking
# *and* during each_run -- that's probably not what you want.
#
# These instructions should self-destruct in 10 seconds. If they don't, feel
# free to delete them.
require 'simplecov'
SimpleCov.start
ENV["RAILS_ENV"] = "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'minitest/autorun'
require 'minitest/reporters'
MiniTest::Reporters.use! # todo fix this
require 'mocha'
class ActiveSupport::TestCase
extend Paperclip::Shoulda::Matchers
# Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
#
# Note: You'll currently still have to declare fixtures explicitly in integration tests
# -- they do not yet inherit this setting
fixtures :all
# Add more helper methods to be used by all tests here...
end
class ActionController::TestCase
include Devise::TestHelpers
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment