Giter VIP home page Giter VIP logo

Comments (2)

blowmage avatar blowmage commented on July 3, 2024

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.

soulcutter avatar soulcutter commented on July 3, 2024

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.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.