Sha256: c9a69a729757b32092f0b33776da1f8cc8edf2f6dbf149e54b11dc8829321663

Contents?: true

Size: 839 Bytes

Versions: 6

Compression:

Stored size: 839 Bytes

Contents

require_all File.dirname(__FILE__) + '/rails_helpers'

module TmpRails
  class << self    
    attr_accessor :root
    
    def root_dir path, options = {}
      @root = options == :custom ? custom_root_dir(path) : default_root_dir(path)      
    end

    protected

    def default_root_dir path
      File.expand_path(File.join(File.dirname(path), '..', 'tmp'))      
    end

    def custom_root_dir path
      File.expand_path(path)
    end
  end
end  
  
module Rails
  def self.root
    # raise StandardError, "You must define a location for Rails.config_root_dir" if !Rails.config_root_dir    
    # @root ||= File.expand_path(File.join(Rails.config_root_dir, '..', 'tmp', 'rails'))
    @root ||= File.join(Rails.application.config.root_dir, 'rails')
  end
end

class TestApp < Rails::Application
end

Rails.application = TestApp

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
generator-spec-0.4.3 lib/rspec_for_generators/rails_spec_helper.rb
generator-spec-0.4.2 lib/rspec_for_generators/rails_spec_helper.rb
generator-spec-0.4.1 lib/rspec_for_generators/rails_spec_helper.rb
generator-spec-0.4.0 lib/rspec_for_generators/rails_spec_helper.rb
generator-spec-0.3.5 lib/rspec_for_generators/rails_spec_helper.rb
generator-spec-0.3.4 lib/rspec_for_generators/rails_spec_helper.rb