swift-pyrite 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +2 -0
- data/.ruby-version +1 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +41 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/exe/pyrite +4 -0
- data/lib/swift/pyrite/cli.rb +18 -0
- data/lib/swift/pyrite/parser.rb +43 -0
- data/lib/swift/pyrite/transformer.rb +129 -0
- data/lib/swift/pyrite/version.rb +5 -0
- data/lib/swift/pyrite.rb +21 -0
- data/swift-pyrite.gemspec +30 -0
- data/vendor/bundle/ruby/2.0.0/bin/htmldiff +25 -0
- data/vendor/bundle/ruby/2.0.0/bin/ldiff +25 -0
- data/vendor/bundle/ruby/2.0.0/bin/rake +23 -0
- data/vendor/bundle/ruby/2.0.0/bin/rspec +23 -0
- data/vendor/bundle/ruby/2.0.0/bin/tt +23 -0
- data/vendor/bundle/ruby/2.0.0/cache/blankslate-3.1.3.gem +0 -0
- data/vendor/bundle/ruby/2.0.0/cache/diff-lcs-1.2.5.gem +0 -0
- data/vendor/bundle/ruby/2.0.0/cache/parslet-1.7.1.gem +0 -0
- data/vendor/bundle/ruby/2.0.0/cache/polyglot-0.3.5.gem +0 -0
- data/vendor/bundle/ruby/2.0.0/cache/rake-10.4.2.gem +0 -0
- data/vendor/bundle/ruby/2.0.0/cache/rspec-3.3.0.gem +0 -0
- data/vendor/bundle/ruby/2.0.0/cache/rspec-core-3.3.2.gem +0 -0
- data/vendor/bundle/ruby/2.0.0/cache/rspec-expectations-3.3.1.gem +0 -0
- data/vendor/bundle/ruby/2.0.0/cache/rspec-mocks-3.3.2.gem +0 -0
- data/vendor/bundle/ruby/2.0.0/cache/rspec-support-3.3.0.gem +0 -0
- data/vendor/bundle/ruby/2.0.0/cache/treetop-1.6.3.gem +0 -0
- data/vendor/bundle/ruby/2.0.0/gems/blankslate-3.1.3/Gemfile +6 -0
- data/vendor/bundle/ruby/2.0.0/gems/blankslate-3.1.3/Gemfile.lock +22 -0
- data/vendor/bundle/ruby/2.0.0/gems/blankslate-3.1.3/MIT-LICENSE +20 -0
- data/vendor/bundle/ruby/2.0.0/gems/blankslate-3.1.3/README +31 -0
- data/vendor/bundle/ruby/2.0.0/gems/blankslate-3.1.3/Rakefile +13 -0
- data/vendor/bundle/ruby/2.0.0/gems/blankslate-3.1.3/VERSION +1 -0
- data/vendor/bundle/ruby/2.0.0/gems/blankslate-3.1.3/blankslate.gemspec +22 -0
- data/vendor/bundle/ruby/2.0.0/gems/blankslate-3.1.3/lib/blankslate.rb +137 -0
- data/vendor/bundle/ruby/2.0.0/gems/blankslate-3.1.3/spec/blankslate_spec.rb +54 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/.autotest +3 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/.gemtest +0 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/.hoerc +2 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/.rspec +2 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/.travis.yml +22 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/Contributing.rdoc +64 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/Gemfile +20 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/History.rdoc +152 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/License.rdoc +39 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/Manifest.txt +38 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/README.rdoc +85 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/Rakefile +41 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/autotest/discover.rb +1 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/bin/htmldiff +32 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/bin/ldiff +6 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/docs/COPYING.txt +339 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/docs/artistic.txt +127 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/lib/diff/lcs/array.rb +7 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/lib/diff/lcs/block.rb +37 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/lib/diff/lcs/callbacks.rb +322 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/lib/diff/lcs/change.rb +177 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/lib/diff/lcs/htmldiff.rb +149 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/lib/diff/lcs/hunk.rb +276 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/lib/diff/lcs/internals.rb +301 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/lib/diff/lcs/ldiff.rb +195 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/lib/diff/lcs/string.rb +5 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/lib/diff/lcs.rb +805 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/lib/diff-lcs.rb +3 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/spec/change_spec.rb +65 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/spec/diff_spec.rb +47 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/spec/hunk_spec.rb +72 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/spec/issues_spec.rb +24 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/spec/lcs_spec.rb +54 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/spec/patch_spec.rb +414 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/spec/sdiff_spec.rb +214 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/spec/spec_helper.rb +290 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/spec/traverse_balanced_spec.rb +310 -0
- data/vendor/bundle/ruby/2.0.0/gems/diff-lcs-1.2.5/spec/traverse_sequences_spec.rb +139 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/HISTORY.txt +241 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/LICENSE +22 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/README +73 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/Rakefile +30 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/big.erb +73 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/boolean_algebra.rb +70 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/calc.rb +153 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/capture.rb +49 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/comments.rb +35 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/deepest_errors.rb +131 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/documentation.rb +18 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/email_parser.rb +54 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/empty.rb +13 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/erb.rb +47 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/ignore.rb +33 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/ip_address.rb +125 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/json.rb +128 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/local.rb +34 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/mathn.rb +44 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/minilisp.rb +94 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/modularity.rb +47 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/nested_errors.rb +132 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/optimized_erb.rb +42 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/boolean_algebra.out +4 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/calc.out +1 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/capture.out +3 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/comments.out +8 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/deepest_errors.out +54 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/documentation.err +4 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/documentation.out +1 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/email_parser.out +2 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/empty.err +1 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/erb.out +7 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/ignore.out +1 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/ignore_whitespace.out +1 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/ip_address.out +9 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/json.out +5 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/local.out +3 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/mathn.out +4 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/minilisp.out +5 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/modularity.out +0 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/nested_errors.out +54 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/optimized_erb.out +1 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/parens.out +8 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/prec_calc.out +5 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/readme.out +1 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/scopes.out +1 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/seasons.out +28 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/sentence.out +1 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/simple_xml.out +2 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/output/string_parser.out +3 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/parens.rb +42 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/prec_calc.rb +71 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/readme.rb +30 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/scopes.rb +15 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/seasons.rb +46 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/sentence.rb +36 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/simple.lit +3 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/simple_xml.rb +54 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/string_parser.rb +77 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/example/test.lit +4 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/accelerator/application.rb +62 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/accelerator/engine.rb +112 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/accelerator.rb +161 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms/alternative.rb +50 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms/base.rb +157 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms/can_flatten.rb +137 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms/capture.rb +38 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms/context.rb +103 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms/dsl.rb +109 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms/dynamic.rb +32 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms/entity.rb +44 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms/infix.rb +121 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms/lookahead.rb +50 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms/named.rb +32 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms/re.rb +38 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms/repetition.rb +83 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms/scope.rb +26 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms/sequence.rb +45 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms/str.rb +39 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms/visitor.rb +89 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/atoms.rb +35 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/cause.rb +101 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/context.rb +35 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/convenience.rb +33 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/error_reporter/contextual.rb +120 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/error_reporter/deepest.rb +100 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/error_reporter/tree.rb +63 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/error_reporter.rb +8 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/export.rb +162 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/expression/treetop.rb +92 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/expression.rb +51 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/graphviz.rb +97 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/parser.rb +67 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/pattern/binding.rb +49 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/pattern.rb +114 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/position.rb +21 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/rig/rspec.rb +59 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/scope.rb +42 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/slice.rb +110 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/source/line_cache.rb +98 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/source.rb +96 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet/transform.rb +257 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/lib/parslet.rb +302 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/parslet.gemspec +18 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/acceptance/examples_spec.rb +37 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/acceptance/infix_parser_spec.rb +112 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/acceptance/regression_spec.rb +314 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/acceptance/repetition_and_maybe_spec.rb +42 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/acceptance/unconsumed_input_spec.rb +21 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atom_results_spec.rb +39 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms/alternative_spec.rb +26 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms/base_spec.rb +126 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms/capture_spec.rb +21 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms/combinations_spec.rb +5 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms/dsl_spec.rb +25 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms/entity_spec.rb +77 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms/infix_spec.rb +5 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms/lookahead_spec.rb +22 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms/named_spec.rb +4 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms/re_spec.rb +14 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms/repetition_spec.rb +24 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms/scope_spec.rb +26 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms/sequence_spec.rb +28 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms/str_spec.rb +15 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms/visitor_spec.rb +80 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/atoms_spec.rb +429 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/convenience_spec.rb +48 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/error_reporter/contextual_spec.rb +115 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/error_reporter/deepest_spec.rb +73 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/error_reporter/tree_spec.rb +7 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/export_spec.rb +67 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/expression/treetop_spec.rb +74 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/minilisp.citrus +29 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/minilisp.tt +29 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/parser_spec.rb +31 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/parslet_spec.rb +38 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/pattern_spec.rb +272 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/position_spec.rb +14 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/rig/rspec_spec.rb +54 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/scope_spec.rb +45 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/slice_spec.rb +144 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/source/line_cache_spec.rb +74 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/source_spec.rb +168 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/transform/context_spec.rb +35 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/parslet/transform_spec.rb +165 -0
- data/vendor/bundle/ruby/2.0.0/gems/parslet-1.7.1/spec/spec_helper.rb +38 -0
- data/vendor/bundle/ruby/2.0.0/gems/polyglot-0.3.5/History.txt +72 -0
- data/vendor/bundle/ruby/2.0.0/gems/polyglot-0.3.5/License.txt +20 -0
- data/vendor/bundle/ruby/2.0.0/gems/polyglot-0.3.5/README.txt +87 -0
- data/vendor/bundle/ruby/2.0.0/gems/polyglot-0.3.5/Rakefile +42 -0
- data/vendor/bundle/ruby/2.0.0/gems/polyglot-0.3.5/lib/polyglot/version.rb +9 -0
- data/vendor/bundle/ruby/2.0.0/gems/polyglot-0.3.5/lib/polyglot.rb +76 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/.autotest +7 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/.gemtest +0 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/.rubocop.yml +27 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/.togglerc +7 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/CONTRIBUTING.rdoc +34 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/History.rdoc +651 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/MIT-LICENSE +21 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/Manifest.txt +166 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/README.rdoc +140 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/Rakefile +81 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/bin/rake +33 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/command_line_usage.rdoc +158 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/example/Rakefile1 +38 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/example/Rakefile2 +35 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/example/a.c +6 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/example/b.c +6 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/example/main.c +11 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/glossary.rdoc +43 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/jamis.rb +591 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/proto_rake.rdoc +127 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/rake.1 +141 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/rakefile.rdoc +653 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/rational.rdoc +151 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.4.14.rdoc +23 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.4.15.rdoc +35 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.5.0.rdoc +53 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.5.3.rdoc +78 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.5.4.rdoc +46 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.6.0.rdoc +141 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.7.0.rdoc +119 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.7.1.rdoc +59 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.7.2.rdoc +121 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.7.3.rdoc +47 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.8.0.rdoc +114 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.8.2.rdoc +165 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.8.3.rdoc +112 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.8.4.rdoc +147 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.8.5.rdoc +53 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.8.6.rdoc +37 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.8.7.rdoc +55 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.9.0.rdoc +112 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.9.1.rdoc +52 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.9.2.2.rdoc +55 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.9.2.rdoc +49 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.9.3.rdoc +102 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.9.4.rdoc +60 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.9.5.rdoc +55 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-0.9.6.rdoc +64 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-10.0.0.rdoc +178 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-10.0.1.rdoc +58 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-10.0.2.rdoc +53 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-10.0.3.rdoc +191 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/doc/release_notes/rake-10.1.0.rdoc +61 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/alt_system.rb +110 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/application.rb +790 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/backtrace.rb +23 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/clean.rb +76 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/cloneable.rb +16 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/contrib/.document +1 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/contrib/compositepublisher.rb +21 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/contrib/ftptools.rb +137 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/contrib/publisher.rb +81 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/contrib/rubyforgepublisher.rb +18 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/contrib/sshpublisher.rb +61 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/contrib/sys.rb +4 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/cpu_counter.rb +125 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/default_loader.rb +14 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/dsl_definition.rb +201 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/early_time.rb +21 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/ext/core.rb +25 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/ext/module.rb +2 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/ext/pathname.rb +25 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/ext/string.rb +173 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/ext/time.rb +16 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/file_creation_task.rb +24 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/file_list.rb +428 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/file_task.rb +46 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/file_utils.rb +128 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/file_utils_ext.rb +144 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/gempackagetask.rb +4 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/invocation_chain.rb +56 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/invocation_exception_mixin.rb +16 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/late_time.rb +17 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/linked_list.rb +103 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/loaders/makefile.rb +40 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/multi_task.rb +13 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/name_space.rb +38 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/packagetask.rb +199 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/pathmap.rb +3 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/phony.rb +15 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/private_reader.rb +20 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/promise.rb +99 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/pseudo_status.rb +29 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/rake_module.rb +38 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/rake_test_loader.rb +22 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/rdoctask.rb +4 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/ruby182_test_unit_fix.rb +29 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/rule_recursion_overflow_error.rb +20 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/runtest.rb +27 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/scope.rb +42 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task.rb +383 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task_argument_error.rb +7 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task_arguments.rb +98 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/task_manager.rb +310 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/tasklib.rb +24 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/testtask.rb +212 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/thread_history_display.rb +48 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/thread_pool.rb +164 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/trace_output.rb +22 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/version.rb +7 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake/win32.rb +56 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/lib/rake.rb +79 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/rakelib/publish.rake +20 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/rakelib/test_times.rake +25 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/file_creation.rb +34 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/helper.rb +130 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/support/rakefile_definitions.rb +478 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/support/ruby_runner.rb +34 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_private_reader.rb +42 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake.rb +40 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_application.rb +643 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_application_options.rb +466 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_backtrace.rb +119 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_clean.rb +61 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_cpu_counter.rb +68 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_definitions.rb +84 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_directory_task.rb +76 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_dsl.rb +40 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_early_time.rb +31 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_extension.rb +59 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_file_creation_task.rb +56 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_file_list.rb +655 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_file_list_path_map.rb +8 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_file_task.rb +197 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_file_utils.rb +309 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_ftp_file.rb +74 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_functional.rb +482 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_invocation_chain.rb +64 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_late_time.rb +18 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_linked_list.rb +84 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_makefile_loader.rb +46 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_multi_task.rb +64 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_name_space.rb +57 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_package_task.rb +79 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_path_map.rb +168 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_path_map_explode.rb +34 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_path_map_partial.rb +18 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_pathname_extensions.rb +15 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_pseudo_status.rb +21 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_rake_test_loader.rb +20 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_reduce_compat.rb +26 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_require.rb +40 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_rules.rb +388 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_scope.rb +44 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_task.rb +393 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_task_argument_parsing.rb +119 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_task_arguments.rb +127 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_task_lib.rb +9 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_task_manager.rb +178 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_task_manager_argument_resolution.rb +19 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_task_with_arguments.rb +172 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_test_task.rb +146 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_thread_pool.rb +145 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_top_level_functions.rb +71 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_rake_win32.rb +72 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_thread_history_display.rb +101 -0
- data/vendor/bundle/ruby/2.0.0/gems/rake-10.4.2/test/test_trace_output.rb +52 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-3.3.0/License.txt +24 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-3.3.0/README.md +34 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-3.3.0/lib/rspec/version.rb +5 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-3.3.0/lib/rspec.rb +3 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/.document +5 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/.yardopts +8 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/Changelog.md +1856 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/License.txt +25 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/README.md +369 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/exe/rspec +4 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/autorun.rb +3 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/backtrace_formatter.rb +64 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/bisect/coordinator.rb +66 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/bisect/example_minimizer.rb +130 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/bisect/runner.rb +139 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/bisect/server.rb +61 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/bisect/subset_enumerator.rb +39 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb +1807 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/configuration_options.rb +191 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/drb.rb +111 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/dsl.rb +96 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/example.rb +573 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb +796 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/example_status_persister.rb +235 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/filter_manager.rb +231 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/flat_map.rb +20 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters/base_formatter.rb +70 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters/base_text_formatter.rb +77 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters/bisect_formatter.rb +68 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters/bisect_progress_formatter.rb +115 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters/console_codes.rb +65 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters/deprecation_formatter.rb +223 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters/documentation_formatter.rb +70 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters/exception_presenter.rb +393 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters/fallback_message_formatter.rb +28 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters/helpers.rb +109 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters/html_formatter.rb +151 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters/html_printer.rb +415 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters/json_formatter.rb +96 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters/profile_formatter.rb +68 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters/progress_formatter.rb +28 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters/protocol.rb +172 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters/snippet_extractor.rb +116 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/formatters.rb +254 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb +638 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/memoized_helpers.rb +532 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/metadata.rb +490 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/metadata_filter.rb +235 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/minitest_assertions_adapter.rb +31 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/mocking_adapters/flexmock.rb +31 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/mocking_adapters/mocha.rb +57 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/mocking_adapters/null.rb +14 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/mocking_adapters/rr.rb +31 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/mocking_adapters/rspec.rb +32 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/mutex.rb +63 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/notifications.rb +498 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/option_parser.rb +301 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/ordering.rb +158 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/pending.rb +165 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/profiler.rb +32 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/project_initializer/.rspec +2 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/project_initializer/spec/spec_helper.rb +96 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/project_initializer.rb +48 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/rake_task.rb +158 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/reentrant_mutex.rb +52 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb +220 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/ruby_project.rb +53 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb +179 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/sandbox.rb +37 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/set.rb +49 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/shared_context.rb +55 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/shared_example_group.rb +210 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/shell_escape.rb +49 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/test_unit_assertions_adapter.rb +30 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/version.rb +9 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/warnings.rb +40 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core/world.rb +178 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-core-3.3.2/lib/rspec/core.rb +181 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/.document +5 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/.yardopts +6 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/Changelog.md +953 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/License.txt +24 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/README.md +289 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/expectations/configuration.rb +164 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/expectations/expectation_target.rb +113 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/expectations/fail_with.rb +31 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/expectations/failure_aggregator.rb +194 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/expectations/handler.rb +170 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/expectations/minitest_integration.rb +31 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/expectations/syntax.rb +132 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/expectations/version.rb +8 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/expectations.rb +81 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/aliased_matcher.rb +116 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/all.rb +85 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/base_matcher.rb +181 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/be.rb +285 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/be_between.rb +77 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/be_instance_of.rb +22 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/be_kind_of.rb +16 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/be_within.rb +72 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/change.rb +337 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/compound.rb +293 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/contain_exactly.rb +253 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/cover.rb +24 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/eq.rb +40 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/eql.rb +34 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/equal.rb +81 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/exist.rb +86 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/has.rb +103 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/have_attributes.rb +114 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/include.rb +130 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/match.rb +37 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/operators.rb +128 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/output.rb +200 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/raise_error.rb +216 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/respond_to.rb +90 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/satisfy.rb +37 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/start_or_end_with.rb +94 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/throw_symbol.rb +132 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/yield.rb +418 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in.rb +52 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/composable.rb +184 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/dsl.rb +453 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/english_phrasing.rb +42 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/expecteds_for_multiple_diffs.rb +73 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/fail_matchers.rb +42 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/generated_descriptions.rb +42 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/matcher_delegator.rb +35 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers/matcher_protocol.rb +99 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-expectations-3.3.1/lib/rspec/matchers.rb +1009 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/.document +5 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/.yardopts +6 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/Changelog.md +965 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/License.txt +24 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/README.md +430 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/chain.rb +110 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/error_generator.rb +31 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/expect_chain_chain.rb +35 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/expectation_chain.rb +48 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/message_chains.rb +83 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/proxy.rb +116 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/recorder.rb +264 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/stub_chain.rb +46 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/stub_chain_chain.rb +27 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance.rb +11 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/argument_list_matcher.rb +100 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/argument_matchers.rb +320 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/configuration.rb +188 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/error_generator.rb +362 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/example_methods.rb +421 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/instance_method_stasher.rb +135 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/marshal_extension.rb +41 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/matchers/expectation_customization.rb +20 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/matchers/have_received.rb +116 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/matchers/receive.rb +130 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/matchers/receive_message_chain.rb +80 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/matchers/receive_messages.rb +75 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/message_chain.rb +87 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/message_expectation.rb +717 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/method_double.rb +287 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/method_reference.rb +192 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/mutate_const.rb +335 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/mutex.rb +73 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/object_reference.rb +149 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/order_group.rb +81 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/proxy.rb +439 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/reentrant_mutex.rb +53 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/space.rb +238 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/standalone.rb +3 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/syntax.rb +325 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/targets.rb +97 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/test_double.rb +170 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/verifying_double.rb +129 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/verifying_message_expecation.rb +54 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/verifying_proxy.rb +213 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks/version.rb +9 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-mocks-3.3.2/lib/rspec/mocks.rb +126 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/Changelog.md +125 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/LICENSE.txt +22 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/README.md +26 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/caller_filter.rb +83 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/differ.rb +215 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/directory_maker.rb +63 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/encoded_string.rb +155 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/fuzzy_matcher.rb +48 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/hunk_generator.rb +47 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/matcher_definition.rb +42 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/method_signature_verifier.rb +273 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/object_formatter.rb +93 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/recursive_const_methods.rb +76 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/ruby_features.rb +118 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/spec/deprecation_helpers.rb +64 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/spec/formatting_support.rb +9 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/spec/in_sub_process.rb +52 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/spec/library_wide_checks.rb +145 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/spec/shell_out.rb +71 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/spec/stderr_splitter.rb +63 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/spec/string_matcher.rb +46 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/spec/with_isolated_directory.rb +9 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/spec/with_isolated_stderr.rb +13 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/spec.rb +81 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/version.rb +7 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/version_checker.rb +53 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support/warnings.rb +39 -0
- data/vendor/bundle/ruby/2.0.0/gems/rspec-support-3.3.0/lib/rspec/support.rb +111 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/LICENSE +19 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/README.md +192 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/Rakefile +76 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/bin/tt +112 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/doc/contributing_and_planned_features.markdown +102 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/doc/grammar_composition.markdown +65 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/doc/index.markdown +88 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/doc/pitfalls_and_advanced_techniques.markdown +51 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/doc/semantic_interpretation.markdown +218 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/doc/site.rb +112 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/doc/sitegen.rb +65 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/doc/syntactic_recognition.markdown +220 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/doc/tt.1 +83 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/doc/using_in_ruby.markdown +105 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/indented_blocks/indented_blocks.tt +73 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/indented_blocks/indented_blocks_test.rb +24 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/inner_outer.rb +51 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/inner_outer.tt +14 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/lambda_calculus/arithmetic.rb +551 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/lambda_calculus/arithmetic.treetop +98 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/lambda_calculus/arithmetic_node_classes.rb +9 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/lambda_calculus/arithmetic_test.rb +58 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/lambda_calculus/lambda_calculus.rb +718 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/lambda_calculus/lambda_calculus.treetop +132 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/lambda_calculus/lambda_calculus_node_classes.rb +5 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/lambda_calculus/lambda_calculus_test.rb +89 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/lambda_calculus/test_helper.rb +18 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/numerals.rb +210 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/examples/numerals.tt +21 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/bootstrap_gen_1_metagrammar.rb +42 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/grammar_compiler.rb +49 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/lexical_address_space.rb +17 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/metagrammar.rb +4113 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/metagrammar.treetop +503 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/anything_symbol.rb +26 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/atomic_expression.rb +14 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/character_class.rb +32 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/choice.rb +37 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/declaration_sequence.rb +24 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/grammar.rb +28 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/inline_module.rb +27 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/nonterminal.rb +13 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/optional.rb +19 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/parenthesized_expression.rb +13 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/parsing_expression.rb +150 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/parsing_rule.rb +60 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/predicate.rb +52 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/predicate_block.rb +23 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/repetition.rb +109 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/sequence.rb +75 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/terminal.rb +45 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/transient_prefix.rb +9 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes/treetop_file.rb +9 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/node_classes.rb +19 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler/ruby_builder.rb +115 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/compiler.rb +7 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/polyglot.rb +9 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/ruby_extensions/string.rb +40 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/ruby_extensions.rb +1 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/runtime/compiled_parser.rb +126 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/runtime/interval_skip_list/head_node.rb +15 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/runtime/interval_skip_list/interval_skip_list.rb +200 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/runtime/interval_skip_list/node.rb +164 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/runtime/interval_skip_list.rb +3 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/runtime/syntax_node.rb +116 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/runtime/terminal_parse_failure.rb +17 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/runtime/terminal_syntax_node.rb +17 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/runtime.rb +6 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop/version.rb +9 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/lib/treetop.rb +3 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/and_predicate_spec.rb +36 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/anything_symbol_spec.rb +47 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/character_class_spec.rb +304 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/choice_spec.rb +80 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/circular_compilation_spec.rb +30 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/failure_propagation_functional_spec.rb +21 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/grammar_compiler_spec.rb +113 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/grammar_spec.rb +44 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/multibyte_chars_spec.rb +38 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/namespace_spec.rb +42 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/nonterminal_symbol_spec.rb +40 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/not_predicate_spec.rb +52 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/occurrence_range_spec.rb +186 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/one_or_more_spec.rb +35 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/optional_spec.rb +37 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/parenthesized_expression_spec.rb +22 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/parsing_rule_spec.rb +61 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/repeated_subrule_spec.rb +29 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/semantic_predicate_spec.rb +176 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/sequence_spec.rb +129 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/terminal_spec.rb +177 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/terminal_symbol_spec.rb +40 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/test_grammar.treetop +7 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/test_grammar.tt +7 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/test_grammar_do.treetop +7 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/test_grammar_magic_coding.treetop +8 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/test_grammar_magic_encoding.treetop +8 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/tt_compiler_spec.rb +224 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/compiler/zero_or_more_spec.rb +56 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/composition/a.treetop +11 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/composition/b.treetop +11 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/composition/c.treetop +10 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/composition/d.treetop +10 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/composition/f.treetop +17 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/composition/grammar_composition_spec.rb +40 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/composition/subfolder/e_includes_c.treetop +15 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/ruby_extensions/string_spec.rb +32 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/runtime/compiled_parser_spec.rb +153 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/runtime/interval_skip_list/delete_spec.rb +147 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/runtime/interval_skip_list/expire_range_spec.rb +349 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/runtime/interval_skip_list/insert_and_delete_node_spec.rb +385 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/runtime/interval_skip_list/insert_spec.rb +660 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/runtime/interval_skip_list/interval_skip_list_spec.graffle +6175 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/runtime/interval_skip_list/interval_skip_list_spec.rb +58 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/runtime/interval_skip_list/palindromic_fixture.rb +35 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/runtime/interval_skip_list/palindromic_fixture_spec.rb +163 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/runtime/interval_skip_list/spec_helper.rb +91 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/runtime/syntax_node_spec.rb +77 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/spec/spec_helper.rb +115 -0
- data/vendor/bundle/ruby/2.0.0/gems/treetop-1.6.3/treetop.gemspec +179 -0
- data/vendor/bundle/ruby/2.0.0/specifications/blankslate-3.1.3.gemspec +30 -0
- data/vendor/bundle/ruby/2.0.0/specifications/diff-lcs-1.2.5.gemspec +65 -0
- data/vendor/bundle/ruby/2.0.0/specifications/parslet-1.7.1.gemspec +31 -0
- data/vendor/bundle/ruby/2.0.0/specifications/polyglot-0.3.5.gemspec +19 -0
- data/vendor/bundle/ruby/2.0.0/specifications/rake-10.4.2.gemspec +40 -0
- data/vendor/bundle/ruby/2.0.0/specifications/rspec-3.3.0.gemspec +39 -0
- data/vendor/bundle/ruby/2.0.0/specifications/rspec-core-3.3.2.gemspec +65 -0
- data/vendor/bundle/ruby/2.0.0/specifications/rspec-expectations-3.3.1.gemspec +47 -0
- data/vendor/bundle/ruby/2.0.0/specifications/rspec-mocks-3.3.2.gemspec +50 -0
- data/vendor/bundle/ruby/2.0.0/specifications/rspec-support-3.3.0.gemspec +35 -0
- data/vendor/bundle/ruby/2.0.0/specifications/treetop-1.6.3.gemspec +50 -0
- metadata +869 -0
@@ -0,0 +1,1807 @@
|
|
1
|
+
RSpec::Support.require_rspec_core "backtrace_formatter"
|
2
|
+
RSpec::Support.require_rspec_core "ruby_project"
|
3
|
+
RSpec::Support.require_rspec_core "formatters/deprecation_formatter"
|
4
|
+
|
5
|
+
module RSpec
|
6
|
+
module Core
|
7
|
+
# rubocop:disable Style/ClassLength
|
8
|
+
|
9
|
+
# Stores runtime configuration information.
|
10
|
+
#
|
11
|
+
# Configuration options are loaded from `~/.rspec`, `.rspec`,
|
12
|
+
# `.rspec-local`, command line switches, and the `SPEC_OPTS` environment
|
13
|
+
# variable (listed in lowest to highest precedence; for example, an option
|
14
|
+
# in `~/.rspec` can be overridden by an option in `.rspec-local`).
|
15
|
+
#
|
16
|
+
# @example Standard settings
|
17
|
+
# RSpec.configure do |c|
|
18
|
+
# c.drb = true
|
19
|
+
# c.drb_port = 1234
|
20
|
+
# c.default_path = 'behavior'
|
21
|
+
# end
|
22
|
+
#
|
23
|
+
# @example Hooks
|
24
|
+
# RSpec.configure do |c|
|
25
|
+
# c.before(:suite) { establish_connection }
|
26
|
+
# c.before(:example) { log_in_as :authorized }
|
27
|
+
# c.around(:example) { |ex| Database.transaction(&ex) }
|
28
|
+
# end
|
29
|
+
#
|
30
|
+
# @see RSpec.configure
|
31
|
+
# @see Hooks
|
32
|
+
class Configuration
|
33
|
+
include RSpec::Core::Hooks
|
34
|
+
|
35
|
+
# Module that holds `attr_reader` declarations. It's in a separate
|
36
|
+
# module to allow us to override those methods and use `super`.
|
37
|
+
# @private
|
38
|
+
Readers = Module.new
|
39
|
+
include Readers
|
40
|
+
|
41
|
+
# @private
|
42
|
+
class MustBeConfiguredBeforeExampleGroupsError < StandardError; end
|
43
|
+
|
44
|
+
# @private
|
45
|
+
def self.define_reader(name)
|
46
|
+
Readers.class_eval do
|
47
|
+
remove_method name if method_defined?(name)
|
48
|
+
attr_reader name
|
49
|
+
end
|
50
|
+
|
51
|
+
define_method(name) { value_for(name) { super() } }
|
52
|
+
end
|
53
|
+
|
54
|
+
# @private
|
55
|
+
def self.define_aliases(name, alias_name)
|
56
|
+
alias_method alias_name, name
|
57
|
+
alias_method "#{alias_name}=", "#{name}="
|
58
|
+
define_predicate_for alias_name
|
59
|
+
end
|
60
|
+
|
61
|
+
# @private
|
62
|
+
def self.define_predicate_for(*names)
|
63
|
+
names.each { |name| alias_method "#{name}?", name }
|
64
|
+
end
|
65
|
+
|
66
|
+
# @private
|
67
|
+
#
|
68
|
+
# Invoked by the `add_setting` instance method. Use that method on a
|
69
|
+
# `Configuration` instance rather than this class method.
|
70
|
+
def self.add_setting(name, opts={})
|
71
|
+
raise "Use the instance add_setting method if you want to set a default" if opts.key?(:default)
|
72
|
+
attr_writer name
|
73
|
+
add_read_only_setting name
|
74
|
+
|
75
|
+
Array(opts[:alias_with]).each do |alias_name|
|
76
|
+
define_aliases(name, alias_name)
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
# @private
|
81
|
+
#
|
82
|
+
# As `add_setting` but only add the reader.
|
83
|
+
def self.add_read_only_setting(name, opts={})
|
84
|
+
raise "Use the instance add_setting method if you want to set a default" if opts.key?(:default)
|
85
|
+
define_reader name
|
86
|
+
define_predicate_for name
|
87
|
+
end
|
88
|
+
|
89
|
+
# @macro [attach] add_setting
|
90
|
+
# @!attribute [rw] $1
|
91
|
+
# @!method $1=(value)
|
92
|
+
#
|
93
|
+
# @macro [attach] define_reader
|
94
|
+
# @!attribute [r] $1
|
95
|
+
|
96
|
+
# @macro add_setting
|
97
|
+
# Path to use if no path is provided to the `rspec` command (default:
|
98
|
+
# `"spec"`). Allows you to just type `rspec` instead of `rspec spec` to
|
99
|
+
# run all the examples in the `spec` directory.
|
100
|
+
#
|
101
|
+
# @note Other scripts invoking `rspec` indirectly will ignore this
|
102
|
+
# setting.
|
103
|
+
add_setting :default_path
|
104
|
+
|
105
|
+
# @macro add_setting
|
106
|
+
# Run examples over DRb (default: `false`). RSpec doesn't supply the DRb
|
107
|
+
# server, but you can use tools like spork.
|
108
|
+
add_setting :drb
|
109
|
+
|
110
|
+
# @macro add_setting
|
111
|
+
# The drb_port (default: nil).
|
112
|
+
add_setting :drb_port
|
113
|
+
|
114
|
+
# @macro add_setting
|
115
|
+
# Default: `$stderr`.
|
116
|
+
add_setting :error_stream
|
117
|
+
|
118
|
+
# Indicates if the DSL has been exposed off of modules and `main`.
|
119
|
+
# Default: true
|
120
|
+
def expose_dsl_globally?
|
121
|
+
Core::DSL.exposed_globally?
|
122
|
+
end
|
123
|
+
|
124
|
+
# Use this to expose the core RSpec DSL via `Module` and the `main`
|
125
|
+
# object. It will be set automatically but you can override it to
|
126
|
+
# remove the DSL.
|
127
|
+
# Default: true
|
128
|
+
def expose_dsl_globally=(value)
|
129
|
+
if value
|
130
|
+
Core::DSL.expose_globally!
|
131
|
+
Core::SharedExampleGroup::TopLevelDSL.expose_globally!
|
132
|
+
else
|
133
|
+
Core::DSL.remove_globally!
|
134
|
+
Core::SharedExampleGroup::TopLevelDSL.remove_globally!
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
# Determines where deprecation warnings are printed.
|
139
|
+
# Defaults to `$stderr`.
|
140
|
+
# @return [IO, String] IO to write to or filename to write to
|
141
|
+
define_reader :deprecation_stream
|
142
|
+
|
143
|
+
# Determines where deprecation warnings are printed.
|
144
|
+
# @param value [IO, String] IO to write to or filename to write to
|
145
|
+
def deprecation_stream=(value)
|
146
|
+
if @reporter && !value.equal?(@deprecation_stream)
|
147
|
+
warn "RSpec's reporter has already been initialized with " \
|
148
|
+
"#{deprecation_stream.inspect} as the deprecation stream, so your change to "\
|
149
|
+
"`deprecation_stream` will be ignored. You should configure it earlier for " \
|
150
|
+
"it to take effect, or use the `--deprecation-out` CLI option. " \
|
151
|
+
"(Called from #{CallerFilter.first_non_rspec_line})"
|
152
|
+
else
|
153
|
+
@deprecation_stream = value
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
# @macro define_reader
|
158
|
+
# The file path to use for persisting example statuses. Necessary for the
|
159
|
+
# `--only-failures` and `--next-failures` CLI options.
|
160
|
+
#
|
161
|
+
# @overload example_status_persistence_file_path
|
162
|
+
# @return [String] the file path
|
163
|
+
# @overload example_status_persistence_file_path=(value)
|
164
|
+
# @param value [String] the file path
|
165
|
+
define_reader :example_status_persistence_file_path
|
166
|
+
|
167
|
+
# Sets the file path to use for persisting example statuses. Necessary for the
|
168
|
+
# `--only-failures` and `--next-failures` CLI options.
|
169
|
+
def example_status_persistence_file_path=(value)
|
170
|
+
@example_status_persistence_file_path = value
|
171
|
+
clear_values_derived_from_example_status_persistence_file_path
|
172
|
+
end
|
173
|
+
|
174
|
+
# @macro define_reader
|
175
|
+
# Indicates if the `--only-failures` (or `--next-failure`) flag is being used.
|
176
|
+
define_reader :only_failures
|
177
|
+
alias_method :only_failures?, :only_failures
|
178
|
+
|
179
|
+
# @private
|
180
|
+
def only_failures_but_not_configured?
|
181
|
+
only_failures? && !example_status_persistence_file_path
|
182
|
+
end
|
183
|
+
|
184
|
+
# @macro add_setting
|
185
|
+
# Clean up and exit after the first failure (default: `false`).
|
186
|
+
add_setting :fail_fast
|
187
|
+
|
188
|
+
# @macro add_setting
|
189
|
+
# Prints the formatter output of your suite without running any
|
190
|
+
# examples or hooks.
|
191
|
+
add_setting :dry_run
|
192
|
+
|
193
|
+
# @macro add_setting
|
194
|
+
# The exit code to return if there are any failures (default: 1).
|
195
|
+
add_setting :failure_exit_code
|
196
|
+
|
197
|
+
# @macro define_reader
|
198
|
+
# Indicates files configured to be required.
|
199
|
+
define_reader :requires
|
200
|
+
|
201
|
+
# @macro define_reader
|
202
|
+
# Returns dirs that have been prepended to the load path by the `-I`
|
203
|
+
# command line option.
|
204
|
+
define_reader :libs
|
205
|
+
|
206
|
+
# @macro add_setting
|
207
|
+
# Determines where RSpec will send its output.
|
208
|
+
# Default: `$stdout`.
|
209
|
+
define_reader :output_stream
|
210
|
+
|
211
|
+
# Set the output stream for reporter.
|
212
|
+
# @attr value [IO] value for output, defaults to $stdout
|
213
|
+
def output_stream=(value)
|
214
|
+
if @reporter && !value.equal?(@output_stream)
|
215
|
+
warn "RSpec's reporter has already been initialized with " \
|
216
|
+
"#{output_stream.inspect} as the output stream, so your change to "\
|
217
|
+
"`output_stream` will be ignored. You should configure it earlier for " \
|
218
|
+
"it to take effect. (Called from #{CallerFilter.first_non_rspec_line})"
|
219
|
+
else
|
220
|
+
@output_stream = value
|
221
|
+
end
|
222
|
+
end
|
223
|
+
|
224
|
+
# @macro define_reader
|
225
|
+
# Load files matching this pattern (default: `'**{,/*/**}/*_spec.rb'`).
|
226
|
+
define_reader :pattern
|
227
|
+
|
228
|
+
# Set pattern to match files to load.
|
229
|
+
# @attr value [String] the filename pattern to filter spec files by
|
230
|
+
def pattern=(value)
|
231
|
+
update_pattern_attr :pattern, value
|
232
|
+
end
|
233
|
+
|
234
|
+
# @macro define_reader
|
235
|
+
# Exclude files matching this pattern.
|
236
|
+
define_reader :exclude_pattern
|
237
|
+
|
238
|
+
# Set pattern to match files to exclude.
|
239
|
+
# @attr value [String] the filename pattern to exclude spec files by
|
240
|
+
def exclude_pattern=(value)
|
241
|
+
update_pattern_attr :exclude_pattern, value
|
242
|
+
end
|
243
|
+
|
244
|
+
# @macro add_setting
|
245
|
+
# Report the times for the slowest examples (default: `false`).
|
246
|
+
# Use this to specify the number of examples to include in the profile.
|
247
|
+
add_setting :profile_examples
|
248
|
+
|
249
|
+
# @macro add_setting
|
250
|
+
# Run all examples if none match the configured filters
|
251
|
+
# (default: `false`).
|
252
|
+
add_setting :run_all_when_everything_filtered
|
253
|
+
|
254
|
+
# @macro add_setting
|
255
|
+
# Color to use to indicate success.
|
256
|
+
# @param color [Symbol] defaults to `:green` but can be set to one of the
|
257
|
+
# following: `[:black, :white, :red, :green, :yellow, :blue, :magenta,
|
258
|
+
# :cyan]`
|
259
|
+
add_setting :success_color
|
260
|
+
|
261
|
+
# @macro add_setting
|
262
|
+
# Color to use to print pending examples.
|
263
|
+
# @param color [Symbol] defaults to `:yellow` but can be set to one of the
|
264
|
+
# following: `[:black, :white, :red, :green, :yellow, :blue, :magenta,
|
265
|
+
# :cyan]`
|
266
|
+
add_setting :pending_color
|
267
|
+
|
268
|
+
# @macro add_setting
|
269
|
+
# Color to use to indicate failure.
|
270
|
+
# @param color [Symbol] defaults to `:red` but can be set to one of the
|
271
|
+
# following: `[:black, :white, :red, :green, :yellow, :blue, :magenta,
|
272
|
+
# :cyan]`
|
273
|
+
add_setting :failure_color
|
274
|
+
|
275
|
+
# @macro add_setting
|
276
|
+
# The default output color.
|
277
|
+
# @param color [Symbol] defaults to `:white` but can be set to one of the
|
278
|
+
# following: `[:black, :white, :red, :green, :yellow, :blue, :magenta,
|
279
|
+
# :cyan]`
|
280
|
+
add_setting :default_color
|
281
|
+
|
282
|
+
# @macro add_setting
|
283
|
+
# Color used when a pending example is fixed.
|
284
|
+
# @param color [Symbol] defaults to `:blue` but can be set to one of the
|
285
|
+
# following: `[:black, :white, :red, :green, :yellow, :blue, :magenta,
|
286
|
+
# :cyan]`
|
287
|
+
add_setting :fixed_color
|
288
|
+
|
289
|
+
# @macro add_setting
|
290
|
+
# Color used to print details.
|
291
|
+
# @param color [Symbol] defaults to `:cyan` but can be set to one of the
|
292
|
+
# following: `[:black, :white, :red, :green, :yellow, :blue, :magenta,
|
293
|
+
# :cyan]`
|
294
|
+
add_setting :detail_color
|
295
|
+
|
296
|
+
# Deprecated. This config option was added in RSpec 2 to pave the way
|
297
|
+
# for this being the default behavior in RSpec 3. Now this option is
|
298
|
+
# a no-op.
|
299
|
+
def treat_symbols_as_metadata_keys_with_true_values=(_value)
|
300
|
+
RSpec.deprecate(
|
301
|
+
"RSpec::Core::Configuration#treat_symbols_as_metadata_keys_with_true_values=",
|
302
|
+
:message => "RSpec::Core::Configuration#treat_symbols_as_metadata_keys_with_true_values= " \
|
303
|
+
"is deprecated, it is now set to true as default and " \
|
304
|
+
"setting it to false has no effect."
|
305
|
+
)
|
306
|
+
end
|
307
|
+
|
308
|
+
# Record the start time of the spec suite to measure load time.
|
309
|
+
add_setting :start_time
|
310
|
+
|
311
|
+
# @macro add_setting
|
312
|
+
# Use threadsafe options where available.
|
313
|
+
# Currently this will place a mutex around memoized values such as let blocks.
|
314
|
+
add_setting :threadsafe
|
315
|
+
|
316
|
+
# @private
|
317
|
+
add_setting :tty
|
318
|
+
# @private
|
319
|
+
attr_writer :files_to_run
|
320
|
+
# @private
|
321
|
+
attr_accessor :filter_manager
|
322
|
+
# @private
|
323
|
+
attr_accessor :static_config_filter_manager
|
324
|
+
# @private
|
325
|
+
attr_reader :backtrace_formatter, :ordering_manager, :loaded_spec_files
|
326
|
+
|
327
|
+
def initialize
|
328
|
+
# rubocop:disable Style/GlobalVars
|
329
|
+
@start_time = $_rspec_core_load_started_at || ::RSpec::Core::Time.now
|
330
|
+
# rubocop:enable Style/GlobalVars
|
331
|
+
@expectation_frameworks = []
|
332
|
+
@include_modules = FilterableItemRepository::QueryOptimized.new(:any?)
|
333
|
+
@extend_modules = FilterableItemRepository::QueryOptimized.new(:any?)
|
334
|
+
@prepend_modules = FilterableItemRepository::QueryOptimized.new(:any?)
|
335
|
+
|
336
|
+
@before_suite_hooks = []
|
337
|
+
@after_suite_hooks = []
|
338
|
+
|
339
|
+
@mock_framework = nil
|
340
|
+
@files_or_directories_to_run = []
|
341
|
+
@loaded_spec_files = Set.new
|
342
|
+
@color = false
|
343
|
+
@pattern = '**{,/*/**}/*_spec.rb'
|
344
|
+
@exclude_pattern = ''
|
345
|
+
@failure_exit_code = 1
|
346
|
+
@spec_files_loaded = false
|
347
|
+
|
348
|
+
@backtrace_formatter = BacktraceFormatter.new
|
349
|
+
|
350
|
+
@default_path = 'spec'
|
351
|
+
@deprecation_stream = $stderr
|
352
|
+
@output_stream = $stdout
|
353
|
+
@reporter = nil
|
354
|
+
@reporter_buffer = nil
|
355
|
+
@filter_manager = FilterManager.new
|
356
|
+
@static_config_filter_manager = FilterManager.new
|
357
|
+
@ordering_manager = Ordering::ConfigurationManager.new
|
358
|
+
@preferred_options = {}
|
359
|
+
@failure_color = :red
|
360
|
+
@success_color = :green
|
361
|
+
@pending_color = :yellow
|
362
|
+
@default_color = :white
|
363
|
+
@fixed_color = :blue
|
364
|
+
@detail_color = :cyan
|
365
|
+
@profile_examples = false
|
366
|
+
@requires = []
|
367
|
+
@libs = []
|
368
|
+
@derived_metadata_blocks = FilterableItemRepository::QueryOptimized.new(:any?)
|
369
|
+
@threadsafe = true
|
370
|
+
|
371
|
+
define_built_in_hooks
|
372
|
+
end
|
373
|
+
|
374
|
+
# @private
|
375
|
+
#
|
376
|
+
# Used to set higher priority option values from the command line.
|
377
|
+
def force(hash)
|
378
|
+
ordering_manager.force(hash)
|
379
|
+
@preferred_options.merge!(hash)
|
380
|
+
|
381
|
+
return unless hash.key?(:example_status_persistence_file_path)
|
382
|
+
clear_values_derived_from_example_status_persistence_file_path
|
383
|
+
end
|
384
|
+
|
385
|
+
# @private
|
386
|
+
def reset
|
387
|
+
@spec_files_loaded = false
|
388
|
+
@reporter = nil
|
389
|
+
@formatter_loader = nil
|
390
|
+
end
|
391
|
+
|
392
|
+
# @private
|
393
|
+
def reset_filters
|
394
|
+
self.filter_manager = FilterManager.new
|
395
|
+
filter_manager.include_only(
|
396
|
+
Metadata.deep_hash_dup(static_config_filter_manager.inclusions.rules)
|
397
|
+
)
|
398
|
+
filter_manager.exclude_only(
|
399
|
+
Metadata.deep_hash_dup(static_config_filter_manager.exclusions.rules)
|
400
|
+
)
|
401
|
+
end
|
402
|
+
|
403
|
+
# @overload add_setting(name)
|
404
|
+
# @overload add_setting(name, opts)
|
405
|
+
# @option opts [Symbol] :default
|
406
|
+
#
|
407
|
+
# Set a default value for the generated getter and predicate methods:
|
408
|
+
#
|
409
|
+
# add_setting(:foo, :default => "default value")
|
410
|
+
#
|
411
|
+
# @option opts [Symbol] :alias_with
|
412
|
+
#
|
413
|
+
# Use `:alias_with` to alias the setter, getter, and predicate to
|
414
|
+
# another name, or names:
|
415
|
+
#
|
416
|
+
# add_setting(:foo, :alias_with => :bar)
|
417
|
+
# add_setting(:foo, :alias_with => [:bar, :baz])
|
418
|
+
#
|
419
|
+
# Adds a custom setting to the RSpec.configuration object.
|
420
|
+
#
|
421
|
+
# RSpec.configuration.add_setting :foo
|
422
|
+
#
|
423
|
+
# Used internally and by extension frameworks like rspec-rails, so they
|
424
|
+
# can add config settings that are domain specific. For example:
|
425
|
+
#
|
426
|
+
# RSpec.configure do |c|
|
427
|
+
# c.add_setting :use_transactional_fixtures,
|
428
|
+
# :default => true,
|
429
|
+
# :alias_with => :use_transactional_examples
|
430
|
+
# end
|
431
|
+
#
|
432
|
+
# `add_setting` creates three methods on the configuration object, a
|
433
|
+
# setter, a getter, and a predicate:
|
434
|
+
#
|
435
|
+
# RSpec.configuration.foo=(value)
|
436
|
+
# RSpec.configuration.foo
|
437
|
+
# RSpec.configuration.foo? # Returns true if foo returns anything but nil or false.
|
438
|
+
def add_setting(name, opts={})
|
439
|
+
default = opts.delete(:default)
|
440
|
+
(class << self; self; end).class_exec do
|
441
|
+
add_setting(name, opts)
|
442
|
+
end
|
443
|
+
__send__("#{name}=", default) if default
|
444
|
+
end
|
445
|
+
|
446
|
+
# Returns the configured mock framework adapter module.
|
447
|
+
def mock_framework
|
448
|
+
if @mock_framework.nil?
|
449
|
+
begin
|
450
|
+
mock_with :rspec
|
451
|
+
rescue LoadError
|
452
|
+
mock_with :nothing
|
453
|
+
end
|
454
|
+
end
|
455
|
+
@mock_framework
|
456
|
+
end
|
457
|
+
|
458
|
+
# Delegates to mock_framework=(framework).
|
459
|
+
def mock_framework=(framework)
|
460
|
+
mock_with framework
|
461
|
+
end
|
462
|
+
|
463
|
+
# Regexps used to exclude lines from backtraces.
|
464
|
+
#
|
465
|
+
# Excludes lines from ruby (and jruby) source, installed gems, anything
|
466
|
+
# in any "bin" directory, and any of the RSpec libs (outside gem
|
467
|
+
# installs) by default.
|
468
|
+
#
|
469
|
+
# You can modify the list via the getter, or replace it with the setter.
|
470
|
+
#
|
471
|
+
# To override this behaviour and display a full backtrace, use
|
472
|
+
# `--backtrace` on the command line, in a `.rspec` file, or in the
|
473
|
+
# `rspec_options` attribute of RSpec's rake task.
|
474
|
+
def backtrace_exclusion_patterns
|
475
|
+
@backtrace_formatter.exclusion_patterns
|
476
|
+
end
|
477
|
+
|
478
|
+
# Set regular expressions used to exclude lines in backtrace.
|
479
|
+
# @param patterns [Regexp] set the backtrace exlusion pattern
|
480
|
+
def backtrace_exclusion_patterns=(patterns)
|
481
|
+
@backtrace_formatter.exclusion_patterns = patterns
|
482
|
+
end
|
483
|
+
|
484
|
+
# Regexps used to include lines in backtraces.
|
485
|
+
#
|
486
|
+
# Defaults to [Regexp.new Dir.getwd].
|
487
|
+
#
|
488
|
+
# Lines that match an exclusion _and_ an inclusion pattern
|
489
|
+
# will be included.
|
490
|
+
#
|
491
|
+
# You can modify the list via the getter, or replace it with the setter.
|
492
|
+
def backtrace_inclusion_patterns
|
493
|
+
@backtrace_formatter.inclusion_patterns
|
494
|
+
end
|
495
|
+
|
496
|
+
# Set regular expressions used to include lines in backtrace.
|
497
|
+
# @attr patterns [Regexp] set backtrace_formatter inclusion_patterns
|
498
|
+
def backtrace_inclusion_patterns=(patterns)
|
499
|
+
@backtrace_formatter.inclusion_patterns = patterns
|
500
|
+
end
|
501
|
+
|
502
|
+
# Adds {#backtrace_exclusion_patterns} that will filter lines from
|
503
|
+
# the named gems from backtraces.
|
504
|
+
#
|
505
|
+
# @param gem_names [Array<String>] Names of the gems to filter
|
506
|
+
#
|
507
|
+
# @example
|
508
|
+
# RSpec.configure do |config|
|
509
|
+
# config.filter_gems_from_backtrace "rack", "rake"
|
510
|
+
# end
|
511
|
+
#
|
512
|
+
# @note The patterns this adds will match the named gems in their common
|
513
|
+
# locations (e.g. system gems, vendored with bundler, installed as a
|
514
|
+
# :git dependency with bundler, etc) but is not guaranteed to work for
|
515
|
+
# all possible gem locations. For example, if you have the gem source
|
516
|
+
# in a directory with a completely unrelated name, and use bundler's
|
517
|
+
# :path option, this will not filter it.
|
518
|
+
def filter_gems_from_backtrace(*gem_names)
|
519
|
+
gem_names.each do |name|
|
520
|
+
@backtrace_formatter.filter_gem(name)
|
521
|
+
end
|
522
|
+
end
|
523
|
+
|
524
|
+
# @private
|
525
|
+
MOCKING_ADAPTERS = {
|
526
|
+
:rspec => :RSpec,
|
527
|
+
:flexmock => :Flexmock,
|
528
|
+
:rr => :RR,
|
529
|
+
:mocha => :Mocha,
|
530
|
+
:nothing => :Null
|
531
|
+
}
|
532
|
+
|
533
|
+
# Sets the mock framework adapter module.
|
534
|
+
#
|
535
|
+
# `framework` can be a Symbol or a Module.
|
536
|
+
#
|
537
|
+
# Given any of `:rspec`, `:mocha`, `:flexmock`, or `:rr`, configures the
|
538
|
+
# named framework.
|
539
|
+
#
|
540
|
+
# Given `:nothing`, configures no framework. Use this if you don't use
|
541
|
+
# any mocking framework to save a little bit of overhead.
|
542
|
+
#
|
543
|
+
# Given a Module, includes that module in every example group. The module
|
544
|
+
# should adhere to RSpec's mock framework adapter API:
|
545
|
+
#
|
546
|
+
# setup_mocks_for_rspec
|
547
|
+
# - called before each example
|
548
|
+
#
|
549
|
+
# verify_mocks_for_rspec
|
550
|
+
# - called after each example if the example hasn't yet failed.
|
551
|
+
# Framework should raise an exception when expectations fail
|
552
|
+
#
|
553
|
+
# teardown_mocks_for_rspec
|
554
|
+
# - called after verify_mocks_for_rspec (even if there are errors)
|
555
|
+
#
|
556
|
+
# If the module responds to `configuration` and `mock_with` receives a
|
557
|
+
# block, it will yield the configuration object to the block e.g.
|
558
|
+
#
|
559
|
+
# config.mock_with OtherMockFrameworkAdapter do |mod_config|
|
560
|
+
# mod_config.custom_setting = true
|
561
|
+
# end
|
562
|
+
def mock_with(framework)
|
563
|
+
framework_module =
|
564
|
+
if framework.is_a?(Module)
|
565
|
+
framework
|
566
|
+
else
|
567
|
+
const_name = MOCKING_ADAPTERS.fetch(framework) do
|
568
|
+
raise ArgumentError,
|
569
|
+
"Unknown mocking framework: #{framework.inspect}. " \
|
570
|
+
"Pass a module or one of #{MOCKING_ADAPTERS.keys.inspect}"
|
571
|
+
end
|
572
|
+
|
573
|
+
RSpec::Support.require_rspec_core "mocking_adapters/#{const_name.to_s.downcase}"
|
574
|
+
RSpec::Core::MockingAdapters.const_get(const_name)
|
575
|
+
end
|
576
|
+
|
577
|
+
new_name, old_name = [framework_module, @mock_framework].map do |mod|
|
578
|
+
mod.respond_to?(:framework_name) ? mod.framework_name : :unnamed
|
579
|
+
end
|
580
|
+
|
581
|
+
unless new_name == old_name
|
582
|
+
assert_no_example_groups_defined(:mock_framework)
|
583
|
+
end
|
584
|
+
|
585
|
+
if block_given?
|
586
|
+
raise "#{framework_module} must respond to `configuration` so that " \
|
587
|
+
"mock_with can yield it." unless framework_module.respond_to?(:configuration)
|
588
|
+
yield framework_module.configuration
|
589
|
+
end
|
590
|
+
|
591
|
+
@mock_framework = framework_module
|
592
|
+
end
|
593
|
+
|
594
|
+
# Returns the configured expectation framework adapter module(s)
|
595
|
+
def expectation_frameworks
|
596
|
+
if @expectation_frameworks.empty?
|
597
|
+
begin
|
598
|
+
expect_with :rspec
|
599
|
+
rescue LoadError
|
600
|
+
expect_with Module.new
|
601
|
+
end
|
602
|
+
end
|
603
|
+
@expectation_frameworks
|
604
|
+
end
|
605
|
+
|
606
|
+
# Delegates to expect_with(framework).
|
607
|
+
def expectation_framework=(framework)
|
608
|
+
expect_with(framework)
|
609
|
+
end
|
610
|
+
|
611
|
+
# Sets the expectation framework module(s) to be included in each example
|
612
|
+
# group.
|
613
|
+
#
|
614
|
+
# `frameworks` can be `:rspec`, `:test_unit`, `:minitest`, a custom
|
615
|
+
# module, or any combination thereof:
|
616
|
+
#
|
617
|
+
# config.expect_with :rspec
|
618
|
+
# config.expect_with :test_unit
|
619
|
+
# config.expect_with :minitest
|
620
|
+
# config.expect_with :rspec, :minitest
|
621
|
+
# config.expect_with OtherExpectationFramework
|
622
|
+
#
|
623
|
+
# RSpec will translate `:rspec`, `:minitest`, and `:test_unit` into the
|
624
|
+
# appropriate modules.
|
625
|
+
#
|
626
|
+
# ## Configuration
|
627
|
+
#
|
628
|
+
# If the module responds to `configuration`, `expect_with` will
|
629
|
+
# yield the `configuration` object if given a block:
|
630
|
+
#
|
631
|
+
# config.expect_with OtherExpectationFramework do |custom_config|
|
632
|
+
# custom_config.custom_setting = true
|
633
|
+
# end
|
634
|
+
def expect_with(*frameworks)
|
635
|
+
modules = frameworks.map do |framework|
|
636
|
+
case framework
|
637
|
+
when Module
|
638
|
+
framework
|
639
|
+
when :rspec
|
640
|
+
require 'rspec/expectations'
|
641
|
+
|
642
|
+
# Tag this exception class so our exception formatting logic knows
|
643
|
+
# that it satisfies the `MultipleExceptionError` interface.
|
644
|
+
::RSpec::Expectations::MultipleExpectationsNotMetError.__send__(
|
645
|
+
:include, MultipleExceptionError::InterfaceTag
|
646
|
+
)
|
647
|
+
|
648
|
+
::RSpec::Matchers
|
649
|
+
when :test_unit
|
650
|
+
require 'rspec/core/test_unit_assertions_adapter'
|
651
|
+
::RSpec::Core::TestUnitAssertionsAdapter
|
652
|
+
when :minitest
|
653
|
+
require 'rspec/core/minitest_assertions_adapter'
|
654
|
+
::RSpec::Core::MinitestAssertionsAdapter
|
655
|
+
else
|
656
|
+
raise ArgumentError, "#{framework.inspect} is not supported"
|
657
|
+
end
|
658
|
+
end
|
659
|
+
|
660
|
+
if (modules - @expectation_frameworks).any?
|
661
|
+
assert_no_example_groups_defined(:expect_with)
|
662
|
+
end
|
663
|
+
|
664
|
+
if block_given?
|
665
|
+
raise "expect_with only accepts a block with a single argument. " \
|
666
|
+
"Call expect_with #{modules.length} times, " \
|
667
|
+
"once with each argument, instead." if modules.length > 1
|
668
|
+
raise "#{modules.first} must respond to `configuration` so that " \
|
669
|
+
"expect_with can yield it." unless modules.first.respond_to?(:configuration)
|
670
|
+
yield modules.first.configuration
|
671
|
+
end
|
672
|
+
|
673
|
+
@expectation_frameworks.push(*modules)
|
674
|
+
end
|
675
|
+
|
676
|
+
# Check if full backtrace is enabled.
|
677
|
+
# @return [Boolean] is full backtrace enabled
|
678
|
+
def full_backtrace?
|
679
|
+
@backtrace_formatter.full_backtrace?
|
680
|
+
end
|
681
|
+
|
682
|
+
# Toggle full backtrace.
|
683
|
+
# @attr true_or_false [Boolean] toggle full backtrace display
|
684
|
+
def full_backtrace=(true_or_false)
|
685
|
+
@backtrace_formatter.full_backtrace = true_or_false
|
686
|
+
end
|
687
|
+
|
688
|
+
# Returns the configuration option for color, but should not
|
689
|
+
# be used to check if color is supported.
|
690
|
+
#
|
691
|
+
# @see color_enabled?
|
692
|
+
# @return [Boolean]
|
693
|
+
def color
|
694
|
+
value_for(:color) { @color }
|
695
|
+
end
|
696
|
+
|
697
|
+
# Check if color is enabled for a particular output.
|
698
|
+
# @param output [IO] an output stream to use, defaults to the current
|
699
|
+
# `output_stream`
|
700
|
+
# @return [Boolean]
|
701
|
+
def color_enabled?(output=output_stream)
|
702
|
+
output_to_tty?(output) && color
|
703
|
+
end
|
704
|
+
|
705
|
+
# Toggle output color.
|
706
|
+
# @attr true_or_false [Boolean] toggle color enabled
|
707
|
+
def color=(true_or_false)
|
708
|
+
return unless true_or_false
|
709
|
+
|
710
|
+
if RSpec::Support::OS.windows? && !ENV['ANSICON']
|
711
|
+
RSpec.warning "You must use ANSICON 1.31 or later " \
|
712
|
+
"(http://adoxa.3eeweb.com/ansicon/) to use colour " \
|
713
|
+
"on Windows"
|
714
|
+
@color = false
|
715
|
+
else
|
716
|
+
@color = true
|
717
|
+
end
|
718
|
+
end
|
719
|
+
|
720
|
+
# @private
|
721
|
+
def libs=(libs)
|
722
|
+
libs.map do |lib|
|
723
|
+
@libs.unshift lib
|
724
|
+
$LOAD_PATH.unshift lib
|
725
|
+
end
|
726
|
+
end
|
727
|
+
|
728
|
+
# Run examples matching on `description` in all files to run.
|
729
|
+
# @param description [String, Regexp] the pattern to filter on
|
730
|
+
def full_description=(description)
|
731
|
+
filter_run :full_description => Regexp.union(*Array(description).map { |d| Regexp.new(d) })
|
732
|
+
end
|
733
|
+
|
734
|
+
# @return [Array] full description filter
|
735
|
+
def full_description
|
736
|
+
filter.fetch :full_description, nil
|
737
|
+
end
|
738
|
+
|
739
|
+
# @overload add_formatter(formatter)
|
740
|
+
#
|
741
|
+
# Adds a formatter to the formatters collection. `formatter` can be a
|
742
|
+
# string representing any of the built-in formatters (see
|
743
|
+
# `built_in_formatter`), or a custom formatter class.
|
744
|
+
#
|
745
|
+
# ### Note
|
746
|
+
#
|
747
|
+
# For internal purposes, `add_formatter` also accepts the name of a class
|
748
|
+
# and paths to use for output streams, but you should consider that a
|
749
|
+
# private api that may change at any time without notice.
|
750
|
+
def add_formatter(formatter_to_use, *paths)
|
751
|
+
paths << output_stream if paths.empty?
|
752
|
+
formatter_loader.add formatter_to_use, *paths
|
753
|
+
end
|
754
|
+
alias_method :formatter=, :add_formatter
|
755
|
+
|
756
|
+
# The formatter that will be used if no formatter has been set.
|
757
|
+
# Defaults to 'progress'.
|
758
|
+
def default_formatter
|
759
|
+
formatter_loader.default_formatter
|
760
|
+
end
|
761
|
+
|
762
|
+
# Sets a fallback formatter to use if none other has been set.
|
763
|
+
#
|
764
|
+
# @example
|
765
|
+
#
|
766
|
+
# RSpec.configure do |rspec|
|
767
|
+
# rspec.default_formatter = 'doc'
|
768
|
+
# end
|
769
|
+
def default_formatter=(value)
|
770
|
+
formatter_loader.default_formatter = value
|
771
|
+
end
|
772
|
+
|
773
|
+
# Returns a duplicate of the formatters currently loaded in
|
774
|
+
# the `FormatterLoader` for introspection.
|
775
|
+
#
|
776
|
+
# Note as this is a duplicate, any mutations will be disregarded.
|
777
|
+
#
|
778
|
+
# @return [Array] the formatters currently loaded
|
779
|
+
def formatters
|
780
|
+
formatter_loader.formatters.dup
|
781
|
+
end
|
782
|
+
|
783
|
+
# @private
|
784
|
+
def formatter_loader
|
785
|
+
@formatter_loader ||= Formatters::Loader.new(Reporter.new(self))
|
786
|
+
end
|
787
|
+
|
788
|
+
# @private
|
789
|
+
#
|
790
|
+
# This buffer is used to capture all messages sent to the reporter during
|
791
|
+
# reporter initialization. It can then replay those messages after the
|
792
|
+
# formatter is correctly initialized. Otherwise, deprecation warnings
|
793
|
+
# during formatter initialization can cause an infinite loop.
|
794
|
+
class DeprecationReporterBuffer
|
795
|
+
def initialize
|
796
|
+
@calls = []
|
797
|
+
end
|
798
|
+
|
799
|
+
def deprecation(*args)
|
800
|
+
@calls << args
|
801
|
+
end
|
802
|
+
|
803
|
+
def play_onto(reporter)
|
804
|
+
@calls.each do |args|
|
805
|
+
reporter.deprecation(*args)
|
806
|
+
end
|
807
|
+
end
|
808
|
+
end
|
809
|
+
|
810
|
+
# @private
|
811
|
+
def reporter
|
812
|
+
# @reporter_buffer should only ever be set in this method to cover
|
813
|
+
# initialization of @reporter.
|
814
|
+
@reporter_buffer || @reporter ||=
|
815
|
+
begin
|
816
|
+
@reporter_buffer = DeprecationReporterBuffer.new
|
817
|
+
formatter_loader.setup_default output_stream, deprecation_stream
|
818
|
+
@reporter_buffer.play_onto(formatter_loader.reporter)
|
819
|
+
@reporter_buffer = nil
|
820
|
+
formatter_loader.reporter
|
821
|
+
end
|
822
|
+
end
|
823
|
+
|
824
|
+
# @api private
|
825
|
+
#
|
826
|
+
# Defaults `profile_examples` to 10 examples when `@profile_examples` is
|
827
|
+
# `true`.
|
828
|
+
def profile_examples
|
829
|
+
profile = value_for(:profile_examples) { @profile_examples }
|
830
|
+
if profile && !profile.is_a?(Integer)
|
831
|
+
10
|
832
|
+
else
|
833
|
+
profile
|
834
|
+
end
|
835
|
+
end
|
836
|
+
|
837
|
+
# @private
|
838
|
+
def files_or_directories_to_run=(*files)
|
839
|
+
files = files.flatten
|
840
|
+
|
841
|
+
if (command == 'rspec' || Runner.running_in_drb?) && default_path && files.empty?
|
842
|
+
files << default_path
|
843
|
+
end
|
844
|
+
|
845
|
+
@files_or_directories_to_run = files
|
846
|
+
@files_to_run = nil
|
847
|
+
end
|
848
|
+
|
849
|
+
# The spec files RSpec will run.
|
850
|
+
# @return [Array] specified files about to run
|
851
|
+
def files_to_run
|
852
|
+
@files_to_run ||= get_files_to_run(@files_or_directories_to_run)
|
853
|
+
end
|
854
|
+
|
855
|
+
# @private
|
856
|
+
def last_run_statuses
|
857
|
+
@last_run_statuses ||= Hash.new(UNKNOWN_STATUS).tap do |statuses|
|
858
|
+
if (path = example_status_persistence_file_path)
|
859
|
+
begin
|
860
|
+
ExampleStatusPersister.load_from(path).inject(statuses) do |hash, example|
|
861
|
+
hash[example.fetch(:example_id)] = example.fetch(:status)
|
862
|
+
hash
|
863
|
+
end
|
864
|
+
rescue SystemCallError => e
|
865
|
+
RSpec.warning "Could not read from #{path.inspect} (configured as " \
|
866
|
+
"`config.example_status_persistence_file_path`) due " \
|
867
|
+
"to a system error: #{e.inspect}. Please check that " \
|
868
|
+
"the config option is set to an accessible, valid " \
|
869
|
+
"file path", :call_site => nil
|
870
|
+
end
|
871
|
+
end
|
872
|
+
end
|
873
|
+
end
|
874
|
+
|
875
|
+
# @private
|
876
|
+
UNKNOWN_STATUS = "unknown".freeze
|
877
|
+
|
878
|
+
# @private
|
879
|
+
FAILED_STATUS = "failed".freeze
|
880
|
+
|
881
|
+
# @private
|
882
|
+
def spec_files_with_failures
|
883
|
+
@spec_files_with_failures ||= last_run_statuses.inject(Set.new) do |files, (id, status)|
|
884
|
+
files << id.split(ON_SQUARE_BRACKETS).first if status == FAILED_STATUS
|
885
|
+
files
|
886
|
+
end.to_a
|
887
|
+
end
|
888
|
+
|
889
|
+
# Creates a method that delegates to `example` including the submitted
|
890
|
+
# `args`. Used internally to add variants of `example` like `pending`:
|
891
|
+
# @param name [String] example name alias
|
892
|
+
# @param args [Array<Symbol>, Hash] metadata for the generated example
|
893
|
+
#
|
894
|
+
# @note The specific example alias below (`pending`) is already
|
895
|
+
# defined for you.
|
896
|
+
# @note Use with caution. This extends the language used in your
|
897
|
+
# specs, but does not add any additional documentation. We use this
|
898
|
+
# in RSpec to define methods like `focus` and `xit`, but we also add
|
899
|
+
# docs for those methods.
|
900
|
+
#
|
901
|
+
# @example
|
902
|
+
# RSpec.configure do |config|
|
903
|
+
# config.alias_example_to :pending, :pending => true
|
904
|
+
# end
|
905
|
+
#
|
906
|
+
# # This lets you do this:
|
907
|
+
#
|
908
|
+
# describe Thing do
|
909
|
+
# pending "does something" do
|
910
|
+
# thing = Thing.new
|
911
|
+
# end
|
912
|
+
# end
|
913
|
+
#
|
914
|
+
# # ... which is the equivalent of
|
915
|
+
#
|
916
|
+
# describe Thing do
|
917
|
+
# it "does something", :pending => true do
|
918
|
+
# thing = Thing.new
|
919
|
+
# end
|
920
|
+
# end
|
921
|
+
def alias_example_to(name, *args)
|
922
|
+
extra_options = Metadata.build_hash_from(args)
|
923
|
+
RSpec::Core::ExampleGroup.define_example_method(name, extra_options)
|
924
|
+
end
|
925
|
+
|
926
|
+
# Creates a method that defines an example group with the provided
|
927
|
+
# metadata. Can be used to define example group/metadata shortcuts.
|
928
|
+
#
|
929
|
+
# @example
|
930
|
+
# RSpec.configure do |config|
|
931
|
+
# config.alias_example_group_to :describe_model, :type => :model
|
932
|
+
# end
|
933
|
+
#
|
934
|
+
# shared_context_for "model tests", :type => :model do
|
935
|
+
# # define common model test helper methods, `let` declarations, etc
|
936
|
+
# end
|
937
|
+
#
|
938
|
+
# # This lets you do this:
|
939
|
+
#
|
940
|
+
# RSpec.describe_model User do
|
941
|
+
# end
|
942
|
+
#
|
943
|
+
# # ... which is the equivalent of
|
944
|
+
#
|
945
|
+
# RSpec.describe User, :type => :model do
|
946
|
+
# end
|
947
|
+
#
|
948
|
+
# @note The defined aliased will also be added to the top level
|
949
|
+
# (e.g. `main` and from within modules) if
|
950
|
+
# `expose_dsl_globally` is set to true.
|
951
|
+
# @see #alias_example_to
|
952
|
+
# @see #expose_dsl_globally=
|
953
|
+
def alias_example_group_to(new_name, *args)
|
954
|
+
extra_options = Metadata.build_hash_from(args)
|
955
|
+
RSpec::Core::ExampleGroup.define_example_group_method(new_name, extra_options)
|
956
|
+
end
|
957
|
+
|
958
|
+
# Define an alias for it_should_behave_like that allows different
|
959
|
+
# language (like "it_has_behavior" or "it_behaves_like") to be
|
960
|
+
# employed when including shared examples.
|
961
|
+
#
|
962
|
+
# @example
|
963
|
+
# RSpec.configure do |config|
|
964
|
+
# config.alias_it_behaves_like_to(:it_has_behavior, 'has behavior:')
|
965
|
+
# end
|
966
|
+
#
|
967
|
+
# # allows the user to include a shared example group like:
|
968
|
+
#
|
969
|
+
# describe Entity do
|
970
|
+
# it_has_behavior 'sortability' do
|
971
|
+
# let(:sortable) { Entity.new }
|
972
|
+
# end
|
973
|
+
# end
|
974
|
+
#
|
975
|
+
# # which is reported in the output as:
|
976
|
+
# # Entity
|
977
|
+
# # has behavior: sortability
|
978
|
+
# # ...sortability examples here
|
979
|
+
#
|
980
|
+
# @note Use with caution. This extends the language used in your
|
981
|
+
# specs, but does not add any additional documentation. We use this
|
982
|
+
# in RSpec to define `it_should_behave_like` (for backward
|
983
|
+
# compatibility), but we also add docs for that method.
|
984
|
+
def alias_it_behaves_like_to(new_name, report_label='')
|
985
|
+
RSpec::Core::ExampleGroup.define_nested_shared_group_method(new_name, report_label)
|
986
|
+
end
|
987
|
+
alias_method :alias_it_should_behave_like_to, :alias_it_behaves_like_to
|
988
|
+
|
989
|
+
# Adds key/value pairs to the `inclusion_filter`. If `args`
|
990
|
+
# includes any symbols that are not part of the hash, each symbol
|
991
|
+
# is treated as a key in the hash with the value `true`.
|
992
|
+
#
|
993
|
+
# ### Note
|
994
|
+
#
|
995
|
+
# Filters set using this method can be overridden from the command line
|
996
|
+
# or config files (e.g. `.rspec`).
|
997
|
+
#
|
998
|
+
# @example
|
999
|
+
# # Given this declaration.
|
1000
|
+
# describe "something", :foo => 'bar' do
|
1001
|
+
# # ...
|
1002
|
+
# end
|
1003
|
+
#
|
1004
|
+
# # Any of the following will include that group.
|
1005
|
+
# config.filter_run_including :foo => 'bar'
|
1006
|
+
# config.filter_run_including :foo => /^ba/
|
1007
|
+
# config.filter_run_including :foo => lambda {|v| v == 'bar'}
|
1008
|
+
# config.filter_run_including :foo => lambda {|v,m| m[:foo] == 'bar'}
|
1009
|
+
#
|
1010
|
+
# # Given a proc with an arity of 1, the lambda is passed the value
|
1011
|
+
# # related to the key, e.g.
|
1012
|
+
# config.filter_run_including :foo => lambda {|v| v == 'bar'}
|
1013
|
+
#
|
1014
|
+
# # Given a proc with an arity of 2, the lambda is passed the value
|
1015
|
+
# # related to the key, and the metadata itself e.g.
|
1016
|
+
# config.filter_run_including :foo => lambda {|v,m| m[:foo] == 'bar'}
|
1017
|
+
#
|
1018
|
+
# filter_run_including :foo # same as filter_run_including :foo => true
|
1019
|
+
def filter_run_including(*args)
|
1020
|
+
meta = Metadata.build_hash_from(args, :warn_about_example_group_filtering)
|
1021
|
+
filter_manager.include_with_low_priority meta
|
1022
|
+
static_config_filter_manager.include_with_low_priority Metadata.deep_hash_dup(meta)
|
1023
|
+
end
|
1024
|
+
|
1025
|
+
alias_method :filter_run, :filter_run_including
|
1026
|
+
|
1027
|
+
# Clears and reassigns the `inclusion_filter`. Set to `nil` if you don't
|
1028
|
+
# want any inclusion filter at all.
|
1029
|
+
#
|
1030
|
+
# ### Warning
|
1031
|
+
#
|
1032
|
+
# This overrides any inclusion filters/tags set on the command line or in
|
1033
|
+
# configuration files.
|
1034
|
+
def inclusion_filter=(filter)
|
1035
|
+
meta = Metadata.build_hash_from([filter], :warn_about_example_group_filtering)
|
1036
|
+
filter_manager.include_only meta
|
1037
|
+
end
|
1038
|
+
|
1039
|
+
alias_method :filter=, :inclusion_filter=
|
1040
|
+
|
1041
|
+
# Returns the `inclusion_filter`. If none has been set, returns an empty
|
1042
|
+
# hash.
|
1043
|
+
def inclusion_filter
|
1044
|
+
filter_manager.inclusions
|
1045
|
+
end
|
1046
|
+
|
1047
|
+
alias_method :filter, :inclusion_filter
|
1048
|
+
|
1049
|
+
# Adds key/value pairs to the `exclusion_filter`. If `args`
|
1050
|
+
# includes any symbols that are not part of the hash, each symbol
|
1051
|
+
# is treated as a key in the hash with the value `true`.
|
1052
|
+
#
|
1053
|
+
# ### Note
|
1054
|
+
#
|
1055
|
+
# Filters set using this method can be overridden from the command line
|
1056
|
+
# or config files (e.g. `.rspec`).
|
1057
|
+
#
|
1058
|
+
# @example
|
1059
|
+
# # Given this declaration.
|
1060
|
+
# describe "something", :foo => 'bar' do
|
1061
|
+
# # ...
|
1062
|
+
# end
|
1063
|
+
#
|
1064
|
+
# # Any of the following will exclude that group.
|
1065
|
+
# config.filter_run_excluding :foo => 'bar'
|
1066
|
+
# config.filter_run_excluding :foo => /^ba/
|
1067
|
+
# config.filter_run_excluding :foo => lambda {|v| v == 'bar'}
|
1068
|
+
# config.filter_run_excluding :foo => lambda {|v,m| m[:foo] == 'bar'}
|
1069
|
+
#
|
1070
|
+
# # Given a proc with an arity of 1, the lambda is passed the value
|
1071
|
+
# # related to the key, e.g.
|
1072
|
+
# config.filter_run_excluding :foo => lambda {|v| v == 'bar'}
|
1073
|
+
#
|
1074
|
+
# # Given a proc with an arity of 2, the lambda is passed the value
|
1075
|
+
# # related to the key, and the metadata itself e.g.
|
1076
|
+
# config.filter_run_excluding :foo => lambda {|v,m| m[:foo] == 'bar'}
|
1077
|
+
#
|
1078
|
+
# filter_run_excluding :foo # same as filter_run_excluding :foo => true
|
1079
|
+
def filter_run_excluding(*args)
|
1080
|
+
meta = Metadata.build_hash_from(args, :warn_about_example_group_filtering)
|
1081
|
+
filter_manager.exclude_with_low_priority meta
|
1082
|
+
static_config_filter_manager.exclude_with_low_priority Metadata.deep_hash_dup(meta)
|
1083
|
+
end
|
1084
|
+
|
1085
|
+
# Clears and reassigns the `exclusion_filter`. Set to `nil` if you don't
|
1086
|
+
# want any exclusion filter at all.
|
1087
|
+
#
|
1088
|
+
# ### Warning
|
1089
|
+
#
|
1090
|
+
# This overrides any exclusion filters/tags set on the command line or in
|
1091
|
+
# configuration files.
|
1092
|
+
def exclusion_filter=(filter)
|
1093
|
+
meta = Metadata.build_hash_from([filter], :warn_about_example_group_filtering)
|
1094
|
+
filter_manager.exclude_only meta
|
1095
|
+
end
|
1096
|
+
|
1097
|
+
# Returns the `exclusion_filter`. If none has been set, returns an empty
|
1098
|
+
# hash.
|
1099
|
+
def exclusion_filter
|
1100
|
+
filter_manager.exclusions
|
1101
|
+
end
|
1102
|
+
|
1103
|
+
# Tells RSpec to include `mod` in example groups. Methods defined in
|
1104
|
+
# `mod` are exposed to examples (not example groups). Use `filters` to
|
1105
|
+
# constrain the groups or examples in which to include the module.
|
1106
|
+
#
|
1107
|
+
# @example
|
1108
|
+
#
|
1109
|
+
# module AuthenticationHelpers
|
1110
|
+
# def login_as(user)
|
1111
|
+
# # ...
|
1112
|
+
# end
|
1113
|
+
# end
|
1114
|
+
#
|
1115
|
+
# module UserHelpers
|
1116
|
+
# def users(username)
|
1117
|
+
# # ...
|
1118
|
+
# end
|
1119
|
+
# end
|
1120
|
+
#
|
1121
|
+
# RSpec.configure do |config|
|
1122
|
+
# config.include(UserHelpers) # included in all modules
|
1123
|
+
# config.include(AuthenticationHelpers, :type => :request)
|
1124
|
+
# end
|
1125
|
+
#
|
1126
|
+
# describe "edit profile", :type => :request do
|
1127
|
+
# it "can be viewed by owning user" do
|
1128
|
+
# login_as users(:jdoe)
|
1129
|
+
# get "/profiles/jdoe"
|
1130
|
+
# assert_select ".username", :text => 'jdoe'
|
1131
|
+
# end
|
1132
|
+
# end
|
1133
|
+
#
|
1134
|
+
# @note Filtered module inclusions can also be applied to
|
1135
|
+
# individual examples that have matching metadata. Just like
|
1136
|
+
# Ruby's object model is that every object has a singleton class
|
1137
|
+
# which has only a single instance, RSpec's model is that every
|
1138
|
+
# example has a singleton example group containing just the one
|
1139
|
+
# example.
|
1140
|
+
#
|
1141
|
+
# @see #extend
|
1142
|
+
# @see #prepend
|
1143
|
+
def include(mod, *filters)
|
1144
|
+
meta = Metadata.build_hash_from(filters, :warn_about_example_group_filtering)
|
1145
|
+
@include_modules.append(mod, meta)
|
1146
|
+
configure_existing_groups(mod, meta, :safe_include)
|
1147
|
+
end
|
1148
|
+
|
1149
|
+
# Tells RSpec to extend example groups with `mod`. Methods defined in
|
1150
|
+
# `mod` are exposed to example groups (not examples). Use `filters` to
|
1151
|
+
# constrain the groups to extend.
|
1152
|
+
#
|
1153
|
+
# Similar to `include`, but behavior is added to example groups, which
|
1154
|
+
# are classes, rather than the examples, which are instances of those
|
1155
|
+
# classes.
|
1156
|
+
#
|
1157
|
+
# @example
|
1158
|
+
#
|
1159
|
+
# module UiHelpers
|
1160
|
+
# def run_in_browser
|
1161
|
+
# # ...
|
1162
|
+
# end
|
1163
|
+
# end
|
1164
|
+
#
|
1165
|
+
# RSpec.configure do |config|
|
1166
|
+
# config.extend(UiHelpers, :type => :request)
|
1167
|
+
# end
|
1168
|
+
#
|
1169
|
+
# describe "edit profile", :type => :request do
|
1170
|
+
# run_in_browser
|
1171
|
+
#
|
1172
|
+
# it "does stuff in the client" do
|
1173
|
+
# # ...
|
1174
|
+
# end
|
1175
|
+
# end
|
1176
|
+
#
|
1177
|
+
# @see #include
|
1178
|
+
# @see #prepend
|
1179
|
+
def extend(mod, *filters)
|
1180
|
+
meta = Metadata.build_hash_from(filters, :warn_about_example_group_filtering)
|
1181
|
+
@extend_modules.append(mod, meta)
|
1182
|
+
configure_existing_groups(mod, meta, :safe_extend)
|
1183
|
+
end
|
1184
|
+
|
1185
|
+
if RSpec::Support::RubyFeatures.module_prepends_supported?
|
1186
|
+
# Tells RSpec to prepend example groups with `mod`. Methods defined in
|
1187
|
+
# `mod` are exposed to examples (not example groups). Use `filters` to
|
1188
|
+
# constrain the groups in which to prepend the module.
|
1189
|
+
#
|
1190
|
+
# Similar to `include`, but module is included before the example group's class
|
1191
|
+
# in the ancestor chain.
|
1192
|
+
#
|
1193
|
+
# @example
|
1194
|
+
#
|
1195
|
+
# module OverrideMod
|
1196
|
+
# def override_me
|
1197
|
+
# "overridden"
|
1198
|
+
# end
|
1199
|
+
# end
|
1200
|
+
#
|
1201
|
+
# RSpec.configure do |config|
|
1202
|
+
# config.prepend(OverrideMod, :method => :prepend)
|
1203
|
+
# end
|
1204
|
+
#
|
1205
|
+
# describe "overriding example's class", :method => :prepend do
|
1206
|
+
# it "finds the user" do
|
1207
|
+
# self.class.class_eval do
|
1208
|
+
# def override_me
|
1209
|
+
# end
|
1210
|
+
# end
|
1211
|
+
# override_me # => "overridden"
|
1212
|
+
# # ...
|
1213
|
+
# end
|
1214
|
+
# end
|
1215
|
+
#
|
1216
|
+
# @see #include
|
1217
|
+
# @see #extend
|
1218
|
+
def prepend(mod, *filters)
|
1219
|
+
meta = Metadata.build_hash_from(filters, :warn_about_example_group_filtering)
|
1220
|
+
@prepend_modules.append(mod, meta)
|
1221
|
+
configure_existing_groups(mod, meta, :safe_prepend)
|
1222
|
+
end
|
1223
|
+
end
|
1224
|
+
|
1225
|
+
# @private
|
1226
|
+
#
|
1227
|
+
# Used internally to extend a group with modules using `include`, `prepend` and/or
|
1228
|
+
# `extend`.
|
1229
|
+
def configure_group(group)
|
1230
|
+
configure_group_with group, @include_modules, :safe_include
|
1231
|
+
configure_group_with group, @extend_modules, :safe_extend
|
1232
|
+
configure_group_with group, @prepend_modules, :safe_prepend
|
1233
|
+
end
|
1234
|
+
|
1235
|
+
# @private
|
1236
|
+
def configure_group_with(group, module_list, application_method)
|
1237
|
+
module_list.items_for(group.metadata).each do |mod|
|
1238
|
+
__send__(application_method, mod, group)
|
1239
|
+
end
|
1240
|
+
end
|
1241
|
+
|
1242
|
+
# @private
|
1243
|
+
def configure_existing_groups(mod, meta, application_method)
|
1244
|
+
RSpec.world.all_example_groups.each do |group|
|
1245
|
+
next unless meta.empty? || MetadataFilter.apply?(:any?, meta, group.metadata)
|
1246
|
+
__send__(application_method, mod, group)
|
1247
|
+
end
|
1248
|
+
end
|
1249
|
+
|
1250
|
+
# @private
|
1251
|
+
#
|
1252
|
+
# Used internally to extend the singleton class of a single example's
|
1253
|
+
# example group instance with modules using `include` and/or `extend`.
|
1254
|
+
def configure_example(example)
|
1255
|
+
singleton_group = example.example_group_instance.singleton_class
|
1256
|
+
|
1257
|
+
# We replace the metadata so that SharedExampleGroupModule#included
|
1258
|
+
# has access to the example's metadata[:location].
|
1259
|
+
singleton_group.with_replaced_metadata(example.metadata) do
|
1260
|
+
modules = @include_modules.items_for(example.metadata)
|
1261
|
+
modules.each do |mod|
|
1262
|
+
safe_include(mod, example.example_group_instance.singleton_class)
|
1263
|
+
end
|
1264
|
+
|
1265
|
+
MemoizedHelpers.define_helpers_on(singleton_group) unless modules.empty?
|
1266
|
+
end
|
1267
|
+
end
|
1268
|
+
|
1269
|
+
if RSpec::Support::RubyFeatures.module_prepends_supported?
|
1270
|
+
# @private
|
1271
|
+
def safe_prepend(mod, host)
|
1272
|
+
host.__send__(:prepend, mod) unless host < mod
|
1273
|
+
end
|
1274
|
+
end
|
1275
|
+
|
1276
|
+
# @private
|
1277
|
+
def requires=(paths)
|
1278
|
+
directories = ['lib', default_path].select { |p| File.directory? p }
|
1279
|
+
RSpec::Core::RubyProject.add_to_load_path(*directories)
|
1280
|
+
paths.each { |path| require path }
|
1281
|
+
@requires += paths
|
1282
|
+
end
|
1283
|
+
|
1284
|
+
# @private
|
1285
|
+
if RUBY_VERSION.to_f >= 1.9
|
1286
|
+
# @private
|
1287
|
+
def safe_include(mod, host)
|
1288
|
+
host.__send__(:include, mod) unless host < mod
|
1289
|
+
end
|
1290
|
+
|
1291
|
+
# @private
|
1292
|
+
def safe_extend(mod, host)
|
1293
|
+
host.extend(mod) unless host.singleton_class < mod
|
1294
|
+
end
|
1295
|
+
else # for 1.8.7
|
1296
|
+
# :nocov:
|
1297
|
+
# @private
|
1298
|
+
def safe_include(mod, host)
|
1299
|
+
host.__send__(:include, mod) unless host.included_modules.include?(mod)
|
1300
|
+
end
|
1301
|
+
|
1302
|
+
# @private
|
1303
|
+
def safe_extend(mod, host)
|
1304
|
+
host.extend(mod) unless (class << host; self; end).included_modules.include?(mod)
|
1305
|
+
end
|
1306
|
+
# :nocov:
|
1307
|
+
end
|
1308
|
+
|
1309
|
+
# @private
|
1310
|
+
def configure_mock_framework
|
1311
|
+
RSpec::Core::ExampleGroup.__send__(:include, mock_framework)
|
1312
|
+
conditionally_disable_mocks_monkey_patching
|
1313
|
+
end
|
1314
|
+
|
1315
|
+
# @private
|
1316
|
+
def configure_expectation_framework
|
1317
|
+
expectation_frameworks.each do |framework|
|
1318
|
+
RSpec::Core::ExampleGroup.__send__(:include, framework)
|
1319
|
+
end
|
1320
|
+
conditionally_disable_expectations_monkey_patching
|
1321
|
+
end
|
1322
|
+
|
1323
|
+
# @private
|
1324
|
+
def load_spec_files
|
1325
|
+
files_to_run.uniq.each do |f|
|
1326
|
+
file = File.expand_path(f)
|
1327
|
+
load file
|
1328
|
+
loaded_spec_files << file
|
1329
|
+
end
|
1330
|
+
|
1331
|
+
@spec_files_loaded = true
|
1332
|
+
end
|
1333
|
+
|
1334
|
+
# @private
|
1335
|
+
DEFAULT_FORMATTER = lambda { |string| string }
|
1336
|
+
|
1337
|
+
# Formats the docstring output using the block provided.
|
1338
|
+
#
|
1339
|
+
# @example
|
1340
|
+
# # This will strip the descriptions of both examples and example
|
1341
|
+
# # groups.
|
1342
|
+
# RSpec.configure do |config|
|
1343
|
+
# config.format_docstrings { |s| s.strip }
|
1344
|
+
# end
|
1345
|
+
def format_docstrings(&block)
|
1346
|
+
@format_docstrings_block = block_given? ? block : DEFAULT_FORMATTER
|
1347
|
+
end
|
1348
|
+
|
1349
|
+
# @private
|
1350
|
+
def format_docstrings_block
|
1351
|
+
@format_docstrings_block ||= DEFAULT_FORMATTER
|
1352
|
+
end
|
1353
|
+
|
1354
|
+
# @private
|
1355
|
+
# @macro [attach] delegate_to_ordering_manager
|
1356
|
+
# @!method $1
|
1357
|
+
def self.delegate_to_ordering_manager(*methods)
|
1358
|
+
methods.each do |method|
|
1359
|
+
define_method method do |*args, &block|
|
1360
|
+
ordering_manager.__send__(method, *args, &block)
|
1361
|
+
end
|
1362
|
+
end
|
1363
|
+
end
|
1364
|
+
|
1365
|
+
# @macro delegate_to_ordering_manager
|
1366
|
+
#
|
1367
|
+
# Sets the seed value and sets the default global ordering to random.
|
1368
|
+
delegate_to_ordering_manager :seed=
|
1369
|
+
|
1370
|
+
# @macro delegate_to_ordering_manager
|
1371
|
+
# Seed for random ordering (default: generated randomly each run).
|
1372
|
+
#
|
1373
|
+
# When you run specs with `--order random`, RSpec generates a random seed
|
1374
|
+
# for the randomization and prints it to the `output_stream` (assuming
|
1375
|
+
# you're using RSpec's built-in formatters). If you discover an ordering
|
1376
|
+
# dependency (i.e. examples fail intermittently depending on order), set
|
1377
|
+
# this (on Configuration or on the command line with `--seed`) to run
|
1378
|
+
# using the same seed while you debug the issue.
|
1379
|
+
#
|
1380
|
+
# We recommend, actually, that you use the command line approach so you
|
1381
|
+
# don't accidentally leave the seed encoded.
|
1382
|
+
delegate_to_ordering_manager :seed
|
1383
|
+
|
1384
|
+
# @macro delegate_to_ordering_manager
|
1385
|
+
#
|
1386
|
+
# Sets the default global order and, if order is `'rand:<seed>'`, also
|
1387
|
+
# sets the seed.
|
1388
|
+
delegate_to_ordering_manager :order=
|
1389
|
+
|
1390
|
+
# @macro delegate_to_ordering_manager
|
1391
|
+
# Registers a named ordering strategy that can later be
|
1392
|
+
# used to order an example group's subgroups by adding
|
1393
|
+
# `:order => <name>` metadata to the example group.
|
1394
|
+
#
|
1395
|
+
# @param name [Symbol] The name of the ordering.
|
1396
|
+
# @yield Block that will order the given examples or example groups
|
1397
|
+
# @yieldparam list [Array<RSpec::Core::Example>,
|
1398
|
+
# Array<RSpec::Core::ExampleGroup>] The examples or groups to order
|
1399
|
+
# @yieldreturn [Array<RSpec::Core::Example>,
|
1400
|
+
# Array<RSpec::Core::ExampleGroup>] The re-ordered examples or groups
|
1401
|
+
#
|
1402
|
+
# @example
|
1403
|
+
# RSpec.configure do |rspec|
|
1404
|
+
# rspec.register_ordering :reverse do |list|
|
1405
|
+
# list.reverse
|
1406
|
+
# end
|
1407
|
+
# end
|
1408
|
+
#
|
1409
|
+
# describe MyClass, :order => :reverse do
|
1410
|
+
# # ...
|
1411
|
+
# end
|
1412
|
+
#
|
1413
|
+
# @note Pass the symbol `:global` to set the ordering strategy that
|
1414
|
+
# will be used to order the top-level example groups and any example
|
1415
|
+
# groups that do not have declared `:order` metadata.
|
1416
|
+
delegate_to_ordering_manager :register_ordering
|
1417
|
+
|
1418
|
+
# @private
|
1419
|
+
delegate_to_ordering_manager :seed_used?, :ordering_registry
|
1420
|
+
|
1421
|
+
# Set Ruby warnings on or off.
|
1422
|
+
def warnings=(value)
|
1423
|
+
$VERBOSE = !!value
|
1424
|
+
end
|
1425
|
+
|
1426
|
+
# @return [Boolean] Whether or not ruby warnings are enabled.
|
1427
|
+
def warnings?
|
1428
|
+
$VERBOSE
|
1429
|
+
end
|
1430
|
+
|
1431
|
+
# Exposes the current running example via the named
|
1432
|
+
# helper method. RSpec 2.x exposed this via `example`,
|
1433
|
+
# but in RSpec 3.0, the example is instead exposed via
|
1434
|
+
# an arg yielded to `it`, `before`, `let`, etc. However,
|
1435
|
+
# some extension gems (such as Capybara) depend on the
|
1436
|
+
# RSpec 2.x's `example` method, so this config option
|
1437
|
+
# can be used to maintain compatibility.
|
1438
|
+
#
|
1439
|
+
# @param method_name [Symbol] the name of the helper method
|
1440
|
+
#
|
1441
|
+
# @example
|
1442
|
+
#
|
1443
|
+
# RSpec.configure do |rspec|
|
1444
|
+
# rspec.expose_current_running_example_as :example
|
1445
|
+
# end
|
1446
|
+
#
|
1447
|
+
# describe MyClass do
|
1448
|
+
# before do
|
1449
|
+
# # `example` can be used here because of the above config.
|
1450
|
+
# do_something if example.metadata[:type] == "foo"
|
1451
|
+
# end
|
1452
|
+
# end
|
1453
|
+
def expose_current_running_example_as(method_name)
|
1454
|
+
ExposeCurrentExample.module_exec do
|
1455
|
+
extend RSpec::SharedContext
|
1456
|
+
let(method_name) { |ex| ex }
|
1457
|
+
end
|
1458
|
+
|
1459
|
+
include ExposeCurrentExample
|
1460
|
+
end
|
1461
|
+
|
1462
|
+
# @private
|
1463
|
+
module ExposeCurrentExample; end
|
1464
|
+
|
1465
|
+
# Turns deprecation warnings into errors, in order to surface
|
1466
|
+
# the full backtrace of the call site. This can be useful when
|
1467
|
+
# you need more context to address a deprecation than the
|
1468
|
+
# single-line call site normally provided.
|
1469
|
+
#
|
1470
|
+
# @example
|
1471
|
+
#
|
1472
|
+
# RSpec.configure do |rspec|
|
1473
|
+
# rspec.raise_errors_for_deprecations!
|
1474
|
+
# end
|
1475
|
+
def raise_errors_for_deprecations!
|
1476
|
+
self.deprecation_stream = Formatters::DeprecationFormatter::RaiseErrorStream.new
|
1477
|
+
end
|
1478
|
+
|
1479
|
+
# Enables zero monkey patching mode for RSpec. It removes monkey
|
1480
|
+
# patching of the top-level DSL methods (`describe`,
|
1481
|
+
# `shared_examples_for`, etc) onto `main` and `Module`, instead
|
1482
|
+
# requiring you to prefix these methods with `RSpec.`. It enables
|
1483
|
+
# expect-only syntax for rspec-mocks and rspec-expectations. It
|
1484
|
+
# simply disables monkey patching on whatever pieces of RSpec
|
1485
|
+
# the user is using.
|
1486
|
+
#
|
1487
|
+
# @note It configures rspec-mocks and rspec-expectations only
|
1488
|
+
# if the user is using those (either explicitly or implicitly
|
1489
|
+
# by not setting `mock_with` or `expect_with` to anything else).
|
1490
|
+
#
|
1491
|
+
# @note If the user uses this options with `mock_with :mocha`
|
1492
|
+
# (or similiar) they will still have monkey patching active
|
1493
|
+
# in their test environment from mocha.
|
1494
|
+
#
|
1495
|
+
# @example
|
1496
|
+
#
|
1497
|
+
# # It disables all monkey patching.
|
1498
|
+
# RSpec.configure do |config|
|
1499
|
+
# config.disable_monkey_patching!
|
1500
|
+
# end
|
1501
|
+
#
|
1502
|
+
# # Is an equivalent to
|
1503
|
+
# RSpec.configure do |config|
|
1504
|
+
# config.expose_dsl_globally = false
|
1505
|
+
#
|
1506
|
+
# config.mock_with :rspec do |mocks|
|
1507
|
+
# mocks.syntax = :expect
|
1508
|
+
# mocks.patch_marshal_to_support_partial_doubles = false
|
1509
|
+
# end
|
1510
|
+
#
|
1511
|
+
# config.mock_with :rspec do |expectations|
|
1512
|
+
# expectations.syntax = :expect
|
1513
|
+
# end
|
1514
|
+
# end
|
1515
|
+
def disable_monkey_patching!
|
1516
|
+
self.expose_dsl_globally = false
|
1517
|
+
self.disable_monkey_patching = true
|
1518
|
+
conditionally_disable_mocks_monkey_patching
|
1519
|
+
conditionally_disable_expectations_monkey_patching
|
1520
|
+
end
|
1521
|
+
|
1522
|
+
# @private
|
1523
|
+
attr_accessor :disable_monkey_patching
|
1524
|
+
|
1525
|
+
# Defines a callback that can assign derived metadata values.
|
1526
|
+
#
|
1527
|
+
# @param filters [Array<Symbol>, Hash] metadata filters that determine
|
1528
|
+
# which example or group metadata hashes the callback will be triggered
|
1529
|
+
# for. If none are given, the callback will be run against the metadata
|
1530
|
+
# hashes of all groups and examples.
|
1531
|
+
# @yieldparam metadata [Hash] original metadata hash from an example or
|
1532
|
+
# group. Mutate this in your block as needed.
|
1533
|
+
#
|
1534
|
+
# @example
|
1535
|
+
# RSpec.configure do |config|
|
1536
|
+
# # Tag all groups and examples in the spec/unit directory with
|
1537
|
+
# # :type => :unit
|
1538
|
+
# config.define_derived_metadata(:file_path => %r{/spec/unit/}) do |metadata|
|
1539
|
+
# metadata[:type] = :unit
|
1540
|
+
# end
|
1541
|
+
# end
|
1542
|
+
def define_derived_metadata(*filters, &block)
|
1543
|
+
meta = Metadata.build_hash_from(filters, :warn_about_example_group_filtering)
|
1544
|
+
@derived_metadata_blocks.append(block, meta)
|
1545
|
+
end
|
1546
|
+
|
1547
|
+
# @private
|
1548
|
+
def apply_derived_metadata_to(metadata)
|
1549
|
+
@derived_metadata_blocks.items_for(metadata).each do |block|
|
1550
|
+
block.call(metadata)
|
1551
|
+
end
|
1552
|
+
end
|
1553
|
+
|
1554
|
+
# Defines a `before` hook. See {Hooks#before} for full docs.
|
1555
|
+
#
|
1556
|
+
# This method differs from {Hooks#before} in only one way: it supports
|
1557
|
+
# the `:suite` scope. Hooks with the `:suite` scope will be run once before
|
1558
|
+
# the first example of the entire suite is executed.
|
1559
|
+
#
|
1560
|
+
# @see #prepend_before
|
1561
|
+
# @see #after
|
1562
|
+
# @see #append_after
|
1563
|
+
def before(*args, &block)
|
1564
|
+
handle_suite_hook(args, @before_suite_hooks, :push,
|
1565
|
+
Hooks::BeforeHook, block) || super(*args, &block)
|
1566
|
+
end
|
1567
|
+
alias_method :append_before, :before
|
1568
|
+
|
1569
|
+
# Adds `block` to the start of the list of `before` blocks in the same
|
1570
|
+
# scope (`:example`, `:context`, or `:suite`), in contrast to {#before},
|
1571
|
+
# which adds the hook to the end of the list.
|
1572
|
+
#
|
1573
|
+
# See {Hooks#before} for full `before` hook docs.
|
1574
|
+
#
|
1575
|
+
# This method differs from {Hooks#prepend_before} in only one way: it supports
|
1576
|
+
# the `:suite` scope. Hooks with the `:suite` scope will be run once before
|
1577
|
+
# the first example of the entire suite is executed.
|
1578
|
+
#
|
1579
|
+
# @see #before
|
1580
|
+
# @see #after
|
1581
|
+
# @see #append_after
|
1582
|
+
def prepend_before(*args, &block)
|
1583
|
+
handle_suite_hook(args, @before_suite_hooks, :unshift,
|
1584
|
+
Hooks::BeforeHook, block) || super(*args, &block)
|
1585
|
+
end
|
1586
|
+
|
1587
|
+
# Defines a `after` hook. See {Hooks#after} for full docs.
|
1588
|
+
#
|
1589
|
+
# This method differs from {Hooks#after} in only one way: it supports
|
1590
|
+
# the `:suite` scope. Hooks with the `:suite` scope will be run once after
|
1591
|
+
# the last example of the entire suite is executed.
|
1592
|
+
#
|
1593
|
+
# @see #append_after
|
1594
|
+
# @see #before
|
1595
|
+
# @see #prepend_before
|
1596
|
+
def after(*args, &block)
|
1597
|
+
handle_suite_hook(args, @after_suite_hooks, :unshift,
|
1598
|
+
Hooks::AfterHook, block) || super(*args, &block)
|
1599
|
+
end
|
1600
|
+
alias_method :prepend_after, :after
|
1601
|
+
|
1602
|
+
# Adds `block` to the end of the list of `after` blocks in the same
|
1603
|
+
# scope (`:example`, `:context`, or `:suite`), in contrast to {#after},
|
1604
|
+
# which adds the hook to the start of the list.
|
1605
|
+
#
|
1606
|
+
# See {Hooks#after} for full `after` hook docs.
|
1607
|
+
#
|
1608
|
+
# This method differs from {Hooks#append_after} in only one way: it supports
|
1609
|
+
# the `:suite` scope. Hooks with the `:suite` scope will be run once after
|
1610
|
+
# the last example of the entire suite is executed.
|
1611
|
+
#
|
1612
|
+
# @see #append_after
|
1613
|
+
# @see #before
|
1614
|
+
# @see #prepend_before
|
1615
|
+
def append_after(*args, &block)
|
1616
|
+
handle_suite_hook(args, @after_suite_hooks, :push,
|
1617
|
+
Hooks::AfterHook, block) || super(*args, &block)
|
1618
|
+
end
|
1619
|
+
|
1620
|
+
# @private
|
1621
|
+
def with_suite_hooks
|
1622
|
+
return yield if dry_run?
|
1623
|
+
|
1624
|
+
hook_context = SuiteHookContext.new
|
1625
|
+
begin
|
1626
|
+
run_hooks_with(@before_suite_hooks, hook_context)
|
1627
|
+
yield
|
1628
|
+
ensure
|
1629
|
+
run_hooks_with(@after_suite_hooks, hook_context)
|
1630
|
+
end
|
1631
|
+
end
|
1632
|
+
|
1633
|
+
# @private
|
1634
|
+
# Holds the various registered hooks. Here we use a FilterableItemRepository
|
1635
|
+
# implementation that is specifically optimized for the read/write patterns
|
1636
|
+
# of the config object.
|
1637
|
+
def hooks
|
1638
|
+
@hooks ||= HookCollections.new(self, FilterableItemRepository::QueryOptimized)
|
1639
|
+
end
|
1640
|
+
|
1641
|
+
private
|
1642
|
+
|
1643
|
+
def handle_suite_hook(args, collection, append_or_prepend, hook_type, block)
|
1644
|
+
scope, meta = *args
|
1645
|
+
return nil unless scope == :suite
|
1646
|
+
|
1647
|
+
if meta
|
1648
|
+
# TODO: in RSpec 4, consider raising an error here.
|
1649
|
+
# We warn only for backwards compatibility.
|
1650
|
+
RSpec.warn_with "WARNING: `:suite` hooks do not support metadata since " \
|
1651
|
+
"they apply to the suite as a whole rather than " \
|
1652
|
+
"any individual example or example group that has metadata. " \
|
1653
|
+
"The metadata you have provided (#{meta.inspect}) will be ignored."
|
1654
|
+
end
|
1655
|
+
|
1656
|
+
collection.__send__(append_or_prepend, hook_type.new(block, {}))
|
1657
|
+
end
|
1658
|
+
|
1659
|
+
def run_hooks_with(hooks, hook_context)
|
1660
|
+
hooks.each { |h| h.run(hook_context) }
|
1661
|
+
end
|
1662
|
+
|
1663
|
+
def get_files_to_run(paths)
|
1664
|
+
files = FlatMap.flat_map(paths_to_check(paths)) do |path|
|
1665
|
+
path = path.gsub(File::ALT_SEPARATOR, File::SEPARATOR) if File::ALT_SEPARATOR
|
1666
|
+
File.directory?(path) ? gather_directories(path) : extract_location(path)
|
1667
|
+
end.sort.uniq
|
1668
|
+
|
1669
|
+
return files unless only_failures?
|
1670
|
+
relative_files = files.map { |f| Metadata.relative_path(File.expand_path f) }
|
1671
|
+
intersection = (relative_files & spec_files_with_failures.to_a)
|
1672
|
+
intersection.empty? ? files : intersection
|
1673
|
+
end
|
1674
|
+
|
1675
|
+
def paths_to_check(paths)
|
1676
|
+
return paths if pattern_might_load_specs_from_vendored_dirs?
|
1677
|
+
paths + [Dir.getwd]
|
1678
|
+
end
|
1679
|
+
|
1680
|
+
def pattern_might_load_specs_from_vendored_dirs?
|
1681
|
+
pattern.split(File::SEPARATOR).first.include?('**')
|
1682
|
+
end
|
1683
|
+
|
1684
|
+
def gather_directories(path)
|
1685
|
+
include_files = get_matching_files(path, pattern)
|
1686
|
+
exclude_files = get_matching_files(path, exclude_pattern)
|
1687
|
+
(include_files - exclude_files).sort.uniq
|
1688
|
+
end
|
1689
|
+
|
1690
|
+
def get_matching_files(path, pattern)
|
1691
|
+
Dir[file_glob_from(path, pattern)].map { |file| File.expand_path(file) }
|
1692
|
+
end
|
1693
|
+
|
1694
|
+
def file_glob_from(path, pattern)
|
1695
|
+
stripped = "{#{pattern.gsub(/\s*,\s*/, ',')}}"
|
1696
|
+
return stripped if pattern =~ /^(\.\/)?#{Regexp.escape path}/ || absolute_pattern?(pattern)
|
1697
|
+
File.join(path, stripped)
|
1698
|
+
end
|
1699
|
+
|
1700
|
+
if RSpec::Support::OS.windows?
|
1701
|
+
# :nocov:
|
1702
|
+
def absolute_pattern?(pattern)
|
1703
|
+
pattern =~ /\A[A-Z]:\\/ || windows_absolute_network_path?(pattern)
|
1704
|
+
end
|
1705
|
+
|
1706
|
+
def windows_absolute_network_path?(pattern)
|
1707
|
+
return false unless ::File::ALT_SEPARATOR
|
1708
|
+
pattern.start_with?(::File::ALT_SEPARATOR + ::File::ALT_SEPARATOR)
|
1709
|
+
end
|
1710
|
+
# :nocov:
|
1711
|
+
else
|
1712
|
+
def absolute_pattern?(pattern)
|
1713
|
+
pattern.start_with?(File::Separator)
|
1714
|
+
end
|
1715
|
+
end
|
1716
|
+
|
1717
|
+
# @private
|
1718
|
+
ON_SQUARE_BRACKETS = /[\[\]]/
|
1719
|
+
|
1720
|
+
def extract_location(path)
|
1721
|
+
match = /^(.*?)((?:\:\d+)+)$/.match(path)
|
1722
|
+
|
1723
|
+
if match
|
1724
|
+
captures = match.captures
|
1725
|
+
path, lines = captures[0], captures[1][1..-1].split(":").map { |n| n.to_i }
|
1726
|
+
filter_manager.add_location path, lines
|
1727
|
+
else
|
1728
|
+
path, scoped_ids = path.split(ON_SQUARE_BRACKETS)
|
1729
|
+
filter_manager.add_ids(path, scoped_ids.split(/\s*,\s*/)) if scoped_ids
|
1730
|
+
end
|
1731
|
+
|
1732
|
+
return [] if path == default_path
|
1733
|
+
path
|
1734
|
+
end
|
1735
|
+
|
1736
|
+
def command
|
1737
|
+
$0.split(File::SEPARATOR).last
|
1738
|
+
end
|
1739
|
+
|
1740
|
+
def value_for(key)
|
1741
|
+
@preferred_options.fetch(key) { yield }
|
1742
|
+
end
|
1743
|
+
|
1744
|
+
def define_built_in_hooks
|
1745
|
+
around(:example, :aggregate_failures => true) do |procsy|
|
1746
|
+
begin
|
1747
|
+
aggregate_failures(nil, :hide_backtrace => true, &procsy)
|
1748
|
+
rescue Exception => exception
|
1749
|
+
procsy.example.set_aggregate_failures_exception(exception)
|
1750
|
+
end
|
1751
|
+
end
|
1752
|
+
end
|
1753
|
+
|
1754
|
+
def assert_no_example_groups_defined(config_option)
|
1755
|
+
return unless RSpec.world.example_groups.any?
|
1756
|
+
|
1757
|
+
raise MustBeConfiguredBeforeExampleGroupsError.new(
|
1758
|
+
"RSpec's #{config_option} configuration option must be configured before " \
|
1759
|
+
"any example groups are defined, but you have already defined a group."
|
1760
|
+
)
|
1761
|
+
end
|
1762
|
+
|
1763
|
+
def output_to_tty?(output=output_stream)
|
1764
|
+
tty? || (output.respond_to?(:tty?) && output.tty?)
|
1765
|
+
end
|
1766
|
+
|
1767
|
+
def conditionally_disable_mocks_monkey_patching
|
1768
|
+
return unless disable_monkey_patching && rspec_mocks_loaded?
|
1769
|
+
|
1770
|
+
RSpec::Mocks.configuration.tap do |config|
|
1771
|
+
config.syntax = :expect
|
1772
|
+
config.patch_marshal_to_support_partial_doubles = false
|
1773
|
+
end
|
1774
|
+
end
|
1775
|
+
|
1776
|
+
def conditionally_disable_expectations_monkey_patching
|
1777
|
+
return unless disable_monkey_patching && rspec_expectations_loaded?
|
1778
|
+
|
1779
|
+
RSpec::Expectations.configuration.syntax = :expect
|
1780
|
+
end
|
1781
|
+
|
1782
|
+
def rspec_mocks_loaded?
|
1783
|
+
defined?(RSpec::Mocks.configuration)
|
1784
|
+
end
|
1785
|
+
|
1786
|
+
def rspec_expectations_loaded?
|
1787
|
+
defined?(RSpec::Expectations.configuration)
|
1788
|
+
end
|
1789
|
+
|
1790
|
+
def update_pattern_attr(name, value)
|
1791
|
+
if @spec_files_loaded
|
1792
|
+
RSpec.warning "Configuring `#{name}` to #{value} has no effect since " \
|
1793
|
+
"RSpec has already loaded the spec files."
|
1794
|
+
end
|
1795
|
+
|
1796
|
+
instance_variable_set(:"@#{name}", value)
|
1797
|
+
@files_to_run = nil
|
1798
|
+
end
|
1799
|
+
|
1800
|
+
def clear_values_derived_from_example_status_persistence_file_path
|
1801
|
+
@last_run_statuses = nil
|
1802
|
+
@spec_files_with_failures = nil
|
1803
|
+
end
|
1804
|
+
end
|
1805
|
+
# rubocop:enable Style/ClassLength
|
1806
|
+
end
|
1807
|
+
end
|