I am creating a Simpe Gem that includes an installation generator, the generator works fine, but now I want to test it with rspec, I use this gem and try to check my generator, my specification code:
require 'genspec'
require 'rosalie'
describe :install_generator do
it "should generate model" do
subject.should generate("message.rb")
end
end
rosalie is the name can gem, now when I run it I got the error message: / stuff / work / my _projects / rosalie / lib / rosalie / engine.rb: 2: in ``: uninitialized constant Rosalie :: Rails (NameError)
my engine.rb code is:
module Rosalie
class Engine < Rails::Engine
initializer "rosalie.models.messageable" do
ActiveSupport.on_load(:active_record) do
include Rosalie::Models::Messageable
end
end
end
end
Can anyone help me with this problem?
source
share