Skip to content

Commit 15d50c6

Browse files
replace adapter test DSL with shared contexts (#347)
Co-authored-by: Geremia Taglialatela <tagliala@users.noreply.github.com>
1 parent 26ad9b5 commit 15d50c6

7 files changed

Lines changed: 179 additions & 179 deletions

File tree

spec/chrono_model/adapter/base_spec.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
require 'support/adapter/structure'
55

66
RSpec.describe ChronoModel::Adapter do
7-
include ChronoTest::Adapter::Helpers
87
include ChronoTest::Adapter::Structure
98

109
subject { adapter }
@@ -112,11 +111,15 @@
112111
describe '.is_chrono?' do
113112
subject(:is_chrono?) { adapter.is_chrono?(table) }
114113

115-
with_temporal_table do
114+
context 'with temporal tables' do
115+
include_context 'with temporal tables'
116+
116117
it { is_expected.to be true }
117118
end
118119

119-
with_plain_table do
120+
context 'with plain tables' do
121+
include_context 'with plain tables'
122+
120123
it { is_expected.to be false }
121124
end
122125

spec/chrono_model/adapter/ddl_spec.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
require 'support/adapter/structure'
55

66
RSpec.describe ChronoModel::Adapter do
7-
include ChronoTest::Adapter::Helpers
87
include ChronoTest::Adapter::Structure
98

109
let(:current) { "#{ChronoModel::Adapter::TEMPORAL_SCHEMA}.#{table}" }
@@ -188,7 +187,7 @@ def ids(table)
188187
end
189188

190189
describe 'schema changes' do
191-
table 'journaled_things'
190+
let(:table) { 'journaled_things' }
192191

193192
before do
194193
adapter.create_table table, temporal: true, journal: %w[foo] do |t|

spec/chrono_model/adapter/indexes_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
require 'support/adapter/structure'
55

66
RSpec.describe ChronoModel::Adapter do
7-
include ChronoTest::Adapter::Helpers
87
include ChronoTest::Adapter::Structure
98

109
before do

0 commit comments

Comments
 (0)