In my Rails app, I make heavy use of subdirectories of the model directory and hence of namespaced models - that is, I have the following directory heirarchy:
models
|
+- base_game
| |
| +- foo.rb (defines class BaseGame::Foo)
|
+- expansion
|
+- bar.rb (defines class Expansion::Bar)
This is enforced by Rails - that is, it Just Doesn't Work to call the classes "just" Foo
and Bar
.
I want to unit test these classes (using Shoulda on top of ActiveSupport::TestCase). I know that the name of the class-under-test will be derived from the name of the test case class.
How do I write unit tests that will test these classes?