Skip to content

Commit 2dec06c

Browse files
authored
chore: rename test_app_path -> path_to_test_app (avoids minitest warning) (#471)
1 parent a4f8c56 commit 2dec06c

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

test/config_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def assert_pathname(expected, actual)
1515
assert_equal Pathname.new(expand_path("test_app/#{ expected }")), actual
1616
end
1717

18-
def resolve_config(mode: 'production', root: test_app_path, **attrs)
18+
def resolve_config(mode: 'production', root: path_to_test_app, **attrs)
1919
ViteRuby::Config.resolve_config(mode: mode, root: root, **attrs)
2020
end
2121

test/engine_rake_tasks_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def remove_vite_files
180180
[app_frontend_dir, app_public_dir, app_ssr_dir, tmp_dir].each do |dir|
181181
dir.rmtree if dir.exist?
182182
end
183-
root_dir.join('app/views/layouts/application.html.erb').write(Pathname.new(test_app_path).join('app/views/layouts/application.html.erb').read)
183+
root_dir.join('app/views/layouts/application.html.erb').write(Pathname.new(path_to_test_app).join('app/views/layouts/application.html.erb').read)
184184
gitignore_path.write('')
185185
@command_results = []
186186
end

test/rake_tasks_test.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
class RakeTasksTest < ViteRuby::Test
66
def test_rake_tasks
77
assert ViteRuby.install_tasks
8-
output = Dir.chdir(test_app_path) { `rake -T` }
8+
output = Dir.chdir(path_to_test_app) { `rake -T` }
99
assert_includes output, 'vite:build'
1010
assert_includes output, 'vite:build_ssr'
1111
assert_includes output, 'vite:clean'
@@ -15,15 +15,15 @@ def test_rake_tasks
1515
end
1616

1717
def test_rake_task_vite_check_binstubs
18-
output = Dir.chdir(test_app_path) { `rake vite:verify_install 2>&1` }
18+
output = Dir.chdir(path_to_test_app) { `rake vite:verify_install 2>&1` }
1919
refute_includes output, 'vite binstub not found.'
2020
end
2121

2222
def test_rake_vite_install_dependencies_in_non_production_environments
2323
assert_includes test_app_dev_dependencies, 'right-pad'
2424

2525
ViteRuby.commands.send(:with_node_env, 'test') do
26-
Dir.chdir(test_app_path) do
26+
Dir.chdir(path_to_test_app) do
2727
`bundle exec rake vite:install_dependencies`
2828
end
2929
end
@@ -34,7 +34,7 @@ def test_rake_vite_install_dependencies_in_non_production_environments
3434

3535
def test_rake_vite_install_dependencies_in_production_environment
3636
ViteRuby.commands.send(:with_node_env, 'production') do
37-
Dir.chdir(test_app_path) do
37+
Dir.chdir(path_to_test_app) do
3838
`bundle exec rake vite:install_dependencies`
3939
end
4040
end
@@ -45,17 +45,17 @@ def test_rake_vite_install_dependencies_in_production_environment
4545

4646
private
4747

48-
def test_app_path
48+
def path_to_test_app
4949
File.expand_path('test_app', __dir__)
5050
end
5151

5252
def test_app_dev_dependencies
53-
package_json = File.expand_path('package.json', test_app_path)
53+
package_json = File.expand_path('package.json', path_to_test_app)
5454
JSON.parse(File.read(package_json))['devDependencies']
5555
end
5656

5757
def installed_node_module_names
58-
node_modules_path = File.expand_path('node_modules', test_app_path)
58+
node_modules_path = File.expand_path('node_modules', path_to_test_app)
5959
Dir.chdir(node_modules_path) { Dir.glob('*') }
6060
end
6161
end

test/test_helper.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def with_rails_env(env)
4444
refresh_config
4545
end
4646

47-
def test_app_path
47+
def path_to_test_app
4848
File.expand_path('test_app', __dir__)
4949
end
5050

@@ -70,7 +70,7 @@ def stub_builder(build_errors: '', build_successful: build_errors.empty?, stale:
7070
end
7171

7272
def assert_run_command(*argv, flags: [])
73-
Dir.chdir(test_app_path) {
73+
Dir.chdir(path_to_test_app) {
7474
begin
7575
mock = Minitest::Mock.new
7676
mock.expect(:call, nil, [ViteRuby.config.to_env, %r{node_modules/.bin/vite}, *argv, *flags])

0 commit comments

Comments
 (0)