Skip to content

Commit 76d9516

Browse files
committed
fix flappy test
1 parent 818aae4 commit 76d9516

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

test/generators/component_generator_test.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ class ComponentGeneratorTest < Rails::Generators::TestCase
77
setup :prepare_destination
88

99
test "Assert all files are properly created" do
10+
# reset engines
11+
Rails.application.config.app_generators.template_engine nil
12+
Rails.application.config.app_generators.stylesheet_engine nil
13+
Rails.application.config.app_generators.javascript_engine nil
14+
1015
run_generator %w( widget )
1116

1217
assert_file "app/components/widget/_widget.html.erb"
1318
assert_file "app/components/widget/widget.css"
1419
assert_file "app/components/widget/widget.js"
1520
assert_file "app/components/widget/widget.yml"
16-
# Delete generated files so the test don't fail if the order is random
17-
FileUtils.remove_dir(File.expand_path("../../tmp", __FILE__))
1821
end
1922

2023
test "Generates different engines" do
@@ -28,7 +31,5 @@ class ComponentGeneratorTest < Rails::Generators::TestCase
2831
assert_file "app/components/widget/widget.scss"
2932
assert_file "app/components/widget/widget.coffee"
3033
assert_file "app/components/widget/widget.yml"
31-
# Delete generated files so the test don't fail if the order is random
32-
FileUtils.remove_dir(File.expand_path("../../tmp", __FILE__))
3334
end
3435
end

0 commit comments

Comments
 (0)