Comments (3)
Minitest plugin system looks at all installed gems, so its possible you have a plugin installed that is altering the behavior.
Here is what your test looks like in a clean gemset on my system:
>> chruby 3.3.1
>> ruby -v
ruby 3.3.1 (2024-04-23 revision c56cd86388) [arm64-darwin23]
>> omg clean
Switching gemset to clean
>> gem install minitest
Fetching minitest-5.22.3.gem
Successfully installed minitest-5.22.3
1 gem installed
>> echo 'require "minitest/autorun"\n\nclass MyTestThatProducesADiff < Minitest::Test\n\n def test_diff\n assert_equal "Mayonnaise is delicious", "Mayonnaise is delicioous"\n end\nend' > clean_test.rb
>> cat clean_test.rb
require "minitest/autorun"
class MyTestThatProducesADiff < Minitest::Test
def test_diff
assert_equal "Mayonnaise is delicious", "Mayonnaise is delicioous"
end
end
>> ruby ./clean_test.rb
Run options: --seed 59813
# Running:
F
Finished in 0.000258s, 3875.9690 runs/s, 3875.9690 assertions/s.
1) Failure:
MyTestThatProducesADiff#test_diff [./clean_test.rb:6]:
Expected: "Mayonnaise is delicious"
Actual: "Mayonnaise is delicioous"
1 runs, 1 assertions, 1 failures, 0 errors, 0 skips
from minitest.
https://github.com/minitest/minitest?tab=readme-ov-file#writing-extensions-
➜ temp irb
>> Gem.find_files("minitest/*_plugin.rb")
=>
["/Users/bradleyschaefer/.asdf/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/minitest-5.22.3/lib/minitest/pride_plugin.rb",
"/Users/bradleyschaefer/.asdf/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/minitest-5.20.0/lib/minitest/pride_plugin.rb",
"/Users/bradleyschaefer/.asdf/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/railties-7.1.3.2/lib/minitest/rails_plugin.rb",
"/Users/bradleyschaefer/.asdf/installs/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/simplecov-0.22.0/lib/minitest/simplecov_plugin.rb"]
I don't suppose that behavior is up for re-examination. I will register my personal comment that the result of this design is behavior that I would not expect. Thanks.
from minitest.
I've spent several hours doubting my sanity because active_support
is getting loaded into a project's tests... for a project that has no non-default gems (only a source line in the Gemfile
at this point).
I feel like there's enough confusion over Ruby vs. Rails extensions to ruby without minitest
loading active_support
via the rails_plugin
just because the developer has installed a version of Rails without rails/rails#51718
from minitest.
Related Issues (20)
- `TestTask#make_test_cmd` has inadequate escaping HOT 1
- Please reconsider deprecating "assert_equal nil, ..." HOT 2
- Broken Parallelization in 5.25.0 HOT 16
- Mock Expect method be called Not work with method name :call HOT 1
- pride plugin crashing if `TERM` is unset HOT 3
- Mini
- Manifest
- New one
- Raise an exception when no tests are found HOT 2
- Have the changes in the git tag and/or the release on GitHub? HOT 10
- NoMethodError for parallel tests HOT 1
- skip_all option? HOT 2
- No relative test path output if `SyntaxError` is encountered HOT 2
- The added "did you mean" output if your `--name` filter matches nothing breaks the Minitest behaviour for multiple runs of the `Minitest.run` method HOT 6
- Skipped tests while building, "not yet" HOT 6
- Is 5.22.3 tag missing? HOT 2
- -Werror mode? - Turn warnings into errors HOT 4
- minitest/spec doesn't play well with rails in parallel tests HOT 1
- How do I define asserting helpers? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from minitest.