Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoroth committed May 2, 2024
1 parent 73a3b7a commit 388934c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/generators/stimulus_reflex_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
require "stimulus_reflex/installer"

def stub_entrypoint(path = "tmp/app/javascript")
File.write(installer_entrypoint_path, path)
File.write(StimulusReflex::Installer.installer_entrypoint_path, path)
end

def stub_bundler(bundler = "importmaps")
File.write(installer_bundler_path, bundler)
File.write(StimulusReflex::Installer.installer_bundler_path, bundler)
end

class StimulusReflexGeneratorTest < Rails::Generators::TestCase
Expand All @@ -19,15 +19,15 @@ class StimulusReflexGeneratorTest < Rails::Generators::TestCase
setup :prepare_destination

setup do
File.delete(installer_entrypoint_path) if File.exist?(installer_entrypoint_path)
File.delete(installer_bundler_path) if File.exist?(installer_bundler_path)
File.delete(StimulusReflex::Installer.installer_entrypoint_path) if File.exist?(StimulusReflex::Installer.installer_entrypoint_path)
File.delete(StimulusReflex::Installer.installer_bundler_path) if File.exist?(StimulusReflex::Installer.installer_bundler_path)
FileUtils.rm_rf("tmp/app")
FileUtils.rm_rf("tmp/stimulus_reflex_installer")
end

teardown do
File.delete(installer_entrypoint_path) if File.exist?(installer_entrypoint_path)
File.delete(installer_bundler_path) if File.exist?(installer_bundler_path)
File.delete(StimulusReflex::Installer.installer_entrypoint_path) if File.exist?(StimulusReflex::Installer.installer_entrypoint_path)
File.delete(StimulusReflex::Installer.installer_bundler_path) if File.exist?(StimulusReflex::Installer.installer_bundler_path)
FileUtils.rm_rf("tmp/app")
FileUtils.rm_rf("tmp/stimulus_reflex_installer")
end
Expand Down

0 comments on commit 388934c

Please sign in to comment.