diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2014-02-18 15:20:15 +0100 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2014-02-18 16:35:07 +0100 |
commit | 4edca106daacc5a159289eae255207d160f22396 (patch) | |
tree | 26bea685d0493162fed61944ec9989ada169e573 /activesupport/test/core_ext/object | |
parent | 5d037819ca80606638212f83de741cc2041db28f (diff) | |
download | rails-4edca106daacc5a159289eae255207d160f22396.tar.gz rails-4edca106daacc5a159289eae255207d160f22396.tar.bz2 rails-4edca106daacc5a159289eae255207d160f22396.zip |
Added Object#present_in to simplify value whitelisting
Diffstat (limited to 'activesupport/test/core_ext/object')
-rw-r--r-- | activesupport/test/core_ext/object/inclusion_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/object/inclusion_test.rb b/activesupport/test/core_ext/object/inclusion_test.rb index 478706eeae..33f40b60b1 100644 --- a/activesupport/test/core_ext/object/inclusion_test.rb +++ b/activesupport/test/core_ext/object/inclusion_test.rb @@ -47,4 +47,9 @@ class InTest < ActiveSupport::TestCase def test_no_method_catching assert_raise(ArgumentError) { 1.in?(1) } end + + def test_present_in + assert_equal "stuff", "stuff".present_in(%w( lots of stuff )) + assert_not "stuff".present_in(%w( lots of crap )) + end end |