Skip to content

Commit 4252851

Browse files
committed
Ensure connection is established where necessary
1 parent 92e0f92 commit 4252851

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

ruby_event_store-active_record/spec/rails_event_id_index_migration_generator_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
module RubyEventStore
88
module ActiveRecord
99
::RSpec.describe RailsEventIdIndexMigrationGenerator do
10+
helper = SpecHelper.new
11+
1012
around { |example| SilenceStdout.silence_stdout { example.run } }
1113

1214
around do |example|
@@ -26,6 +28,8 @@ module ActiveRecord
2628
end
2729

2830
it "uses particular migration version" do
31+
helper.establish_database_connection
32+
2933
expect(subject).to include("ActiveRecord::Migration[#{::ActiveRecord::Migration.current_version}]")
3034
end
3135
end

ruby_event_store-active_record/spec/rails_foreign_key_on_event_id_migration_generator_spec.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# frozen_string_literal: true
22

33
require "spec_helper"
4-
require "pp"
54
require_relative "../../support/helpers/silence_stdout"
65

76
module RubyEventStore
87
module ActiveRecord
98
::RSpec.describe RailsForeignKeyOnEventIdMigrationGenerator do
9+
helper = SpecHelper.new
10+
1011
around { |example| SilenceStdout.silence_stdout { example.run } }
1112

1213
around do |example|
@@ -26,6 +27,8 @@ module ActiveRecord
2627
end
2728

2829
it "uses particular migration version" do
30+
helper.establish_database_connection
31+
2932
expect(subject).to include("ActiveRecord::Migration[#{::ActiveRecord::Migration.current_version}]")
3033
end
3134

0 commit comments

Comments
 (0)