test/support_test.rb in link2-0.1.1 vs test/support_test.rb in link2-0.1.3

- old
+ new

@@ -5,15 +5,31 @@ def setup end test "#find_resource_class: should find proper class based on class, class instance, or (symbol) name" do + assert_nil ::Link2::Support.find_resource_class(nil) + assert_equal ::Fraggle, ::Link2::Support.find_resource_class(::Fraggle) assert_equal ::Fraggle, ::Link2::Support.find_resource_class(::Fraggle.new) assert_equal ::Fraggle, ::Link2::Support.find_resource_class(:fraggle) assert_not_equal ::Fraggle, ::Link2::Support.find_resource_class(::Unicorn) assert_not_equal ::Fraggle, ::Link2::Support.find_resource_class(::Unicorn.new) assert_not_equal ::Fraggle, ::Link2::Support.find_resource_class(:unicorn) + end + + test "#resource_identifier_class?: should only be true for valid classes" do + assert ::Link2::Support.resource_identifier_class?(nil) + assert ::Link2::Support.resource_identifier_class?(:hello) + assert ::Link2::Support.resource_identifier_class?(::Fraggle) + + assert_not ::Link2::Support.resource_identifier_class?(::Unicorn) + end + + test "#record_class?: should only be true for record classes" do + assert ::Link2::Support.record_class?(::Fraggle) + + assert_not ::Link2::Support.record_class?(::Unicorn) end end \ No newline at end of file