Permalink
Browse files

Fix failing MoonshineGenerator spec.

  • Loading branch information...
1 parent dbc0254 commit b419ab4180a3dfe3392da019816376660274797d @technicalpickles technicalpickles committed Jun 6, 2010
Showing with 9 additions and 3 deletions.
  1. +6 −2 generators/moonshine/moonshine_generator.rb
  2. +3 −1 spec/moonshine_generator_spec.rb
@@ -51,8 +51,12 @@ def manifest
m.template 'deploy.rb', 'config/deploy.rb'
- unless File.read('config/environments/production.rb').include?('ActionMailer::Base.delivery_method')
- m.gsub_file 'config/environments/production.rb', /\z/, "\n# Use postfix for mail delivery \nActionMailer::Base.delivery_method = :sendmail "
+ production_env_path = Pathname.new("#{RAILS_ROOT}/config/environments/production.rb")
+ if production_env_path.exist?
+ production_env = production_env_path.read
+ unless production_env.include?('ActionMailer::Base.delivery_method')
+ m.gsub_file 'config/environments/production.rb', /\z/, "\n# Use postfix for mail delivery \nActionMailer::Base.delivery_method = :sendmail "
+ end
end
if options[:multistage]
@@ -7,7 +7,9 @@
before do
FileUtils.mkdir_p(generator_rails_root)
- Rails::Generator::Scripts::Generate.new.run(["moonshine"], :destination => generator_rails_root)
+ lambda {
+ Rails::Generator::Scripts::Generate.new.run(["moonshine"], :destination => generator_rails_root)
+ }.should_not raise_error
end
after do

0 comments on commit b419ab4

Please sign in to comment.