Repository navigation
Bring the Rake task into Rubytest - #13
Merged
Merged
Conversation
Add rubytest/rake with Test::Rake::TestTask, from rubytest-rake 0.2.0. Check the forked run's exit status, so the task fails when the run does: rubytest-rake waited for the child and then always exited 0. Use only the default globs that match a file, since the runner now fails a glob that matches nothing. Let TEST replace the task's files for one invocation. Drop the shell mode, which called an undefined method. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
rubytest/rakewithTest::Rake::TestTask, brought in from rubytest-rake 0.2.0, so the task no longer needs a separate gem.Differences from rubytest-rake
rake testexited 0 on failing or crashing tests. The task now exits 1.TESTreplaces the task's files for one invocation (rake test TEST=test/foo_test.rb). In rubytest-rake it replaced only the defaults, and files added in the block still ran.mode == 'shell'calledrun_shell, which was never defined.Config#modeitself is untouched.Rake stays a development dependency: anything that requires
rubytest/rakealready has it.Testing
bundle exec rake test: 6 demos, 46 steps, 122 assertions, all passing on Ruby 3.4.9, and the same in aruby:2.7container.demo/06_rake_task.mdis new and covers a passing run, a failing run, the default globs, no files found, andTEST.rake: exit 1 with a failing test, exit 0 withTESTpointing at a passing file, and the task listed byrake -T.fork; that path runs the tests in Rake's own process.🤖 Generated with Claude Code