test/definition_test.rb in representable-0.11.0 vs test/definition_test.rb in representable-0.12.0

- old
+ new

@@ -4,13 +4,20 @@ describe "generic API" do before do @def = Representable::Definition.new(:songs) end + describe "DCI" do + it "responds to #representer_module" do + assert_equal nil, Representable::Definition.new(:song).representer_module + assert_equal Hash, Representable::Definition.new(:song, :extend => Hash).representer_module + end + end + it "responds to #typed?" do assert ! @def.typed? - assert Representable::Definition.new(:songs, :as => Hash).typed? + assert Representable::Definition.new(:songs, :class => Hash).typed? end it "responds to #getter and returns string" do assert_equal "songs", @def.getter end @@ -66,12 +73,12 @@ it "responds to #default" do assert_equal [], @def.default end end - describe ":as => Item" do + describe ":class => Item" do before do - @def = Representable::Definition.new(:songs, :as => Hash) + @def = Representable::Definition.new(:songs, :class => Hash) end it "responds to #sought_type" do assert_equal Hash, @def.sought_type end