spec/dbee/model/constraints_spec.rb in dbee-2.1.1 vs spec/dbee/model/constraints_spec.rb in dbee-3.0.0
- old
+ new
@@ -7,17 +7,16 @@
# LICENSE file in the root directory of this source tree.
#
require 'spec_helper'
-describe Dbee::Model::Constraints do
- CONSTRAINT_CONFIG = { name: :a }.freeze
+CONSTRAINT_CONFIG = { name: :a }.freeze
+CONSTRAINT_FACTORIES = {
+ Dbee::Model::Constraints::Reference => CONSTRAINT_CONFIG.merge(parent: :b, type: :reference),
+ Dbee::Model::Constraints::Static => CONSTRAINT_CONFIG.merge(value: :b, type: :static)
+}.freeze
- CONSTRAINT_FACTORIES = {
- Dbee::Model::Constraints::Reference => CONSTRAINT_CONFIG.merge(parent: :b, type: :reference),
- Dbee::Model::Constraints::Static => CONSTRAINT_CONFIG.merge(value: :b, type: :static)
- }.freeze
-
+describe Dbee::Model::Constraints do
CONSTRAINT_FACTORIES.each_pair do |constant, config|
it "should instantiate #{constant} objects" do
expect(described_class.make(config)).to be_a(constant)
end
end