Commit 6ecec2226f1f31f9075c829908b69bbe69d49f04

Authored by lanrion
1 parent 28659411
Exists in master

初始化测试

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