From 069514128283fb1ea1f4580d827c7bdc88ef1d21 Mon Sep 17 00:00:00 2001 From: Carlos Palhares Date: Thu, 8 Feb 2024 12:01:55 -0300 Subject: [PATCH] Avoid double definition of shared examples --- spec/lhm/adapter/add_column_spec.rb | 1 - spec/lhm/adapter/change_column_spec.rb | 1 - spec/spec_helper.rb | 1 + .../shared_examples/column_definition_method.rb} | 1 - 4 files changed, 1 insertion(+), 3 deletions(-) rename spec/{lhm/adapter/shared_example_column_definition_method_spec.rb => support/shared_examples/column_definition_method.rb} (98%) diff --git a/spec/lhm/adapter/add_column_spec.rb b/spec/lhm/adapter/add_column_spec.rb index 1592cdea..42ec3357 100644 --- a/spec/lhm/adapter/add_column_spec.rb +++ b/spec/lhm/adapter/add_column_spec.rb @@ -1,5 +1,4 @@ require 'spec_helper' -require 'lhm/adapter/shared_example_column_definition_method_spec' describe Lhm::Adapter, '#add_column' do it_behaves_like 'column-definition method', :add_column diff --git a/spec/lhm/adapter/change_column_spec.rb b/spec/lhm/adapter/change_column_spec.rb index 626ecfd5..7d55142b 100644 --- a/spec/lhm/adapter/change_column_spec.rb +++ b/spec/lhm/adapter/change_column_spec.rb @@ -1,5 +1,4 @@ require 'spec_helper' -require 'lhm/adapter/shared_example_column_definition_method_spec' describe Lhm::Adapter, '#change_column' do it_behaves_like 'column-definition method', :change_column diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e1c522b1..1a71be76 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -15,6 +15,7 @@ require 'support/matchers/have_column' require 'support/matchers/have_index' require 'support/matchers/have_foreign_key_on' +require 'support/shared_examples/column_definition_method' require 'support/table_methods' db_config = Configuration.new diff --git a/spec/lhm/adapter/shared_example_column_definition_method_spec.rb b/spec/support/shared_examples/column_definition_method.rb similarity index 98% rename from spec/lhm/adapter/shared_example_column_definition_method_spec.rb rename to spec/support/shared_examples/column_definition_method.rb index c5b8c542..7a67f11e 100644 --- a/spec/lhm/adapter/shared_example_column_definition_method_spec.rb +++ b/spec/support/shared_examples/column_definition_method.rb @@ -1,4 +1,3 @@ -# TODO: What about ENUM? shared_examples 'column-definition method' do |method_name| let(:migration) { double(:migration) } let(:table_name) { :comments }