Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Judahmeek committed May 13, 2024
1 parent 5fd5f9f commit 39fea63
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion LintingGemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

source "http://rubygems.org"
# To install gems from this Gemfile locally, use BUNDLE_GEMFILE=./LintingGemfile
# To install gems from this Gemfile locally, use BUNDLE_GEMFILE=./LintingGemfile bundle exec rubocop
gem "rubocop"
gem "rubocop-minitest"
gem "rubocop-performance"
2 changes: 1 addition & 1 deletion test/react/server_rendering/exec_js_renderer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ExecJSRendererTest < ActiveSupport::TestCase
react_ujs_source = File.read(File.expand_path("../../../lib/assets/javascripts/react_ujs.js", __dir__))
todo_component_source = File.read(
File.expand_path(
"../../../dummy/app/assets/javascripts/components/PlainJSTodo.js", __FILE__
"../../dummy/app/assets/javascripts/components/PlainJSTodo.js", __dir__
)
)
code = react_server_source + react_ujs_source + todo_component_source
Expand Down
2 changes: 1 addition & 1 deletion test/react_asset_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ReactAssetTest < ActionDispatch::IntegrationTest
end

test "asset pipeline should deliver drop-in react file replacement" do
app_react_file_path = File.expand_path("../dummy/vendor/assets/javascripts/react.js", __FILE__)
app_react_file_path = File.expand_path("dummy/vendor/assets/javascripts/react.js", __dir__)
react_file_token = "'test_confirmation_token_react_content_non_production';\n"
File.write(app_react_file_path, react_file_token)
SprocketsHelpers.manually_expire_asset("react.js")
Expand Down
4 changes: 2 additions & 2 deletions test/server_rendered_html_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ def wait_to_ensure_asset_pipeline_detects_changes
if ShakapackerHelpers.available?
file_with_updates = File.expand_path("helper_files/TodoListWithUpdates.js", __dir__)
file_without_updates = File.expand_path("helper_files/TodoListWithoutUpdates.js", __dir__)
app_file = File.expand_path("../dummy/app/javascript/components/TodoList.js", __FILE__)
app_file = File.expand_path("dummy/app/javascript/components/TodoList.js", __dir__)
else
file_with_updates = File.expand_path("helper_files/TodoListWithUpdates.js.jsx", __dir__)
file_without_updates = File.expand_path("helper_files/TodoListWithoutUpdates.js.jsx", __dir__)
app_file = File.expand_path("../dummy/app/assets/javascripts/components/TodoList.js.jsx", __FILE__)
app_file = File.expand_path("dummy/app/assets/javascripts/components/TodoList.js.jsx", __dir__)
end

FileUtils.cp app_file, file_without_updates
Expand Down
4 changes: 2 additions & 2 deletions test/support/sprockets_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ def precompile_assets
Rails.application.assets_manifest = new_manifest
end

assets_directory = File.expand_path("../../dummy/public/assets", __FILE__)
assets_directory = File.expand_path("../dummy/public/assets", __dir__)
raise "Asset precompilation failed" unless Dir.exist?(assets_directory)
end

def clear_precompiled_assets
assets_directory = File.expand_path("../../dummy/public/assets", __FILE__)
assets_directory = File.expand_path("../dummy/public/assets", __dir__)
FileUtils.rm_r(assets_directory)
ENV.delete("RAILS_GROUPS")
end
Expand Down
3 changes: 1 addition & 2 deletions test/support/webpacker_helpers.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# frozen_string_literal: true

module ShakapackerHelpers
PACKS_DIRECTORY = File.expand_path("../../dummy/public/packs", __FILE__)
PACKS_DIRECTORY = File.expand_path("../dummy/public/packs", __dir__)

module_function

def available?
puts "ShakapackerHerlpers.available? #{!!defined?(Shakapacker)}"
!!defined?(Shakapacker)
end

Expand Down
4 changes: 2 additions & 2 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Configure Rails Environment
ENV["RAILS_ENV"] = "test"

require File.expand_path("../dummy/config/environment.rb", __FILE__)
require File.expand_path("dummy/config/environment.rb", __dir__)
require "rails/test_help"
require "rails/generators"
require "pathname"
Expand All @@ -36,7 +36,7 @@
Capybara.javascript_driver = :headless_chrome
Capybara.current_driver = Capybara.javascript_driver

CACHE_PATH = Pathname.new File.expand_path("../dummy/tmp/cache", __FILE__)
CACHE_PATH = Pathname.new File.expand_path("dummy/tmp/cache", __dir__)

Rails.backtrace_cleaner.remove_silencers!

Expand Down

0 comments on commit 39fea63

Please sign in to comment.