spec/extensions/auto_validations_spec.rb in sequel-4.43.0 vs spec/extensions/auto_validations_spec.rb in sequel-4.44.0
- old
+ new
@@ -187,6 +187,14 @@
@m = sc.new
@m.set(:name=>1, :num=>1, :d=>Date.today)
@m.valid?.must_equal false
@m.errors.must_equal([:name, :num]=>["u_message"])
end
+
+ it "should not allow modifying auto validation information for frozen model classes" do
+ @c.freeze
+ @c.auto_validate_not_null_columns.frozen?.must_equal true
+ @c.auto_validate_explicit_not_null_columns.frozen?.must_equal true
+ @c.auto_validate_max_length_columns.frozen?.must_equal true
+ @c.auto_validate_unique_columns.frozen?.must_equal true
+ end
end