Now, we will configure mspec
to write a unit test for our Rhodes application. We have to generate a few files using the rhogen
generator.
Run the following command in your application
directory:
$ rhogen spec
We can see the following files being created using the rhogen
command:
Generating with spec generator: [ADDED] app/SpecRunner [ADDED] app/spec [ADDED] app/mspec.rb [ADDED] app/spec_runner.rb
It has created a folder SpecRunner
, which contains a controller and an index
file. These files will help us to run and check the test result from the simulator.
It also creates the mspec test files mspec.rb
and spec_runner.rb
, which will help to run the unit test.
To use these Ruby extensions in our application we need to add fileutils
and mspec
in build.yml
:
extensions: ["fileutils", "mspec"]
Now, we have to add a link to run these tests. So, we will add a link to the SpecRunner
controller:
<li><a href="SpecRunner...