Advertisement
theminijohn

spec_helper

Sep 25th, 2013
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 3.57 KB | None | 0 0
  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. # This file is copied to spec/ when you run 'rails generate rspec:install'
  49. ENV["RAILS_ENV"] ||= 'test'
  50. require File.expand_path("../../config/environment", __FILE__)
  51. require 'rspec/rails'
  52. require 'rspec/autorun'
  53.  
  54. # Requires supporting ruby files with custom matchers and macros, etc,
  55. # in spec/support/ and its subdirectories.
  56. Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
  57.  
  58. # Checks for pending migrations before tests are run.
  59. # If you are not using ActiveRecord, you can remove this line.
  60. ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
  61.  
  62. RSpec.configure do |config|
  63.     # ## Mock Framework
  64.     #
  65.     # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
  66.     #
  67.     # config.mock_with :mocha
  68.     # config.mock_with :flexmock
  69.     # config.mock_with :rr
  70.  
  71.     # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
  72.     config.fixture_path = "#{::Rails.root}/spec/fixtures"
  73.  
  74.     # Color
  75.     config.tty = true
  76.  
  77.     # If you're not using ActiveRecord, or you'd prefer not to run each of your
  78.     # examples within a transaction, remove the following line or assign false
  79.     # instead of true.
  80.     config.use_transactional_fixtures = true
  81.  
  82.     # If true, the base class of anonymous controllers will be inferred
  83.     # automatically. This will be the default behavior in future versions of
  84.     # rspec-rails.
  85.     config.infer_base_class_for_anonymous_controllers = false
  86.  
  87.     # Run specs in random order to surface order dependencies. If you find an
  88.     # order dependency and want to debug it, you can fix the order by providing
  89.     # the seed, which is printed after each run.
  90.     #     --seed 1234
  91.     config.order = "random"
  92. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement