Kérésre: minden magyarázó komment kikerült a forrásfájlokból — 89 Ruby, 16 TypeScript, 14 Vue, plusz a CSS/JS/CJS. Nem soralapú kereséssel: a Ruby-t a Ripper tokenizálta, a JS/TS/CSS-t állapotgép járta végig, hogy az URL-ekben, reguláris kifejezésekben és heredocokban álló // és # jelek helyükön maradjanak. Három komment maradt, mert nélkülük nem indul a kód: az entrypoint.sh shebangja, a vite-env.d.ts hármas perjeles referenciája, és a sanitize teszt @vitest-environment direktívája (ez utóbbi a magyarázó része nélkül). Egy helyen kódot is kellett írni: a CommandBlock másolás-hibaágán a komment volt a catch egyetlen tartalma, és üres blokkot az eslint nem enged — a copied jelző visszaállítása került a helyére. A yaml, Dockerfile, Makefile, erb és markdown fájlokat nem érintettem. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
31 lines
769 B
Ruby
31 lines
769 B
Ruby
require "spec_helper"
|
|
ENV["RAILS_ENV"] ||= "test"
|
|
require_relative "dummy/config/environment"
|
|
|
|
abort("The Rails environment is running in production mode!") if Rails.env.production?
|
|
require "rspec/rails"
|
|
|
|
begin
|
|
ActiveRecord::Migration.maintain_test_schema!
|
|
rescue ActiveRecord::PendingMigrationError => e
|
|
abort e.to_s.strip
|
|
end
|
|
|
|
FactoryBot.definition_file_paths = [ File.expand_path("factories", __dir__) ]
|
|
FactoryBot.reload
|
|
|
|
RSpec.configure do |config|
|
|
config.use_transactional_fixtures = true
|
|
config.infer_spec_type_from_file_location!
|
|
config.filter_rails_from_backtrace!
|
|
|
|
config.include FactoryBot::Syntax::Methods
|
|
end
|
|
|
|
Shoulda::Matchers.configure do |config|
|
|
config.integrate do |with|
|
|
with.test_framework :rspec
|
|
with.library :rails
|
|
end
|
|
end
|