Permalink
Browse files

Add Array#none? for Ruby 1.8.6

  • Loading branch information...
1 parent a368317 commit fad68aa15fc6e8c25dfef98ab1809f23d461b445 @dchelimsky dchelimsky committed Aug 2, 2010
Showing with 8 additions and 0 deletions.
  1. +1 −0 lib/rspec/expectations/extensions.rb
  2. +7 −0 lib/rspec/expectations/extensions/array.rb
@@ -1,2 +1,3 @@
require 'rspec/expectations/extensions/kernel'
+require 'rspec/expectations/extensions/array'
require 'rspec/expectations/extensions/rspec/core/example_group'
@@ -0,0 +1,7 @@
+class Array
+ unless public_instance_methods.map {|m| m.to_s}.include?('none?')
+ def none?(&block)
+ !any?(&block)
+ end
+ end
+end

0 comments on commit fad68aa

Please sign in to comment.