1. require 'rubygems'
  2. require 'spork'
  3. #uncomment the following line to use spork with the debugger
  4. #require 'spork/ext/ruby-debug'
  5.  
  6. Spork.prefork do
  7.   # Loading more in this block will cause your tests to run faster. However,
  8.   # if you change any configuration or code from libraries loaded here, you'll
  9.   # need to restart spork for it take effect.
  10.  
  11. end
  12.  
  13. Spork.each_run do
  14.   # This code will be run each time you run your specs.
  15.  
  16. end
  17.  
  18. # --- Instructions ---
  19. # Sort the contents of this file into a Spork.prefork and a Spork.each_run
  20. # block.
  21. #
  22. # The Spork.prefork block is run only once when the spork server is started.
  23. # You typically want to place most of your (slow) initializer code in here, in
  24. # particular, require'ing any 3rd-party gems that you don't normally modify
  25. # during development.
  26. #
  27. # The Spork.each_run block is run each time you run your specs.  In case you
  28. # need to load files that tend to change during development, require them here.
  29. # With Rails, your application modules are loaded automatically, so sometimes
  30. # this block can remain empty.
  31. #
  32. # Note: You can modify files loaded *from* the Spork.each_run block without
  33. # restarting the spork server.  However, this file itself will not be reloaded,
  34. # so if you change any of the code inside the each_run block, you still need to
  35. # restart the server.  In general, if you have non-trivial code in this file,
  36. # it's advisable to move it into a separate file so you can easily edit it
  37. # without restarting spork.  (For example, with RSpec, you could move
  38. # non-trivial code into a file spec/support/my_helper.rb, making sure that the
  39. # spec/support/* files are require'd from inside the each_run block.)
  40. #
  41. # Any code that is left outside the two blocks will be run during preforking
  42. # *and* during each_run -- that's probably not what you want.
  43. #
  44. # These instructions should self-destruct in 10 seconds.  If they don't, feel
  45. # free to delete them.
  46.  
  47.  
  48.  
  49.  
  50. # This file is copied to spec/ when you run 'rails generate rspec:install'
  51. ENV["RAILS_ENV"] ||= 'test'
  52. require File.expand_path("../../config/environment", __FILE__)
  53. require 'rspec/rails'
  54. require 'rspec/autorun'
  55.  
  56. # Requires supporting ruby files with custom matchers and macros, etc,
  57. # in spec/support/ and its subdirectories.
  58. Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
  59.  
  60. RSpec.configure do |config|
  61.   # ## Mock Framework
  62.   #
  63.   # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
  64.   #
  65.   # config.mock_with :mocha
  66.   # config.mock_with :flexmock
  67.   # config.mock_with :rr
  68.  
  69.   # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
  70.   config.fixture_path = "#{::Rails.root}/spec/fixtures"
  71.  
  72.   # If you're not using ActiveRecord, or you'd prefer not to run each of your
  73.   # examples within a transaction, remove the following line or assign false
  74.   # instead of true.
  75.   config.use_transactional_fixtures = true
  76.  
  77.   # If true, the base class of anonymous controllers will be inferred
  78.   # automatically. This will be the default behavior in future versions of
  79.   # rspec-rails.
  80.   config.infer_base_class_for_anonymous_controllers = false
  81.  
  82.   # Run specs in random order to surface order dependencies. If you find an
  83.   # order dependency and want to debug it, you can fix the order by providing
  84.   # the seed, which is printed after each run.
  85.   #     --seed 1234
  86.   config.order = "random"
  87. end