Skip to content

Commit

Permalink
Move the help tests to ruby bare app feature tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexB52 committed Dec 5, 2023
1 parent f3e541a commit f2e7042
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 20 deletions.
10 changes: 0 additions & 10 deletions features/rspec-ruby/retest/retest_test/flags_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,4 @@ def test_with_no_command

assert_match "Test File Selected: spec/bottles_spec.rb", @output.read
end

def test_help
@output, @pid = launch_retest 'retest --help'

assert_match <<~EXPECTED, @output.read
Usage: retest [OPTIONS] [COMMAND]
Watch a file change and run it matching spec.
EXPECTED
end
end
10 changes: 0 additions & 10 deletions features/ruby-app/retest/retest_test/flags_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,4 @@ def test_with_no_command

assert_match "Test File Selected: test/bottles_test.rb", @output.read
end

def test_help
@output, @pid = launch_retest 'retest --help'

assert_match <<~EXPECTED, @output.read
Usage: retest [OPTIONS] [COMMAND]
Watch a file change and run it matching spec.
EXPECTED
end
end
21 changes: 21 additions & 0 deletions features/ruby-bare/retest/flags/help.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
class TestHelpFlag < Minitest::Test
def test_help
@output, @pid = launch_retest 'retest --help'

assert_match <<~EXPECTED, @output.read
Usage: retest [OPTIONS] [COMMAND]
Watch a file change and run it matching spec.
EXPECTED
end

def test_help_short_flag
@output, @pid = launch_retest 'retest -h'

assert_match <<~EXPECTED, @output.read
Usage: retest [OPTIONS] [COMMAND]
Watch a file change and run it matching spec.
EXPECTED
end
end
2 changes: 2 additions & 0 deletions features/ruby-bare/retest/retest_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
require_relative 'scenarios/force_polling.rb'
require_relative 'scenarios/interruptions.rb'

require_relative 'flags/help.rb'

$stdout.sync = true

include FileHelper
Expand Down

0 comments on commit f2e7042

Please sign in to comment.