モジュールで定義されているクラスがあります。
module Mod
class Zed
include DataMapper::Resource
end
end
テストのために、私はファクトリを定義します。
#/factories/zed.rb
FactoryGirl.define do
factory :zed do
#code
end
end
しかし、テストを開始するとエラーが発生します。
describe 'Zed' do
it "should have ..." do
FactoryGirl.create(:zed)
end
end
エラー:
Failure/Error: FactoryGirl.create(:zed)
NameError:
uninitialized constant Zed
モジュールに含まれているクラスをテストするにはどうすればよいですか?ありがとう。