From d480b5cc7c98da9c3f274de8445d5ff3356d816a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Busqu=C3=A9?= Date: Sun, 28 Apr 2019 16:14:00 +0200 Subject: [PATCH] Adapt test suite to attr alias being an option --- core/spec/unit/rom/plugins/command/alias_spec.rb | 2 +- core/spec/unit/rom/schema_spec.rb | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/spec/unit/rom/plugins/command/alias_spec.rb b/core/spec/unit/rom/plugins/command/alias_spec.rb index 1b722a566..40506a94e 100644 --- a/core/spec/unit/rom/plugins/command/alias_spec.rb +++ b/core/spec/unit/rom/plugins/command/alias_spec.rb @@ -10,7 +10,7 @@ before do configuration.relation :users do schema(:users) do - attribute :first_name, Types::String.meta(alias: :name) + attribute :first_name, Types::String, alias: :name end end diff --git a/core/spec/unit/rom/schema_spec.rb b/core/spec/unit/rom/schema_spec.rb index 049f9664f..81572cc6f 100644 --- a/core/spec/unit/rom/schema_spec.rb +++ b/core/spec/unit/rom/schema_spec.rb @@ -70,8 +70,11 @@ describe '#alias_mapping' do it 'returns a hash from canonical name to alias including aliased attributes' do - attrs = { id: ROM::Types::Integer.meta(name: :id, alias: :pk), name: ROM::Types::String } - schema = ROM::Schema.define(:name, attributes: attrs.values) + attrs = [ + define_attr_info(:Integer, name: :id, alias: :pk), + define_attr_info(:String, name: :name) + ] + schema = ROM::Schema.define(:name, attributes: attrs) expect(schema.alias_mapping).to eq(id: :pk) end