Permalink
Browse files

Use const_defined? instead of defined? to check for Enumerator

  • Loading branch information...
1 parent 8de490d commit 086f7414088e38ac005c21f74e937a6e0d42c75e @lgierth lgierth committed with lgierth Jan 9, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 test/spec_chunked.rb
  2. +1 −1 test/spec_lock.rb
  3. +1 −1 test/spec_nulllogger.rb
View
@@ -3,7 +3,7 @@
require 'rack/mock'
describe Rack::Chunked do
- Enumerator = ::Enumerable::Enumerator unless defined?(Enumerator)
+ ::Enumerator = ::Enumerable::Enumerator unless Object.const_defined?(:Enumerator)
def chunked(app)
proc do |env|
View
@@ -36,7 +36,7 @@ def lock_app(app, lock = Lock.new)
end
describe Rack::Lock do
- Enumerator = ::Enumerable::Enumerator unless defined?(Enumerator)
+ ::Enumerator = ::Enumerable::Enumerator unless Object.const_defined?(:Enumerator)
extend LockHelpers
View
@@ -4,7 +4,7 @@
require 'rack/nulllogger'
describe Rack::NullLogger do
- Enumerator = ::Enumerable::Enumerator unless defined?(Enumerator)
+ ::Enumerator = ::Enumerable::Enumerator unless Object.const_defined?(:Enumerator)
should "act as a noop logger" do
app = lambda { |env|

0 comments on commit 086f741

Please sign in to comment.