Permalink
Browse files

register spec subclasses for people who spec

  • Loading branch information...
1 parent b15d2c0 commit 1c09c29a0958eac86fffede00f30a1bee36d09a9 @tenderlove tenderlove committed Jan 6, 2012
Showing with 13 additions and 1 deletion.
  1. +6 −0 actionpack/lib/action_controller/test_case.rb
  2. +7 −1 activesupport/lib/active_support/test_case.rb
@@ -326,6 +326,12 @@ def exists?
#
# assert_redirected_to page_url(:title => 'foo')
class TestCase < ActiveSupport::TestCase
+
+ # Use AS::TestCase for the base class when describing a model
+ register_spec_type(self) do |desc|
+ desc < ActionController::Base
+ end
+
module Behavior
extend ActiveSupport::Concern
include ActionDispatch::TestProcess
@@ -9,7 +9,13 @@
require 'active_support/core_ext/kernel/reporting'
module ActiveSupport
- class TestCase < ::MiniTest::Unit::TestCase
+ class TestCase < ::MiniTest::Spec
+
+ # Use AS::TestCase for the base class when describing a model
+ register_spec_type(self) do |desc|
+ desc < ActiveRecord::Model
+ end
+
Assertion = MiniTest::Assertion
alias_method :method_name, :name if method_defined? :name
alias_method :method_name, :__name__ if method_defined? :__name__

0 comments on commit 1c09c29

Please sign in to comment.