mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
we still need describe
as the implementation differs from minitest
This commit is contained in:
parent
3dc54d7e90
commit
5921cf0b45
2 changed files with 24 additions and 0 deletions
|
@ -3,6 +3,7 @@ require 'minitest/spec'
|
|||
require 'active_support/testing/setup_and_teardown'
|
||||
require 'active_support/testing/assertions'
|
||||
require 'active_support/testing/deprecation'
|
||||
require 'active_support/testing/declarative'
|
||||
require 'active_support/testing/isolation'
|
||||
require 'active_support/testing/mocha_module'
|
||||
require 'active_support/core_ext/kernel/reporting'
|
||||
|
@ -34,6 +35,7 @@ module ActiveSupport
|
|||
include ActiveSupport::Testing::SetupAndTeardown
|
||||
include ActiveSupport::Testing::Assertions
|
||||
include ActiveSupport::Testing::Deprecation
|
||||
extend ActiveSupport::Testing::Declarative
|
||||
|
||||
class << self
|
||||
alias :test :it
|
||||
|
|
22
activesupport/lib/active_support/testing/declarative.rb
Normal file
22
activesupport/lib/active_support/testing/declarative.rb
Normal file
|
@ -0,0 +1,22 @@
|
|||
module ActiveSupport
|
||||
module Testing
|
||||
module Declarative
|
||||
|
||||
def self.extended(klass) #:nodoc:
|
||||
klass.class_eval do
|
||||
|
||||
unless method_defined?(:describe)
|
||||
def self.describe(text)
|
||||
class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
|
||||
def self.name
|
||||
"#{text}"
|
||||
end
|
||||
RUBY_EVAL
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue