Skip to content

Commit

Permalink
Merge pull request #2798 from rspec/fix-rails-main-for-solid-cache
Browse files Browse the repository at this point in the history
Fix rails main for solid cache
  • Loading branch information
JonRowe committed Sep 5, 2024
1 parent bc6dfc7 commit 5280ba1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
14 changes: 12 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ namespace :smoke do
in_example_app args.cmd.to_s
end

desc "run rake routes in example app"
task :routes do
in_example_app "bin/rails routes"
end

desc "run RSPEC_OPTS environment variable in the example app for local dev"
task :rspec do
in_example_app "LOCATION='../../example_app_generator/run_specs.rb' bin/rspec #{ENV.fetch("RSPEC_OPTS")}"
Expand Down Expand Up @@ -144,6 +149,11 @@ namespace :no_active_record do
"no_active_record:smoke",
]

desc "run rake routes in example app"
task :routes do
in_example_app "bin/rails routes", app_dir: example_app_dir
end

desc "run RSPEC_OPTS environment variable in the example app for local dev"
task :rspec do
in_example_app "LOCATION='../../example_app_generator/run_specs.rb' bin/rspec #{ENV.fetch("RSPEC_OPTS")}", app_dir: example_app_dir
Expand All @@ -165,7 +175,7 @@ namespace :no_active_record do
sh "rm -f #{bindir}/rails"
sh "bundle exec rails new #{example_app_dir} --no-rc --skip-active-record --skip-javascript --skip-bootsnap " \
"--skip-sprockets --skip-git --skip-test-unit --skip-listen --skip-bundle --skip-spring " \
"--skip-action-text --template=example_app_generator/generate_app.rb"
"--skip-action-text --skip-solid --template=example_app_generator/generate_app.rb"

in_example_app(app_dir: example_app_dir) do
sh "./ci_retry_bundle_install.sh 2>&1"
Expand All @@ -188,7 +198,7 @@ namespace :no_active_record do

desc "generate a bunch of stuff with generators"
task :stuff do
in_example_app "bin/rake #{rails_template_command} LOCATION='../../example_app_generator/generate_stuff.rb'", app_dir: example_app_dir
in_example_app "bin/rake #{rails_template_command} LOCATION='../../example_app_generator/generate_stuff.rb' __RSPEC_NO_AR=true", app_dir: example_app_dir
end
end
end
Expand Down
6 changes: 3 additions & 3 deletions example_app_generator/generate_stuff.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ def skip_active_record?
end

def self.environment_hooks
if defined?(ActiveRecord)
AR
else
if ENV['__RSPEC_NO_AR']
NoAR
else
AR
end
end
end
Expand Down

0 comments on commit 5280ba1

Please sign in to comment.