aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAdam Lassek <adam@doubleprime.net>2016-08-26 17:28:12 -0500
committerAdam Lassek <adam@doubleprime.net>2016-08-26 17:43:28 -0500
commitb7e91eff47d367e25351e20bc1cb660b1493f2f9 (patch)
tree93d9e805688553fdd4c404bfa05c3376b8ff31f7 /test
parent09827f361d4bc73e6ff157d9feb74a465e4e4cdd (diff)
downloadrails-b7e91eff47d367e25351e20bc1cb660b1493f2f9.tar.gz
rails-b7e91eff47d367e25351e20bc1cb660b1493f2f9.tar.bz2
rails-b7e91eff47d367e25351e20bc1cb660b1493f2f9.zip
Add failing test for Dot visitor and BindParam
Since BindParam has no value, treating it like a string causes it to fallback to Object#to_s, leading to output like `#<Arel::Nodes::BindParam:0x007fa43c866108>`. Since angle brackets are significant in Dot labels, this causes `Error: bad label format` when passing the graph into dot.
Diffstat (limited to 'test')
-rw-r--r--test/visitors/test_dot.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/visitors/test_dot.rb b/test/visitors/test_dot.rb
index 4dc3c9c6c5..6db9b9b6de 100644
--- a/test/visitors/test_dot.rb
+++ b/test/visitors/test_dot.rb
@@ -70,6 +70,12 @@ module Arel
@visitor.accept binary, Collectors::PlainString.new
end
end
+
+ def test_Arel_Nodes_BindParam
+ node = Arel::Nodes::BindParam.new
+ collector = Collectors::PlainString.new
+ assert_match '[label="<f0>Arel::Nodes::BindParam"]', @visitor.accept(node, collector).value
+ end
end
end
end