test/unit/specialization_test.rb in rails-erd-0.4.5 vs test/unit/specialization_test.rb in rails-erd-1.0.0
- old
+ new
@@ -6,11 +6,11 @@
create_specialization
domain = Domain.generate
assert_match %r{#<RailsERD::Domain::Specialization:.* @generalized=Beverage @specialized=Beer>},
Domain::Specialization.new(domain, domain.entity_by_name("Beverage"), domain.entity_by_name("Beer")).inspect
end
-
+
test "generalized should return source entity" do
create_specialization
domain = Domain.generate
assert_equal domain.entity_by_name("Beverage"),
Domain::Specialization.new(domain, domain.entity_by_name("Beverage"), domain.entity_by_name("Beer")).generalized
@@ -20,11 +20,11 @@
create_specialization
domain = Domain.generate
assert_equal domain.entity_by_name("Beer"),
Domain::Specialization.new(domain, domain.entity_by_name("Beverage"), domain.entity_by_name("Beer")).specialized
end
-
+
# Specialization properties ================================================
test "inheritance should be true for inheritance specializations" do
create_specialization
assert_equal [true], Domain.generate.specializations.map(&:inheritance?)
end
@@ -41,10 +41,10 @@
test "polymorphic should be true for polymorphic specializations" do
create_generalization
assert_equal [true], Domain.generate.specializations.map(&:polymorphic?)
end
-
+
test "inheritance should be false for polymorphic specializations to specialized entities" do
create_model "Cannon"
create_model "Ship", :type => :string
create_model "Galleon", Ship do
has_many :cannons, :as => :defensible