Sha256: 78310899c118e8d1a9bc3e57a06df9de8179e4308333a7e0734cc811ccbd6667

Contents?: true

Size: 798 Bytes

Versions: 13

Compression:

Stored size: 798 Bytes

Contents

module Rails
  class << self
    remove_possible_method :root
    def root
      @root ||= Pathname.new(File.expand_path('tmp'))
    end
  end
end

module GeneratorsTestHelper
  def self.included(base)
    base.class_eval do
      destination Rails.root
      setup :prepare_destination
    end
  end

  def copy_routes
    routes = File.expand_path('test/fixtures/routes.rb')
    destination = File.join(destination_root, 'config')
    FileUtils.mkdir_p(destination)
    FileUtils.cp File.expand_path(routes), File.expand_path(destination)
  end

  def copy_engine
    engine = File.expand_path('test/fixtures/engine.rb')
    destination = File.join(destination_root, 'lib/tmp')
    FileUtils.mkdir_p(destination)
    FileUtils.cp File.expand_path(engine), File.expand_path(destination)
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
express_admin-1.4.6 test/generators_test_helper.rb
express_admin-1.4.5 test/generators_test_helper.rb
express_admin-1.4.4 test/generators_test_helper.rb
express_admin-1.4.3 test/generators_test_helper.rb
express_admin-1.4.2 test/generators_test_helper.rb
express_admin-1.4.1 test/generators_test_helper.rb
express_admin-1.4.0 test/generators_test_helper.rb
express_admin-1.3.2 test/generators_test_helper.rb
express_admin-1.3.1 test/generators_test_helper.rb
express_admin-1.3.0 test/generators_test_helper.rb
express_admin-1.2.1 test/generators_test_helper.rb
express_admin-1.2.0 test/generators_test_helper.rb
express_admin-1.1.0 test/generators_test_helper.rb