oneWorkingHeadphone
oneWorkingHeadphone

Reputation: 899

What is the standard testing suite that ships with Rails 5 called?

I feel like it shouldn't be this confusing (which might just mean I'm looking in the wrong place), but what is the standard testing suite for Rails called?

I thought it was Test::Unit, but the last mention I find of that is in v3.2.8? The Railsguides testing page says "Rails Meets Minitest" but I don't know if that means they both work or one is the other. There is also a minitest-rails gem which makes it seem like you need a separate gem to run minitest.

I seem to be in the minority not using RSpec so I'd like to be able to properly ask/search for the right testing suite when I have questions.

Upvotes: 0

Views: 54

Answers (2)

Julius Dzidzevičius
Julius Dzidzevičius

Reputation: 11000

MiniTest replaced Test::Unit and now also comes preinstalled with Ruby.

https://ruby-doc.org/stdlib-2.1.1/libdoc/test/unit/rdoc/Test/Unit.html

Test::Unit is an implementation of the xUnit testing framework for Ruby.

If you are writing new test code, please use MiniTest instead of Test::Unit.

Test::Unit has been left in the standard library to support legacy test suites.

Upvotes: 1

Sergio Tulentsev
Sergio Tulentsev

Reputation: 230461

ActiveSupport::TestCase is inherited from Minitest::Test.

AND it uses itself for its own tests: https://github.com/rails/rails/blob/34fe2a4fc778d18b7fe6bdf3629c1481bee789b9/activesupport/test/test_case_test.rb

Pretty meta, huh? :)

Upvotes: 3

Related Questions