mirror of
https://github.com/github/rails.git
synced 2026-01-08 22:27:59 -05:00
avoid method redefined; discarding old empty? warning [#4302 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
This commit is contained in:
committed by
Jeremy Kemper
parent
7d0eea179b
commit
c10958fbdd
@@ -10,6 +10,7 @@ $:.unshift(lib) unless $:.include?('lib') || $:.include?(lib)
|
||||
|
||||
require 'test/unit'
|
||||
require 'active_support/core_ext/kernel/reporting'
|
||||
require 'empty_bool'
|
||||
|
||||
silence_warnings { require 'mocha' }
|
||||
|
||||
|
||||
@@ -1,14 +1,6 @@
|
||||
require 'abstract_unit'
|
||||
require 'active_support/core_ext/object/blank'
|
||||
|
||||
class EmptyTrue
|
||||
def empty?() true; end
|
||||
end
|
||||
|
||||
class EmptyFalse
|
||||
def empty?() false; end
|
||||
end
|
||||
|
||||
class BlankTest < Test::Unit::TestCase
|
||||
BLANK = [ EmptyTrue.new, nil, false, '', ' ', " \n\t \r ", [], {} ]
|
||||
NOT = [ EmptyFalse.new, Object.new, true, 0, 1, 'a', [nil], { nil => 0 } ]
|
||||
|
||||
7
activesupport/test/empty_bool.rb
Normal file
7
activesupport/test/empty_bool.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class EmptyTrue
|
||||
def empty?() true; end
|
||||
end
|
||||
|
||||
class EmptyFalse
|
||||
def empty?() false; end
|
||||
end
|
||||
@@ -86,14 +86,6 @@ class AssertDifferenceTest < ActiveSupport::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
class EmptyTrue
|
||||
def empty?() true; end
|
||||
end
|
||||
|
||||
class EmptyFalse
|
||||
def empty?() false; end
|
||||
end
|
||||
|
||||
class AssertBlankTest < ActiveSupport::TestCase
|
||||
BLANK = [ EmptyTrue.new, nil, false, '', ' ', " \n\t \r ", [], {} ]
|
||||
NOT_BLANK = [ EmptyFalse.new, Object.new, true, 0, 1, 'x', [nil], { nil => 0 } ]
|
||||
|
||||
Reference in New Issue
Block a user