How to test the Ruby code

0

I have to test the code that I have of a small application in Ruby. I wanted to do it automatically with Sonarqube, but I see that Ruby does not support. I installed a plugin for Ruby, but the program remains hung. So now I wanted to try ruby more easily, because I see that a folder has been generated: "test" and it has generated the tests of my controllers and models. Now the question is how can I run these tests? Is there a specific command? And is there another alternative to generate tests in a simple and professional way? Thanks!

    
asked by user87071 03.07.2018 в 15:03
source

1 answer

0

To run those files you could use the following commands

If you have rails 5 to run all your tests in the test folder:

rails test

A specific test within the test / models folder:

rails test test/models/NOMBREARCHIVO.rb

For rails 4 the commands are:

bundle exec rake test

bundle exec rake test test/models/NOMBREARCHIVO.rb

For more testing information. link

If you use rails 4 this another league can help you

    
answered by 03.07.2018 / 20:20
source