Skip to content

Commit f2e7042

Browse files
committed
Move the help tests to ruby bare app feature tests
1 parent f3e541a commit f2e7042

File tree

4 files changed

+23
-20
lines changed

4 files changed

+23
-20
lines changed

features/rspec-ruby/retest/retest_test/flags_test.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,4 @@ def test_with_no_command
1919

2020
assert_match "Test File Selected: spec/bottles_spec.rb", @output.read
2121
end
22-
23-
def test_help
24-
@output, @pid = launch_retest 'retest --help'
25-
26-
assert_match <<~EXPECTED, @output.read
27-
Usage: retest [OPTIONS] [COMMAND]
28-
29-
Watch a file change and run it matching spec.
30-
EXPECTED
31-
end
3222
end

features/ruby-app/retest/retest_test/flags_test.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,4 @@ def test_with_no_command
1919

2020
assert_match "Test File Selected: test/bottles_test.rb", @output.read
2121
end
22-
23-
def test_help
24-
@output, @pid = launch_retest 'retest --help'
25-
26-
assert_match <<~EXPECTED, @output.read
27-
Usage: retest [OPTIONS] [COMMAND]
28-
29-
Watch a file change and run it matching spec.
30-
EXPECTED
31-
end
3222
end
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
class TestHelpFlag < Minitest::Test
2+
def test_help
3+
@output, @pid = launch_retest 'retest --help'
4+
5+
assert_match <<~EXPECTED, @output.read
6+
Usage: retest [OPTIONS] [COMMAND]
7+
8+
Watch a file change and run it matching spec.
9+
EXPECTED
10+
end
11+
12+
def test_help_short_flag
13+
@output, @pid = launch_retest 'retest -h'
14+
15+
assert_match <<~EXPECTED, @output.read
16+
Usage: retest [OPTIONS] [COMMAND]
17+
18+
Watch a file change and run it matching spec.
19+
EXPECTED
20+
end
21+
end

features/ruby-bare/retest/retest_test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
require_relative 'scenarios/force_polling.rb'
1010
require_relative 'scenarios/interruptions.rb'
1111

12+
require_relative 'flags/help.rb'
13+
1214
$stdout.sync = true
1315

1416
include FileHelper

0 commit comments

Comments
 (0)