summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-01 01:55:03 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-01 01:55:03 +0000
commit8430f93b8fa0a166c251c270a550358a0602552d (patch)
tree6f9e9c5e6e8eabef083835c799e5d99702b74c3e
parenta672fd8be32ea7837e814a2e755241ef805afb81 (diff)
* Add test for Enumerable#none? [fix GH-950] Patch by @yui-knk
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--enum.c1
-rw-r--r--test/ruby/test_enum.rb1
3 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 62f4ad5..1699f64 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Jul 1 10:54:56 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
+
+ * Add test for Enumerable#none? [fix GH-950] Patch by @yui-knk
+
Wed Jul 1 09:30:36 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* struct.c (struct_set_members): hide internal back_members
diff --git a/enum.c b/enum.c
index e14ebfa..db17c04 100644
--- a/enum.c
+++ b/enum.c
@@ -1401,6 +1401,7 @@ DEFINE_ENUMFUNCS(none)
* [].none? #=> true
* [nil].none? #=> true
* [nil, false].none? #=> true
+ * [nil, false, true].none? #=> false
*/
static VALUE
enum_none(VALUE obj)
diff --git a/test/ruby/test_enum.rb b/test/ruby/test_enum.rb
index 9260c43..a599fab 100644
--- a/test/ruby/test_enum.rb
+++ b/test/ruby/test_enum.rb
@@ -265,6 +265,7 @@ class TestEnumerable < Test::Unit::TestCase
assert([].none?)
assert([nil].none?)
assert([nil,false].none?)
+ assert(![nil,false,true].none?)
end
def test_min