I'm writing a class inside a module
#lib/app/models/foo.rb
module App::Models
class Foo
def bar
true
end
end
end
and when i tried to run the spec for it
#spec/lib/app/models/foo_spec.rb
require_relative '../../../../lib/app/models/foo'
describe App::Models::Foo do
end
i get the follow error:
rspec spec/lib/app/models/foo_spec.rb
/Users/frojas/git/tmp/lib/app/models/foo.rb:1:in `<top (required)>': uninitialized constant App (NameError)
from /Users/frojas/git/tmp/spec/lib/app/models/foo_spec.rb:1:in `require_relative'
I don't quite understand want i'm doing wrong.
App? You first need to define it.. Thenmodule App::Modelsthis should come..