Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

make sure we raise type errors with unknown classes

  • Loading branch information...
commit b68bf40ecc611a75f3b204fada4471e9af92ce40 1 parent c9fe1b3
@tenderlove tenderlove authored
View
6 History.txt
@@ -1,3 +1,9 @@
+== 2.0.6 12/01/2010
+
+* Bug Fixes
+
+ * Rails 3.0.x does not like that Node is Enumerable, so removing for now.
+
== 2.0.5 11/30/2010
* Enhancements
View
1  lib/arel/visitors/visitor.rb
@@ -18,6 +18,7 @@ def visit object
superklass = object.class.ancestors.find { |klass|
respond_to?(DISPATCH[klass], true)
}
+ raise(TypeError, "Cannot visit #{object.class}") unless superklass
DISPATCH[object.class] = DISPATCH[superklass]
retry
end
View
7 test/visitors/test_depth_first.rb
@@ -14,6 +14,13 @@ def setup
@visitor = Visitors::DepthFirst.new @collector
end
+ def test_raises_with_object
+ assert_raises(TypeError) do
+ @visitor.accept(Object.new)
+ end
+ end
+
+
# unary ops
[
Arel::Nodes::Not,
Please sign in to comment.
Something went wrong with that request. Please try again.