Skip to content

Commit

Permalink
register spec subclasses for people who spec
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Jan 6, 2012
1 parent b15d2c0 commit 1c09c29
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions actionpack/lib/action_controller/test_case.rb
Expand Up @@ -326,6 +326,12 @@ def exists?
# #
# assert_redirected_to page_url(:title => 'foo') # assert_redirected_to page_url(:title => 'foo')
class TestCase < ActiveSupport::TestCase 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 module Behavior
extend ActiveSupport::Concern extend ActiveSupport::Concern
include ActionDispatch::TestProcess include ActionDispatch::TestProcess
Expand Down
8 changes: 7 additions & 1 deletion activesupport/lib/active_support/test_case.rb
Expand Up @@ -9,7 +9,13 @@
require 'active_support/core_ext/kernel/reporting' require 'active_support/core_ext/kernel/reporting'


module ActiveSupport 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 Assertion = MiniTest::Assertion
alias_method :method_name, :name if method_defined? :name alias_method :method_name, :name if method_defined? :name
alias_method :method_name, :__name__ if method_defined? :__name__ alias_method :method_name, :__name__ if method_defined? :__name__
Expand Down

0 comments on commit 1c09c29

Please sign in to comment.