spec_helper.rb 603 B

1234567891011121314151617181920212223242526272829
  1. # Set up RSpec
  2. require 'webmock/rspec'
  3. Spec::Runner.configure do |config|
  4. config.include WebMock::API
  5. end
  6. # Set up generator tests
  7. require 'rails/all'
  8. require 'rails/generators'
  9. require 'rails/generators/test_case'
  10. class TestApp < Rails::Application
  11. config.root = File.dirname(__FILE__)
  12. end
  13. Rails.application = TestApp
  14. module Rails
  15. def self.root
  16. @root ||= File.expand_path("../../tmp/rails", __FILE__)
  17. end
  18. end
  19. Rails.application.config.root = Rails.root
  20. # Call configure to load the settings from
  21. # Rails.application.config.generators to Rails::Generators
  22. Rails::Generators.configure!