You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

spec_helper.rb 4.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. require 'webmock/rspec'
  2. # This file was generated by the `rspec --init` command. Conventionally, all
  3. # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
  4. # The generated `.rspec` file contains `--require spec_helper` which will cause this
  5. # file to always be loaded, without a need to explicitly require it in any files.
  6. #
  7. # Given that it is always loaded, you are encouraged to keep this file as
  8. # light-weight as possible. Requiring heavyweight dependencies from this file
  9. # will add to the boot time of your test suite on EVERY test run, even for an
  10. # individual file that may not need all of that loaded. Instead, consider making
  11. # a separate helper file that requires the additional dependencies and performs
  12. # the additional setup, and require it from the spec files that actually need it.
  13. #
  14. # The `.rspec` file also contains a few flags that are not defaults but that
  15. # users commonly want.
  16. #
  17. # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
  18. RSpec.configure do |config|
  19. # rspec-expectations config goes here. You can use an alternate
  20. # assertion/expectation library such as wrong or the stdlib/minitest
  21. # assertions if you prefer.
  22. config.expect_with :rspec do |expectations|
  23. # This option will default to `true` in RSpec 4. It makes the `description`
  24. # and `failure_message` of custom matchers include text for helper methods
  25. # defined using `chain`, e.g.:
  26. # be_bigger_than(2).and_smaller_than(4).description
  27. # # => "be bigger than 2 and smaller than 4"
  28. # ...rather than:
  29. # # => "be bigger than 2"
  30. expectations.include_chain_clauses_in_custom_matcher_descriptions = true
  31. end
  32. # rspec-mocks config goes here. You can use an alternate test double
  33. # library (such as bogus or mocha) by changing the `mock_with` option here.
  34. config.mock_with :rspec do |mocks|
  35. # Prevents you from mocking or stubbing a method that does not exist on
  36. # a real object. This is generally recommended, and will default to
  37. # `true` in RSpec 4.
  38. mocks.verify_partial_doubles = true
  39. end
  40. # The settings below are suggested to provide a good initial experience
  41. # with RSpec, but feel free to customize to your heart's content.
  42. =begin
  43. # These two settings work together to allow you to limit a spec run
  44. # to individual examples or groups you care about by tagging them with
  45. # `:focus` metadata. When nothing is tagged with `:focus`, all examples
  46. # get run.
  47. config.filter_run :focus
  48. config.run_all_when_everything_filtered = true
  49. # Limits the available syntax to the non-monkey patched syntax that is recommended.
  50. # For more details, see:
  51. # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax
  52. # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
  53. # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching
  54. config.disable_monkey_patching!
  55. # This setting enables warnings. It's recommended, but in some cases may
  56. # be too noisy due to issues in dependencies.
  57. config.warnings = true
  58. # Many RSpec users commonly either run the entire suite or an individual
  59. # file, and it's useful to allow more verbose output when running an
  60. # individual spec file.
  61. if config.files_to_run.one?
  62. # Use the documentation formatter for detailed output,
  63. # unless a formatter has already been configured
  64. # (e.g. via a command-line flag).
  65. config.default_formatter = 'doc'
  66. end
  67. # Print the 10 slowest examples and example groups at the
  68. # end of the spec run, to help surface which specs are running
  69. # particularly slow.
  70. config.profile_examples = 10
  71. # Run specs in random order to surface order dependencies. If you find an
  72. # order dependency and want to debug it, you can fix the order by providing
  73. # the seed, which is printed after each run.
  74. # --seed 1234
  75. config.order = :random
  76. # Seed global randomization in this process using the `--seed` CLI option.
  77. # Setting this allows you to use `--seed` to deterministically reproduce
  78. # test failures related to randomization by passing the same `--seed` value
  79. # as the one that triggered the failure.
  80. Kernel.srand config.seed
  81. =end
  82. end