| spec_helper.rb - warvox - VoIP based wardialing tool, forked from rapid7/warvox. | |
| git clone git://jay.scot/warvox | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| spec_helper.rb (4889B) | |
| --- | |
| 1 require 'capybara/rspec' | |
| 2 | |
| 3 # This file was generated by the `rails generate rspec:install` command.… | |
| 4 # specs live under a `spec` directory, which RSpec adds to the `$LOAD_PA… | |
| 5 # The generated `.rspec` file contains `--require spec_helper` which wil… | |
| 6 # this file to always be loaded, without a need to explicitly require it… | |
| 7 # files. | |
| 8 # | |
| 9 # Given that it is always loaded, you are encouraged to keep this file as | |
| 10 # light-weight as possible. Requiring heavyweight dependencies from this… | |
| 11 # will add to the boot time of your test suite on EVERY test run, even f… | |
| 12 # individual file that may not need all of that loaded. Instead, conside… | |
| 13 # a separate helper file that requires the additional dependencies and p… | |
| 14 # the additional setup, and require it from the spec files that actually… | |
| 15 # it. | |
| 16 # | |
| 17 # The `.rspec` file also contains a few flags that are not defaults but … | |
| 18 # users commonly want. | |
| 19 # | |
| 20 # See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration | |
| 21 RSpec.configure do |config| | |
| 22 # rspec-expectations config goes here. You can use an alternate | |
| 23 # assertion/expectation library such as wrong or the stdlib/minitest | |
| 24 # assertions if you prefer. | |
| 25 config.expect_with :rspec do |expectations| | |
| 26 # This option will default to `true` in RSpec 4. It makes the `descr… | |
| 27 # and `failure_message` of custom matchers include text for helper m… | |
| 28 # defined using `chain`, e.g.: | |
| 29 # be_bigger_than(2).and_smaller_than(4).description | |
| 30 # # => "be bigger than 2 and smaller than 4" | |
| 31 # ...rather than: | |
| 32 # # => "be bigger than 2" | |
| 33 expectations.include_chain_clauses_in_custom_matcher_descriptions = … | |
| 34 end | |
| 35 | |
| 36 # rspec-mocks config goes here. You can use an alternate test double | |
| 37 # library (such as bogus or mocha) by changing the `mock_with` option … | |
| 38 config.mock_with :rspec do |mocks| | |
| 39 # Prevents you from mocking or stubbing a method that does not exist… | |
| 40 # a real object. This is generally recommended, and will default to | |
| 41 # `true` in RSpec 4. | |
| 42 mocks.verify_partial_doubles = true | |
| 43 end | |
| 44 | |
| 45 # This option will default to `:apply_to_host_groups` in RSpec 4 (and … | |
| 46 # have no way to turn it off -- the option exists only for backwards | |
| 47 # compatibility in RSpec 3). It causes shared context metadata to be | |
| 48 # inherited by the metadata hash of host groups and examples, rather t… | |
| 49 # triggering implicit auto-inclusion in groups with matching metadata. | |
| 50 config.shared_context_metadata_behavior = :apply_to_host_groups | |
| 51 | |
| 52 # The settings below are suggested to provide a good initial experience | |
| 53 # with RSpec, but feel free to customize to your heart's content. | |
| 54 =begin | |
| 55 # This allows you to limit a spec run to individual examples or groups | |
| 56 # you care about by tagging them with `:focus` metadata. When nothing | |
| 57 # is tagged with `:focus`, all examples get run. RSpec also provides | |
| 58 # aliases for `it`, `describe`, and `context` that include `:focus` | |
| 59 # metadata: `fit`, `fdescribe` and `fcontext`, respectively. | |
| 60 config.filter_run_when_matching :focus | |
| 61 | |
| 62 # Allows RSpec to persist some state between runs in order to support | |
| 63 # the `--only-failures` and `--next-failure` CLI options. We recommend | |
| 64 # you configure your source control system to ignore this file. | |
| 65 config.example_status_persistence_file_path = "spec/examples.txt" | |
| 66 | |
| 67 # Limits the available syntax to the non-monkey patched syntax that is | |
| 68 # recommended. For more details, see: | |
| 69 # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ | |
| 70 # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expe… | |
| 71 # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-… | |
| 72 config.disable_monkey_patching! | |
| 73 | |
| 74 # Many RSpec users commonly either run the entire suite or an individu… | |
| 75 # file, and it's useful to allow more verbose output when running an | |
| 76 # individual spec file. | |
| 77 if config.files_to_run.one? | |
| 78 # Use the documentation formatter for detailed output, | |
| 79 # unless a formatter has already been configured | |
| 80 # (e.g. via a command-line flag). | |
| 81 config.default_formatter = 'doc' | |
| 82 end | |
| 83 | |
| 84 # Print the 10 slowest examples and example groups at the | |
| 85 # end of the spec run, to help surface which specs are running | |
| 86 # particularly slow. | |
| 87 config.profile_examples = 10 | |
| 88 | |
| 89 # Run specs in random order to surface order dependencies. If you find… | |
| 90 # order dependency and want to debug it, you can fix the order by prov… | |
| 91 # the seed, which is printed after each run. | |
| 92 # --seed 1234 | |
| 93 config.order = :random | |
| 94 | |
| 95 # Seed global randomization in this process using the `--seed` CLI opt… | |
| 96 # Setting this allows you to use `--seed` to deterministically reprodu… | |
| 97 # test failures related to randomization by passing the same `--seed` … | |
| 98 # as the one that triggered the failure. | |
| 99 Kernel.srand config.seed | |
| 100 =end | |
| 101 end |