test/xml_test.rb in representable-1.0.1 vs test/xml_test.rb in representable-1.1.0

- old
+ new

@@ -125,17 +125,22 @@ describe "XML#binding_for_definition" do it "returns AttributeBinding" do assert_kind_of XML::AttributeBinding, Representable::XML.binding_for_definition(Def.new(:band, :from => "band", :attribute => true)) end - it "returns ObjectBinding" do - assert_kind_of XML::ObjectBinding, Representable::XML.binding_for_definition(Def.new(:band, :class => Hash)) + it "returns PropertyBinding" do + assert_kind_of XML::PropertyBinding, Representable::XML.binding_for_definition(Def.new(:band, :class => Hash)) + assert_kind_of XML::PropertyBinding, Representable::XML.binding_for_definition(Def.new(:band, :from => :content)) end - it "returns TextBinding" do - assert_kind_of XML::TextBinding, Representable::XML.binding_for_definition(Def.new(:band, :from => :content)) + it "returns CollectionBinding" do + assert_kind_of XML::CollectionBinding, Representable::XML.binding_for_definition(Def.new(:band, :collection => :true)) end + + it "returns HashBinding" do + assert_kind_of XML::HashBinding, Representable::XML.binding_for_definition(Def.new(:band, :hash => :true)) + end end describe "DCI" do module SongRepresenter @@ -259,10 +264,10 @@ end it "doesn't escape and wrap string from Band#to_node" do band = Band.new("Bad Religion") band.instance_eval do - def to_node + def to_node(*) "<band>Baaaad Religion</band>" end end assert_xml_equal %{<album><band>Baaaad Religion</band></album>}, Album.new(band).extend(AlbumRepresenter).to_xml