From cdd2f047229fc4977c3f8035c54a6619920ec338 Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Fri, 22 Sep 2023 10:29:07 +0200 Subject: [PATCH] Use interpolation instead of join in specs --- spec/chrono_model/adapter/ddl_spec.rb | 4 ++-- spec/chrono_model/time_machine/timestamps_spec.rb | 6 +++--- spec/support/matchers/table.rb | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/chrono_model/adapter/ddl_spec.rb b/spec/chrono_model/adapter/ddl_spec.rb index e446eadc..92ba5995 100644 --- a/spec/chrono_model/adapter/ddl_spec.rb +++ b/spec/chrono_model/adapter/ddl_spec.rb @@ -7,8 +7,8 @@ include ChronoTest::Adapter::Helpers include ChronoTest::Adapter::Structure - let(:current) { [ChronoModel::Adapter::TEMPORAL_SCHEMA, table].join('.') } - let(:history) { [ChronoModel::Adapter::HISTORY_SCHEMA, table].join('.') } + let(:current) { "#{ChronoModel::Adapter::TEMPORAL_SCHEMA}.#{table}" } + let(:history) { "#{ChronoModel::Adapter::HISTORY_SCHEMA}.#{table}" } def count(table) adapter.select_value("SELECT COUNT(*) FROM ONLY #{table}").to_i diff --git a/spec/chrono_model/time_machine/timestamps_spec.rb b/spec/chrono_model/time_machine/timestamps_spec.rb index 728c71ad..ca668482 100644 --- a/spec/chrono_model/time_machine/timestamps_spec.rb +++ b/spec/chrono_model/time_machine/timestamps_spec.rb @@ -13,7 +13,7 @@ let(:record) { $t.foo.history.first } (history_methods + current_methods).each do |attr| - describe ['#', attr].join do + describe "##{attr}" do subject { record.public_send(attr) } it { is_expected.to be_present } @@ -27,7 +27,7 @@ let(:record) { $t.foo } history_methods.each do |attr| - describe ['#', attr].join do + describe "##{attr}" do subject(:attribute) { record.public_send(attr) } it { expect { attribute }.to raise_error(NoMethodError) } @@ -35,7 +35,7 @@ end current_methods.each do |attr| - describe ['#', attr].join do + describe "##{attr}" do subject { record.public_send(attr) } it { is_expected.to be_nil } diff --git a/spec/support/matchers/table.rb b/spec/support/matchers/table.rb index 15d26b8a..92470c6d 100644 --- a/spec/support/matchers/table.rb +++ b/spec/support/matchers/table.rb @@ -148,7 +148,7 @@ def has_history_indexes? AND tablename = ? SQL - fqtn = [history_schema, table].join('.') + fqtn = "#{history_schema}.#{table}" expected = [ "CREATE INDEX index_#{table}_temporal_on_lower_validity ON #{fqtn} USING btree (lower(validity))", @@ -169,7 +169,7 @@ def has_consistency_constraint? binds = { conname: connection.timeline_consistency_constraint_name(table), connamespace: history_schema, - conrelid: [history_schema, table].join('.'), + conrelid: "#{history_schema}.#{table}", attname: connection.primary_key(table) }