-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdotfile_test.rb
53 lines (42 loc) · 2.06 KB
/
dotfile_test.rb
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
require "test_helper"
class DotfileTest < Minitest::Test
def test_a_dotfile
result = TLDRunner.run_command("BUNDLE_GEMFILE=\"example/c/Gemfile\" bundle exec tldr --seed 1 --no-prepend --base-path example/c")
assert_empty result.stderr
assert_includes result.stdout, <<~MSG
👓
Command: bundle exec tldr --seed 1 --helper "spec/spec_helper.rb" --no-prepend --base-path "example/c" "spec/math_spec.rb"
🌱 --seed 1
🏃 Running:
😁
MSG
end
def test_no_dotfile_doesnt_load_those_settings
result = TLDRunner.run_command("bundle exec tldr --seed 1 --no-prepend --no-dotfile --base-path example/c")
assert_empty result.stderr
assert_includes result.stdout, <<~MSG
Command: bundle exec tldr --seed 1 --no-prepend --base-path "example/c" --no-dotfile
MSG
assert_includes result.stdout, "0 test methods"
end
def test_a_lot_of_values_in_a_dotfile
result = TLDRunner.run_command("bundle exec tldr --base-path example/d")
refute result.success?
assert_includes result.stdout, <<~MSG
Command: bundle exec tldr --seed 42 --verbose --helper "test_helper.rb" --load-path "app" --load-path "lib" --parallel --name "/test_*/" --name "test_it" --fail-fast --prepend "a.rb:3" --exclude-path "c.rb:4" --exclude-name "test_b_1" --base-path "example/d" "b.rb"
MSG
assert_includes result.stderr, <<~MSG
1) BTest#test_b_2 [b.rb:7] errored:
wups
Re-run this test:
bundle exec tldr --base-path "example/d" "b.rb:6"
MSG
end
def test_overriding_a_lot_of_values_in_a_dotfile
result = TLDRunner.run_command("bundle exec tldr --base-path example/d --seed 5 --load-path foo --no-parallel --name test_stuff --prepend nope --exclude-path nada --exclude-name test_b_2")
assert result.success?
assert_includes result.stdout, <<~MSG
Command: bundle exec tldr --seed 5 --verbose --helper "test_helper.rb" --load-path "foo" --name "test_stuff" --fail-fast --prepend "nope" --exclude-path "nada" --exclude-name "test_b_2" --base-path "example/d" "b.rb"
MSG
end
end