test/unit/graphviz_test.rb in rails-erd-1.5.2 vs test/unit/graphviz_test.rb in rails-erd-1.6.0

- old
+ new

@@ -302,16 +302,24 @@ create_model "Author", :name => :string assert_match %r(\A"\w+\|.*"\Z)m, find_dot_node(diagram(:orientation => :vertical), "m_Author")[:label].to_gv end test "generate should create edge for each relationship" do - create_model "Foo", :bar => :references do - belongs_to :bar + # TODO: Once we drop Rails 3.2 support, we _should_ be able to drop the + # :respond_to? check + # + if respond_to? :skip + skip("multiple edges between the same objects can cause segfaults in some versions of Graphviz") + + create_model "Foo", :bar => :references do + belongs_to :bar + end + create_model "Bar", :foo => :references do + belongs_to :foo + end + + assert_equal [["m_Bar", "m_Foo"], ["m_Foo", "m_Bar"]], find_dot_node_pairs(diagram).sort end - create_model "Bar", :foo => :references do - belongs_to :foo - end - assert_equal [["m_Bar", "m_Foo"], ["m_Foo", "m_Bar"]], find_dot_node_pairs(diagram).sort end test "generate should create edge to polymorphic entity if polymorphism is true" do create_model "Cannon", :defensible => :references do belongs_to :defensible, :polymorphic => true