Skip to content

Commit

Permalink
Now ruby1.9 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
mynyml committed Nov 4, 2009
1 parent 290dc65 commit fd0f8ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion lib/every.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
10 changes: 5 additions & 5 deletions test/test_every.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.