I have classes in my app that don't really fit the typical Rails file structure. Based on Yehuda Katz's advice in this Stackoverflow answer, I decided to make an app/classes
folder. I'd like to test these classes, so I also made a test/classes
folder.
My problem is that I can't seem to get the test runner to run the tests in test/classes
- how can I get it to do so?
I have app/classes/card.rb
and test/classes/card_spec.rb
. Here is what is currently happening:
code/poker_analyzer [master●] » test
code/poker_analyzer [master●] » test test/classes/card_spec.rb
code/poker_analyzer [master●] » bin/rails test
Running via Spring preloader in process 8991
Run options: --seed 14207
# Running:
Finished in 0.000522s, 0.0000 runs/s, 0.0000 assertions/s.
0 runs, 0 assertions, 0 failures, 0 errors, 0 skips
code/poker_analyzer [master●] » bin/rails test test/classes/card_spec.rb
Running via Spring preloader in process 9005
Run options: --seed 33782
# Running:
.
Finished in 0.001655s, 604.2296 runs/s, 604.2296 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
code/poker_analyzer [master●] »
So it seems to only work when I run bin/rails test test/classes/card_spec.rb
. How can I get it to run in the other scenarios?
Update: It is only supposed to work in the scenarios prefaced by bin/rails
. So then, my question is why bin/rails test
doesn't work.