File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
lib/generators/rspec/install/templates/spec Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change 24
24
25
25
<% if RSpec::Rails::FeatureCheck.can_maintain_test_schema? -%>
26
26
# Checks for pending migrations and applies them before tests are run.
27
- # If you are not using ActiveRecord, you can remove this line.
28
- ActiveRecord::Migration.maintain_test_schema!
29
-
27
+ # If you are not using ActiveRecord, you can remove these lines.
28
+ begin
29
+ ActiveRecord::Migration.maintain_test_schema!
30
+ rescue ActiveRecord::PendingMigrationError => e
31
+ puts e.to_s.strip
32
+ exit 1
33
+ end
30
34
<% elsif RSpec::Rails::FeatureCheck.can_check_pending_migrations? -%>
31
35
# Checks for pending migrations before tests are run.
32
- # If you are not using ActiveRecord, you can remove this line.
33
- ActiveRecord::Migration.check_pending!
34
-
36
+ # If you are not using ActiveRecord, you can remove these lines.
37
+ begin
38
+ ActiveRecord::Migration.check_pending!
39
+ rescue ActiveRecord::PendingMigrationError => e
40
+ puts e.to_s.strip
41
+ exit 1
42
+ end
35
43
<% end -%>
36
44
RSpec.configure do |config|
37
45
<% if RSpec::Rails::FeatureCheck.has_active_record? -%>
You can’t perform that action at this time.
0 commit comments