Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Jun 7, 2024
1 parent 07e9916 commit 6dc09bf
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion railties/test/generators/app_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ def test_app_update_preserves_sprockets
FileUtils.cd(destination_root) do
config = "config/environments/production.rb"
assert_no_changes -> { File.readlines(config).grep(/config\.assets/) } do
run_app_update
run_app_update_debug
end
end
end
Expand Down Expand Up @@ -1489,6 +1489,16 @@ def run_app_update(app_root = destination_root, flags: "--force")
end
end

def run_app_update_debug(app_root = destination_root, flags: "--force")
Dir.chdir(app_root) do
gemfile_contents = File.read("Gemfile")
gemfile_contents.sub!(/^(gem "rails").*/, "\\1, path: #{File.expand_path("../../..", __dir__).inspect}")
File.write("Gemfile", gemfile_contents)

system({ "BUNDLE_GEMFILE" => "Gemfile" }, "bin/rails app:update #{flags} --trace", exception: true)
end
end

def action(*args, &block)
capture(:stdout) { generator.send(*args, &block) }
end
Expand Down

0 comments on commit 6dc09bf

Please sign in to comment.