Move JRuby's Ant integration specs here as minitest tests - #6
Merged
Merged
Conversation
This was referenced Oct 1, 2026
Member
Yeah it probably can be removed at this point, It was just dragged along as a legacy feature for a long time. Anyone who still wants it can use the gem.
Let's just drop the jarjar stuff altogether.
Fix it if possible or remove it, since it's not testing what it claims. |
headius
reviewed
Oct 1, 2026
headius
left a comment
Member
There was a problem hiding this comment.
Basically approved modulo the couple of questions answered in my previous comment.
JRuby tested this gem with RSpec specs under spec/java_integration/ant, which made Ant a requirement for JRuby's own test suite. Port them here as minitest tests so JRuby can drop them, and convert the existing test-unit test to minitest as well. - test/ant_test_helper.rb replaces ant_spec_helper.rb; the RSpec structure matcher becomes assert_structure/assert_configured_structure - the Ant.load tests stub File.exist? with minitest-mock - the jarjar examples are dropped, since they needed a third-party jar; the jar examples still cover structure matching - target_spec's "does not support ant" example passed only by accident; it now runs Ant's <ant> task against a temporary buildfile - add a GitHub Actions workflow running `rake test` on JRuby with Ant - relax the bundler development dependency so current Bundler works Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zev
force-pushed
the
move-jruby-ant-specs
branch
from
October 2, 2026 01:14
d8728ac to
061cedf
Compare
Contributor
Author
|
Thanks! Done in 061cedf:
I'll remove rake-ant as a default gem on the JRuby side as part of jruby/jruby#9761. Generated by Claude Code |
zev
commented
Oct 2, 2026
zev
commented
Oct 2, 2026
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.
JRuby tested this gem with RSpec specs under
spec/java_integration/ant/, which made Ant a requirement for JRuby's own test suite. As discussed in jruby/jruby#9761, this moves those specs here so JRuby can drop them, and adds CI.What's here
ant_spec.rb→ the new classes intest/test_ant.rbproject_spec.rb→test/test_project.rbrake_spec.rb→test/test_rake.rbtarget_spec.rb→test/test_target.rbtask_spec.rb→test/test_task.rbtest/test_ant.rbtest is converted from test-unit to minitest. test-unit was never declared as a dependency, sobundle exec rake testcouldn't load it.test/ant_test_helper.rbreplaces JRuby'sant_spec_helper.rb. The RSpechave_structure/have_configured_structurematchers becomeassert_structure/assert_configured_structure, using the same matching code.minitestandminitest-mock. Minitest 6, which ships with Ruby 4.1, movedObject#stubinto the separate minitest-mock gem. TheAnt.loadtests use it in place of RSpec'sallow/expectonFile.exist?, and still assert thatJAVA_HOME,tools.jarandclasses.zipwere all checked.bundlerdev dependency is relaxed from~> 2.1to>= 2.1. With current Bundler (4.x, as shipped with JRuby)bundle installfailed outright..github/workflows/test.ymlrunsbundle exec rake testonjrubyandjruby-headwith Java 21 and Ant.Differences from the JRuby specs
jarjarexamples are dropped, as agreed in review. They defined a third-party Ant task withtaskdef, which needed jarjar 1.1 on disk. Thejarexamples still cover structure and configured-structure matching, and the tests need no downloads.target_spec's "does not support ant for calling other buildfiles" example is replaced. It builta = example_ant ...but then ranant.execute_target(:bar)on the globalant, so it passed only because the global project had no:bartarget. Ant's<ant>task is in fact supported, so the newtest_supports_ant_for_calling_other_buildfileswrites a temporary buildfile, calls it with<ant>from a Ruby-defined target, and asserts its target ran. Theantcallexample next to it is accurate:antcallfails because it tries to re-read the project'sbuild.xml, which a Ruby-defined project doesn't have.rake_spec.rb's top-leveldef import(*args); java_import(*args); endis not ported. Nothing here calls it, and in JRuby it leaked into other specs that loaded in the same process.message = "") are nowString.new, becauserake testruns with-wand they warn about frozen string literals.Testing
Locally with JRuby master (Java 21, Ant 1.10.18):
bundle exec rake test→ 30 runs, 65 assertions, 0 failures, 0 skips, no warnings. That's the 31 JRuby examples minus the 2 jarjar ones, plus the originalant_importtest.CI on my fork:
rake testpassed onjrubyandjruby-head.Co-authored with Claude Code.