Migrating from RSpec to Minitest :: Spec?

Is there a strategy or set of steps to go from RSpec 2 to MiniTest::Spec ? I would like to look at this for a large project, but I'm not sure where to start.

+6
rspec minitest
Dec 07 2018-11-22T00:
source share
1 answer

I have not used MiniTest :: Spec for a long time, I am porting some of our tests myself, but here are a few things I noticed from RSpec:

  • The matches, of course, are different - this is must / wont instead of should / should_not , and the predicate patterns have disappeared, so you cannot say must_be_true / must_be_false or the like.
  • However, if you write custom RSpec mappings or use tooltip sockets or the like, you can use them with MiniTest thanks to the miniature matrix. But YMMV.
  • MiniTest :: Spec does not provide context , so you need to either change this to describe or an alias.
  • MiniTest :: Spec also does not provide the described_class .
  • You also don't have before :all .
  • subject must be set manually (I think someone correct me if I am wrong).

So, in order to answer your question, from the point of view of transferring an existing test suite, I am afraid that you cannot really just find and replace, you will have to port each test file one at a time. Obviously, this means that you need to determine whether to do it.

+8
Apr 26 '12 at 8:13
source share



All Articles