Sha256: 2e82f6d7f1650728ece085da53d1555f6312af39c98872c6b50bc6ee3b2f89d7

Contents?: true

Size: 1.22 KB

Versions: 8

Compression:

Stored size: 1.22 KB

Contents

$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rails_assist'
require 'rails_assist/rspec'
# require 'rails-app-spec'
require 'tmpdir'

# Requires supporting files with custom matchers and macros, etc,
# in ./support/ and its subdirectories.
# Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}

# require 'generator-spec'
                             
# RSpec::Generator.configure do |config|
#   config.debug = false
#   config.remove_temp_dir = false # true
#   config.default_rails_root(__FILE__) 
#   config.lib = File.dirname(__FILE__) + '/../lib'
#   config.logger = :stdout  
# end   

require 'fixtures'

def project_dir
  File.dirname(__FILE__) + '/..'
end

def temp_dir name
  File.join(project_dir, name)  
end

def make_temp_dir name   
  FileUtils.mkdir_p temp_dir(name)
end

def remove_temp_dir name   
  FileUtils.rm_rf temp_dir(name)
end

RailsAssist::Directory.rails_root = temp_dir('tmp_rails')

# puts "Rails root: #{RailsAssist::Directory.rails_root}"

RSpec.configure do |config|
  config.mock_with :mocha
  # config.before do
  #   make_temp_dir 'tmp_rails'
  # end
  # config.after do
  #   remove_temp_dir 'tmp_rails'
  # end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rails_assist-0.5.3 spec/dir_spec_helper.rb
rails_assist-0.5.2 spec/dir_spec_helper.rb
rails_assist-0.5.1 spec/dir_spec_helper.rb
rails_assist-0.5.0 spec/dir_spec_helper.rb
rails_assist-0.4.4 spec/dir_spec_helper.rb
rails_assist-0.4.3 spec/dir_spec_helper.rb
rails_assist-0.4.2 spec/dir_spec_helper.rb
rails_assist-0.4.1 spec/dir_spec_helper.rb