forked from rails/webpacker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand_test.rb
More file actions
33 lines (29 loc) · 940 Bytes
/
Copy pathcommand_test.rb
File metadata and controls
33 lines (29 loc) · 940 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require "test_helper"
class CommandTest < Minitest::Test
def test_compile_command_returns_success_status_when_stale
Webpacker.compiler.stub :stale?, true do
Webpacker.compiler.stub :run_webpack, true do
assert_equal true, Webpacker.commands.compile
end
end
end
def test_compile_command_returns_success_status_when_fresh
Webpacker.compiler.stub :stale?, false do
Webpacker.compiler.stub :run_webpack, true do
assert_equal true, Webpacker.commands.compile
end
end
end
def test_compile_command_returns_failure_status_when_stale
Webpacker.compiler.stub :stale?, true do
Webpacker.compiler.stub :run_webpack, false do
assert_equal false, Webpacker.commands.compile
end
end
end
def test_clean_command_works_with_nested_hashes_and_without_any_compiled_files
File.stub :delete, true do
assert Webpacker.commands.clean
end
end
end