Permalink
Browse files

Now ruby1.9 compatible

  • Loading branch information...
1 parent 290dc65 commit fd0f8eaa975c4d22622a7df081f663c4af3bdf38 @mynyml committed Nov 4, 2009
Showing with 6 additions and 6 deletions.
  1. +1 −1 lib/every.rb
  2. +5 −5 test/test_every.rb
View
@@ -1,6 +1,6 @@
module Enumerable
class Proxy
- instance_methods.each { |m| undef_method(m) unless m.match(/^__/) }
+ instance_methods.each {|m| undef_method(m) unless m.match(/^__|object_id/) }
def initialize(enum, method=:map)
@enum, @method = enum, method
View
@@ -5,11 +5,6 @@
describe "Every" do
- it "should be a basic object" do
- whitelist = %w( __id__ __send__ method_missing ).to_set
- Enumerable::Proxy.instance_methods.to_set.must_equal(whitelist.to_set)
- end
-
it "should pass message onto enumerable's items" do
[1.4, 2.4, 3.4].every.floor.must_equal([1,2,3])
end
@@ -21,4 +16,9 @@
it "should allow blocks" do
%w( axb dxf ).every.gsub(/x/) { 'y' }.must_equal(%w( ayb dyf ))
end
+
+ it "should be a basic object" do
+ whitelist = %w( __id__ __send__ method_missing object_id ).every.to_s.to_set
+ Enumerable::Proxy.instance_methods.every.to_s.to_set.must_equal(whitelist)
+ end
end

0 comments on commit fd0f8ea

Please sign in to comment.