Autospec / rspec does not work, is something wrong?

I wonder if this has a place in StackOverflow, but since it is related to programming, I will shoot it.

Here is my problem. I am new to TDD and I love Ruby, so the obvious way I accept is to test the material with rspec. Why is it obvious? I saw it in different scenarios and thought it was really neat. Then I saw the "autospec" and tried to use it.

So, I install the gem using sudo gem install ZenTest (as per instructions here )

Next, I go to my folder containing "digit.rb" and "digit_spec.rb", and run autospec without any parameters. Nothing has happened. It’s worth noting that I have two tests in my spec file and that I can test it just using the spec command, but I would be happy to use autotest ...

Is any reference / guidance / documentation link available? Please ?: P

+4
source share
2 answers

You need to create a .autotest file containing this code:

 Autotest.add_hook :reset do |at| at.clear_mappings at.add_mapping(/^(.*?)(_spec)?\.rb$/) { |filename, m| if m[2] filename else "#{m[1]}_spec.rb" end } end 

it changes the default display of the file in spec

+5
source

Maybe you can try spork + autospec. The spork instructions in the rspec wiki are probably the most relevant way: https://github.com/dchelimsky/rspec/wiki/spork---autospec-==-pure-bdd-joy-

0
source

All Articles