mirror of
https://github.com/github/rails.git
synced 2026-01-09 22:58:02 -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 'test/unit'
|
||||||
require 'active_support/core_ext/kernel/reporting'
|
require 'active_support/core_ext/kernel/reporting'
|
||||||
|
require 'empty_bool'
|
||||||
|
|
||||||
silence_warnings { require 'mocha' }
|
silence_warnings { require 'mocha' }
|
||||||
|
|
||||||
|
|||||||
@@ -1,14 +1,6 @@
|
|||||||
require 'abstract_unit'
|
require 'abstract_unit'
|
||||||
require 'active_support/core_ext/object/blank'
|
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
|
class BlankTest < Test::Unit::TestCase
|
||||||
BLANK = [ EmptyTrue.new, nil, false, '', ' ', " \n\t \r ", [], {} ]
|
BLANK = [ EmptyTrue.new, nil, false, '', ' ', " \n\t \r ", [], {} ]
|
||||||
NOT = [ EmptyFalse.new, Object.new, true, 0, 1, 'a', [nil], { nil => 0 } ]
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
class EmptyTrue
|
|
||||||
def empty?() true; end
|
|
||||||
end
|
|
||||||
|
|
||||||
class EmptyFalse
|
|
||||||
def empty?() false; end
|
|
||||||
end
|
|
||||||
|
|
||||||
class AssertBlankTest < ActiveSupport::TestCase
|
class AssertBlankTest < ActiveSupport::TestCase
|
||||||
BLANK = [ EmptyTrue.new, nil, false, '', ' ', " \n\t \r ", [], {} ]
|
BLANK = [ EmptyTrue.new, nil, false, '', ' ', " \n\t \r ", [], {} ]
|
||||||
NOT_BLANK = [ EmptyFalse.new, Object.new, true, 0, 1, 'x', [nil], { nil => 0 } ]
|
NOT_BLANK = [ EmptyFalse.new, Object.new, true, 0, 1, 'x', [nil], { nil => 0 } ]
|
||||||
|
|||||||
Reference in New Issue
Block a user