Class: MochaRails::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/mocha_rails/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#installObject



8
9
10
11
12
13
# File 'lib/generators/mocha_rails/install_generator.rb', line 8

def install    
  route "mount MochaRails::Engine => '#{options[:mount]}' unless Rails.env.production?"

  test_dir = Dir.exists?(Rails.root.join "spec") ? "spec" : "test"
  copy_file 'mocha-suite.js', "#{test_dir}/javascripts/mocha-suite.js"
end