[RUBY] Rough difference between RSpec and minitest

Introduction

I often hear that the most commonly used testing framework in rails is RSpec. I summarized the differences from minitest that can be used with ruby standard.

About RSpec

The reason for using RSpec is "it's convenient because it has all the various functions from the beginning." If you want to share only this part of the test code, or if you want to do something a little elaborate with a mock, you can almost complete it with the standard functions of RSpec.

About minitest

It is used to check the operation of a simple Ruby program. It is installed in Ruby by default, so it is convenient to use immediately. If you try to do something as elaborate as RSpec, you will have to put in a lot of plugins, inheritance, modules, etc., so minitest is not often used in business level test code.

RSpec as an integrated testing environment

From a practical point of view, RSpec has some advantages over minitest. Whereas minitest is a "testing framework", Rspec aims to be an "integrated testing environment".

In addition to providing a DSL for behavior definition, RSpec is actively trying to integrate various test-related libraries and peripheral tools and provide standard support. The typical ones are described below.

-Standard support for coloring RSpec execution results (red bar / green bar display) · Support for testing techniques such as mocking and stubs, integration with related libraries · Pending support · Integration with peripheral tools such as Rake, RCov, Heckle, AutoTest (ZenTest) ・ Support for Ruby on Rails -Execution result reports in various formats (eg HTML output). ・ Integration with TextMate ·etc

Due to the active integration and support of the above peripheral tools, there are many things that can be done with the standard functions of RSpec, so it can be inferred that it is widely used.

In the future, I would like to learn about testing using RSpec.

Recommended Posts

Rough difference between RSpec and minitest
Difference between vh and%
Difference between i ++ and ++ i
Difference between product and variant
Difference between redirect_to and render
[Java] Difference between == and equals
Rails: Difference between resources and resources
Difference between puts and print
Difference between redirect_to and render
Difference between CUI and GUI
Difference between variables and instance variables
Difference between mockito-core and mockito-all
Difference between class and instance
Difference between bundle and bundle install
Difference between ArrayList and LinkedList
Difference between render and redirect_to
Difference between List and ArrayList
Difference between .bashrc and .bash_profile
Difference between StringBuilder and StringBuffer
Difference between render and redirect_to
Difference between render and redirect_to
What is the difference between skip and pending? [RSpec]
[Ruby] Difference between get and post
Difference between render method and redirect_to
Difference between interface and abstract class
Difference between == operator and equals method
[Java] Difference between Hashmap and HashTable
[Terminal] Difference between irb and pry
JavaServlet: Difference between executeQuery and executeUpdate
[Ruby] Difference between is_a? And instance_of?
[Rails] Difference between find and find_by
Understand the difference between each_with_index and each.with_index
Difference between instance variable and class variable
[JAVA] Difference between abstract and interface
Difference between Thymeleaf @RestController and @Controller
Difference between Stream map and flatMap
[Java] Difference between array and ArrayList
Difference between primitive type and reference type
Difference between string.getByte () and Hex.decodeHex (string.toCharaArray ())
[Java] Difference between Closeable and AutoCloseable
[Java] Difference between StringBuffer and StringBuilder
[Java] Difference between length, length () and size ()
[rails] Difference between redirect_to and render
[Android] Difference between finish (); and return;
Note: Difference between Ruby "p" and "puts"
Difference between final and Immutable in Java
[Memo] Difference between bundle install and update
Difference between Ruby instance variable and local variable
Difference between pop () and peek () in stack
[For beginners] Difference between Java and Kotlin
Difference between isEmpty and isBlank of StringUtils
Difference between getText () and getAttribute () in Selenium
About the difference between irb and pry
Difference between "|| =" and "instance_variable_defined?" In Ruby memoization
Difference between EMPTY_ELEMENTDATA and DEFAULTCAPACITY_EMPTY_ELEMENTDATA in ArrayList
Difference between addPanel and presentModally of FloatingPanel
[Ruby] Difference between print, puts and p
[Java] Difference between Intstream range and rangeClosed
Difference between int and Integer in Java
[Rails] Difference between redirect_to and render [Beginner]
[iOS] Understand the difference between frame and bounds