bibtex_to_scrapbox 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +19 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/LICENSE +22 -0
- data/README.md +43 -0
- data/Rakefile +6 -0
- data/bibtex_to_scrapbox.gemspec +29 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/bibtex_to_scrapbox +7 -0
- data/gems/bin/htmldiff +29 -0
- data/gems/bin/ldiff +29 -0
- data/gems/bin/rake +27 -0
- data/gems/bin/rspec +27 -0
- data/gems/bin/thor +27 -0
- data/gems/extensions/x86_64-darwin-16/2.4.0-static/unicode-0.4.4.4/gem.build_complete +0 -0
- data/gems/extensions/x86_64-darwin-16/2.4.0-static/unicode-0.4.4.4/gem_make.out +288 -0
- data/gems/extensions/x86_64-darwin-16/2.4.0-static/unicode-0.4.4.4/unicode/unicode_native.bundle +0 -0
- data/gems/gems/bibtex-ruby-4.4.4/Gemfile +66 -0
- data/gems/gems/bibtex-ruby-4.4.4/Guardfile +22 -0
- data/gems/gems/bibtex-ruby-4.4.4/History.txt +306 -0
- data/gems/gems/bibtex-ruby-4.4.4/LICENSE +621 -0
- data/gems/gems/bibtex-ruby-4.4.4/Manifest +100 -0
- data/gems/gems/bibtex-ruby-4.4.4/README.md +615 -0
- data/gems/gems/bibtex-ruby-4.4.4/Rakefile +123 -0
- data/gems/gems/bibtex-ruby-4.4.4/bibtex-ruby.gemspec +38 -0
- data/gems/gems/bibtex-ruby-4.4.4/examples/bib2html.rb +42 -0
- data/gems/gems/bibtex-ruby-4.4.4/examples/bib2yaml.rb +12 -0
- data/gems/gems/bibtex-ruby-4.4.4/examples/markdown.bib +39 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/bibtex.feature +96 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/entries.feature +67 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/issues/braced_strings.feature +48 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/issues/crossref.feature +62 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/issues/latex_filter.feature +171 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/issues/multiline_strings.feature +14 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/issues/name_parsing.feature +19 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/issues/non_ascii_default_keys.feature +20 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/issues/non_ascii_keys.feature +17 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/issues/number_keys.feature +45 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/issues/parse_months.feature +43 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/issues/slash_keys.feature +21 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/issues/trailing_comma.feature +21 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/issues/whitespace_keys.feature +23 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/names.feature +86 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/preambles.feature +27 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/query.feature +102 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/replacement.feature +68 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/step_definitions/bibtex_steps.rb +119 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/step_definitions/name_steps.rb +18 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/strings.feature +53 -0
- data/gems/gems/bibtex-ruby-4.4.4/features/support/env.rb +21 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex.rb +83 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/bibliography.rb +594 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/bibliography/rdf_converter.rb +27 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/bibtex.y +141 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/compatibility.rb +25 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/elements.rb +376 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/entry.rb +690 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/entry/bibtexml_converter.rb +44 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/entry/citeproc_converter.rb +164 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/entry/rdf_converter.rb +588 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/error.rb +49 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/extensions.rb +25 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/filters.rb +55 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/filters/latex.rb +13 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/filters/linebreaks.rb +11 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/lexer.rb +358 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/name_parser.rb +563 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/names.rb +315 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/names.y +267 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/parser.rb +474 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/replaceable.rb +52 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/ruby.rb +1 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/utilities.rb +59 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/value.rb +305 -0
- data/gems/gems/bibtex-ruby-4.4.4/lib/bibtex/version.rb +28 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/benchmark.rb +84 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/bibtex/entry/test_rdf_converter.rb +341 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/bibtex/test_bibliography.rb +446 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/bibtex/test_elements.rb +64 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/bibtex/test_entry.rb +698 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/bibtex/test_filters.rb +36 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/bibtex/test_lexer.rb +42 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/bibtex/test_name_parser.rb +29 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/bibtex/test_names.rb +168 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/bibtex/test_parser.rb +210 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/bibtex/test_string.rb +83 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/bibtex/test_utilities.rb +34 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/bibtex/test_value.rb +189 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/fixtures/bibdesk.bib +50 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/fixtures/comment.bib +15 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/fixtures/decoret.bib +83 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/fixtures/empty.bib +0 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/fixtures/entry.bib +24 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/fixtures/errors.bib +67 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/fixtures/no_bibtex.bib +9 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/fixtures/preamble.bib +12 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/fixtures/roundtrip.bib +11 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/helper.rb +43 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/macruby.d +21 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/macruby.rb +22 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/profile.rb +28 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/test_bibtex.rb +127 -0
- data/gems/gems/bibtex-ruby-4.4.4/test/test_export.rb +33 -0
- data/gems/gems/diff-lcs-1.3/.rspec +1 -0
- data/gems/gems/diff-lcs-1.3/Code-of-Conduct.md +74 -0
- data/gems/gems/diff-lcs-1.3/Contributing.md +83 -0
- data/gems/gems/diff-lcs-1.3/History.md +220 -0
- data/gems/gems/diff-lcs-1.3/License.md +39 -0
- data/gems/gems/diff-lcs-1.3/Manifest.txt +37 -0
- data/gems/gems/diff-lcs-1.3/README.rdoc +84 -0
- data/gems/gems/diff-lcs-1.3/Rakefile +57 -0
- data/gems/gems/diff-lcs-1.3/autotest/discover.rb +1 -0
- data/gems/gems/diff-lcs-1.3/bin/htmldiff +32 -0
- data/gems/gems/diff-lcs-1.3/bin/ldiff +6 -0
- data/gems/gems/diff-lcs-1.3/docs/COPYING.txt +339 -0
- data/gems/gems/diff-lcs-1.3/docs/artistic.txt +127 -0
- data/gems/gems/diff-lcs-1.3/lib/diff-lcs.rb +3 -0
- data/gems/gems/diff-lcs-1.3/lib/diff/lcs.rb +725 -0
- data/gems/gems/diff-lcs-1.3/lib/diff/lcs/array.rb +7 -0
- data/gems/gems/diff-lcs-1.3/lib/diff/lcs/block.rb +37 -0
- data/gems/gems/diff-lcs-1.3/lib/diff/lcs/callbacks.rb +322 -0
- data/gems/gems/diff-lcs-1.3/lib/diff/lcs/change.rb +181 -0
- data/gems/gems/diff-lcs-1.3/lib/diff/lcs/htmldiff.rb +149 -0
- data/gems/gems/diff-lcs-1.3/lib/diff/lcs/hunk.rb +276 -0
- data/gems/gems/diff-lcs-1.3/lib/diff/lcs/internals.rb +307 -0
- data/gems/gems/diff-lcs-1.3/lib/diff/lcs/ldiff.rb +167 -0
- data/gems/gems/diff-lcs-1.3/lib/diff/lcs/string.rb +5 -0
- data/gems/gems/diff-lcs-1.3/spec/change_spec.rb +65 -0
- data/gems/gems/diff-lcs-1.3/spec/diff_spec.rb +47 -0
- data/gems/gems/diff-lcs-1.3/spec/fixtures/ds1.csv +50 -0
- data/gems/gems/diff-lcs-1.3/spec/fixtures/ds2.csv +51 -0
- data/gems/gems/diff-lcs-1.3/spec/hunk_spec.rb +72 -0
- data/gems/gems/diff-lcs-1.3/spec/issues_spec.rb +49 -0
- data/gems/gems/diff-lcs-1.3/spec/lcs_spec.rb +56 -0
- data/gems/gems/diff-lcs-1.3/spec/ldiff_spec.rb +47 -0
- data/gems/gems/diff-lcs-1.3/spec/patch_spec.rb +422 -0
- data/gems/gems/diff-lcs-1.3/spec/sdiff_spec.rb +214 -0
- data/gems/gems/diff-lcs-1.3/spec/spec_helper.rb +321 -0
- data/gems/gems/diff-lcs-1.3/spec/traverse_balanced_spec.rb +310 -0
- data/gems/gems/diff-lcs-1.3/spec/traverse_sequences_spec.rb +139 -0
- data/gems/gems/latex-decode-0.2.2/.gitignore +6 -0
- data/gems/gems/latex-decode-0.2.2/.travis.yml +18 -0
- data/gems/gems/latex-decode-0.2.2/Gemfile +21 -0
- data/gems/gems/latex-decode-0.2.2/LICENSE +621 -0
- data/gems/gems/latex-decode-0.2.2/README.md +65 -0
- data/gems/gems/latex-decode-0.2.2/Rakefile +41 -0
- data/gems/gems/latex-decode-0.2.2/cucumber.yml +1 -0
- data/gems/gems/latex-decode-0.2.2/features/brackets.feature +11 -0
- data/gems/gems/latex-decode-0.2.2/features/diacritics.feature +40 -0
- data/gems/gems/latex-decode-0.2.2/features/greek.feature +13 -0
- data/gems/gems/latex-decode-0.2.2/features/maths.feature +9 -0
- data/gems/gems/latex-decode-0.2.2/features/non-latex.feature +15 -0
- data/gems/gems/latex-decode-0.2.2/features/punctuation.feature +50 -0
- data/gems/gems/latex-decode-0.2.2/features/special_characters.feature +21 -0
- data/gems/gems/latex-decode-0.2.2/features/step_definitions/latex.rb +7 -0
- data/gems/gems/latex-decode-0.2.2/features/support/env.rb +14 -0
- data/gems/gems/latex-decode-0.2.2/features/symbols.feature +21 -0
- data/gems/gems/latex-decode-0.2.2/features/umlauts.feature +11 -0
- data/gems/gems/latex-decode-0.2.2/latex-decode.gemspec +33 -0
- data/gems/gems/latex-decode-0.2.2/lib/latex/decode.rb +54 -0
- data/gems/gems/latex-decode-0.2.2/lib/latex/decode/accents.rb +36 -0
- data/gems/gems/latex-decode-0.2.2/lib/latex/decode/base.rb +62 -0
- data/gems/gems/latex-decode-0.2.2/lib/latex/decode/compatibility.rb +89 -0
- data/gems/gems/latex-decode-0.2.2/lib/latex/decode/diacritics.rb +46 -0
- data/gems/gems/latex-decode-0.2.2/lib/latex/decode/greek.rb +61 -0
- data/gems/gems/latex-decode-0.2.2/lib/latex/decode/maths.rb +21 -0
- data/gems/gems/latex-decode-0.2.2/lib/latex/decode/punctuation.rb +59 -0
- data/gems/gems/latex-decode-0.2.2/lib/latex/decode/symbols.rb +225 -0
- data/gems/gems/latex-decode-0.2.2/lib/latex/decode/version.rb +5 -0
- data/gems/gems/rake-10.5.0/.autotest +7 -0
- data/gems/gems/rake-10.5.0/.rubocop.yml +27 -0
- data/gems/gems/rake-10.5.0/.togglerc +7 -0
- data/gems/gems/rake-10.5.0/CONTRIBUTING.rdoc +38 -0
- data/gems/gems/rake-10.5.0/History.rdoc +659 -0
- data/gems/gems/rake-10.5.0/MIT-LICENSE +21 -0
- data/gems/gems/rake-10.5.0/Manifest.txt +166 -0
- data/gems/gems/rake-10.5.0/README.rdoc +139 -0
- data/gems/gems/rake-10.5.0/Rakefile +81 -0
- data/gems/gems/rake-10.5.0/bin/rake +33 -0
- data/gems/gems/rake-10.5.0/doc/command_line_usage.rdoc +158 -0
- data/gems/gems/rake-10.5.0/doc/example/Rakefile1 +38 -0
- data/gems/gems/rake-10.5.0/doc/example/Rakefile2 +35 -0
- data/gems/gems/rake-10.5.0/doc/example/a.c +6 -0
- data/gems/gems/rake-10.5.0/doc/example/b.c +6 -0
- data/gems/gems/rake-10.5.0/doc/example/main.c +11 -0
- data/gems/gems/rake-10.5.0/doc/glossary.rdoc +42 -0
- data/gems/gems/rake-10.5.0/doc/jamis.rb +591 -0
- data/gems/gems/rake-10.5.0/doc/proto_rake.rdoc +127 -0
- data/gems/gems/rake-10.5.0/doc/rake.1 +141 -0
- data/gems/gems/rake-10.5.0/doc/rakefile.rdoc +624 -0
- data/gems/gems/rake-10.5.0/doc/rational.rdoc +151 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.4.14.rdoc +23 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.4.15.rdoc +35 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.5.0.rdoc +53 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.5.3.rdoc +78 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.5.4.rdoc +46 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.6.0.rdoc +141 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.7.0.rdoc +119 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.7.1.rdoc +59 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.7.2.rdoc +121 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.7.3.rdoc +47 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.8.0.rdoc +114 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.8.2.rdoc +165 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.8.3.rdoc +112 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.8.4.rdoc +147 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.8.5.rdoc +53 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.8.6.rdoc +37 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.8.7.rdoc +55 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.9.0.rdoc +112 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.9.1.rdoc +52 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.2.rdoc +55 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.9.2.rdoc +49 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.9.3.rdoc +102 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.9.4.rdoc +60 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.9.5.rdoc +55 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-0.9.6.rdoc +64 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-10.0.0.rdoc +178 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-10.0.1.rdoc +58 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-10.0.2.rdoc +53 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-10.0.3.rdoc +191 -0
- data/gems/gems/rake-10.5.0/doc/release_notes/rake-10.1.0.rdoc +61 -0
- data/gems/gems/rake-10.5.0/lib/rake.rb +79 -0
- data/gems/gems/rake-10.5.0/lib/rake/alt_system.rb +110 -0
- data/gems/gems/rake-10.5.0/lib/rake/application.rb +790 -0
- data/gems/gems/rake-10.5.0/lib/rake/backtrace.rb +23 -0
- data/gems/gems/rake-10.5.0/lib/rake/clean.rb +76 -0
- data/gems/gems/rake-10.5.0/lib/rake/cloneable.rb +16 -0
- data/gems/gems/rake-10.5.0/lib/rake/contrib/.document +1 -0
- data/gems/gems/rake-10.5.0/lib/rake/contrib/compositepublisher.rb +21 -0
- data/gems/gems/rake-10.5.0/lib/rake/contrib/ftptools.rb +137 -0
- data/gems/gems/rake-10.5.0/lib/rake/contrib/publisher.rb +81 -0
- data/gems/gems/rake-10.5.0/lib/rake/contrib/rubyforgepublisher.rb +18 -0
- data/gems/gems/rake-10.5.0/lib/rake/contrib/sshpublisher.rb +61 -0
- data/gems/gems/rake-10.5.0/lib/rake/contrib/sys.rb +4 -0
- data/gems/gems/rake-10.5.0/lib/rake/cpu_counter.rb +125 -0
- data/gems/gems/rake-10.5.0/lib/rake/default_loader.rb +14 -0
- data/gems/gems/rake-10.5.0/lib/rake/dsl_definition.rb +201 -0
- data/gems/gems/rake-10.5.0/lib/rake/early_time.rb +21 -0
- data/gems/gems/rake-10.5.0/lib/rake/ext/core.rb +25 -0
- data/gems/gems/rake-10.5.0/lib/rake/ext/module.rb +2 -0
- data/gems/gems/rake-10.5.0/lib/rake/ext/pathname.rb +25 -0
- data/gems/gems/rake-10.5.0/lib/rake/ext/string.rb +175 -0
- data/gems/gems/rake-10.5.0/lib/rake/ext/time.rb +18 -0
- data/gems/gems/rake-10.5.0/lib/rake/file_creation_task.rb +24 -0
- data/gems/gems/rake-10.5.0/lib/rake/file_list.rb +428 -0
- data/gems/gems/rake-10.5.0/lib/rake/file_task.rb +46 -0
- data/gems/gems/rake-10.5.0/lib/rake/file_utils.rb +128 -0
- data/gems/gems/rake-10.5.0/lib/rake/file_utils_ext.rb +144 -0
- data/gems/gems/rake-10.5.0/lib/rake/gempackagetask.rb +4 -0
- data/gems/gems/rake-10.5.0/lib/rake/invocation_chain.rb +56 -0
- data/gems/gems/rake-10.5.0/lib/rake/invocation_exception_mixin.rb +16 -0
- data/gems/gems/rake-10.5.0/lib/rake/late_time.rb +17 -0
- data/gems/gems/rake-10.5.0/lib/rake/linked_list.rb +103 -0
- data/gems/gems/rake-10.5.0/lib/rake/loaders/makefile.rb +53 -0
- data/gems/gems/rake-10.5.0/lib/rake/multi_task.rb +13 -0
- data/gems/gems/rake-10.5.0/lib/rake/name_space.rb +38 -0
- data/gems/gems/rake-10.5.0/lib/rake/packagetask.rb +199 -0
- data/gems/gems/rake-10.5.0/lib/rake/pathmap.rb +3 -0
- data/gems/gems/rake-10.5.0/lib/rake/phony.rb +15 -0
- data/gems/gems/rake-10.5.0/lib/rake/private_reader.rb +20 -0
- data/gems/gems/rake-10.5.0/lib/rake/promise.rb +99 -0
- data/gems/gems/rake-10.5.0/lib/rake/pseudo_status.rb +29 -0
- data/gems/gems/rake-10.5.0/lib/rake/rake_module.rb +38 -0
- data/gems/gems/rake-10.5.0/lib/rake/rake_test_loader.rb +22 -0
- data/gems/gems/rake-10.5.0/lib/rake/rdoctask.rb +4 -0
- data/gems/gems/rake-10.5.0/lib/rake/ruby182_test_unit_fix.rb +29 -0
- data/gems/gems/rake-10.5.0/lib/rake/rule_recursion_overflow_error.rb +20 -0
- data/gems/gems/rake-10.5.0/lib/rake/runtest.rb +27 -0
- data/gems/gems/rake-10.5.0/lib/rake/scope.rb +42 -0
- data/gems/gems/rake-10.5.0/lib/rake/task.rb +383 -0
- data/gems/gems/rake-10.5.0/lib/rake/task_argument_error.rb +7 -0
- data/gems/gems/rake-10.5.0/lib/rake/task_arguments.rb +98 -0
- data/gems/gems/rake-10.5.0/lib/rake/task_manager.rb +307 -0
- data/gems/gems/rake-10.5.0/lib/rake/tasklib.rb +24 -0
- data/gems/gems/rake-10.5.0/lib/rake/testtask.rb +213 -0
- data/gems/gems/rake-10.5.0/lib/rake/thread_history_display.rb +48 -0
- data/gems/gems/rake-10.5.0/lib/rake/thread_pool.rb +164 -0
- data/gems/gems/rake-10.5.0/lib/rake/trace_output.rb +22 -0
- data/gems/gems/rake-10.5.0/lib/rake/version.rb +7 -0
- data/gems/gems/rake-10.5.0/lib/rake/win32.rb +56 -0
- data/gems/gems/rake-10.5.0/rakelib/publish.rake +20 -0
- data/gems/gems/rake-10.5.0/rakelib/test_times.rake +25 -0
- data/gems/gems/rake-10.5.0/test/file_creation.rb +34 -0
- data/gems/gems/rake-10.5.0/test/helper.rb +129 -0
- data/gems/gems/rake-10.5.0/test/support/rakefile_definitions.rb +478 -0
- data/gems/gems/rake-10.5.0/test/support/ruby_runner.rb +34 -0
- data/gems/gems/rake-10.5.0/test/test_private_reader.rb +42 -0
- data/gems/gems/rake-10.5.0/test/test_rake.rb +40 -0
- data/gems/gems/rake-10.5.0/test/test_rake_application.rb +643 -0
- data/gems/gems/rake-10.5.0/test/test_rake_application_options.rb +468 -0
- data/gems/gems/rake-10.5.0/test/test_rake_backtrace.rb +119 -0
- data/gems/gems/rake-10.5.0/test/test_rake_clean.rb +61 -0
- data/gems/gems/rake-10.5.0/test/test_rake_cpu_counter.rb +68 -0
- data/gems/gems/rake-10.5.0/test/test_rake_definitions.rb +84 -0
- data/gems/gems/rake-10.5.0/test/test_rake_directory_task.rb +76 -0
- data/gems/gems/rake-10.5.0/test/test_rake_dsl.rb +40 -0
- data/gems/gems/rake-10.5.0/test/test_rake_early_time.rb +31 -0
- data/gems/gems/rake-10.5.0/test/test_rake_extension.rb +59 -0
- data/gems/gems/rake-10.5.0/test/test_rake_file_creation_task.rb +56 -0
- data/gems/gems/rake-10.5.0/test/test_rake_file_list.rb +670 -0
- data/gems/gems/rake-10.5.0/test/test_rake_file_list_path_map.rb +8 -0
- data/gems/gems/rake-10.5.0/test/test_rake_file_task.rb +197 -0
- data/gems/gems/rake-10.5.0/test/test_rake_file_utils.rb +314 -0
- data/gems/gems/rake-10.5.0/test/test_rake_ftp_file.rb +74 -0
- data/gems/gems/rake-10.5.0/test/test_rake_functional.rb +482 -0
- data/gems/gems/rake-10.5.0/test/test_rake_invocation_chain.rb +64 -0
- data/gems/gems/rake-10.5.0/test/test_rake_late_time.rb +18 -0
- data/gems/gems/rake-10.5.0/test/test_rake_linked_list.rb +84 -0
- data/gems/gems/rake-10.5.0/test/test_rake_makefile_loader.rb +46 -0
- data/gems/gems/rake-10.5.0/test/test_rake_multi_task.rb +64 -0
- data/gems/gems/rake-10.5.0/test/test_rake_name_space.rb +57 -0
- data/gems/gems/rake-10.5.0/test/test_rake_package_task.rb +79 -0
- data/gems/gems/rake-10.5.0/test/test_rake_path_map.rb +168 -0
- data/gems/gems/rake-10.5.0/test/test_rake_path_map_explode.rb +34 -0
- data/gems/gems/rake-10.5.0/test/test_rake_path_map_partial.rb +18 -0
- data/gems/gems/rake-10.5.0/test/test_rake_pathname_extensions.rb +15 -0
- data/gems/gems/rake-10.5.0/test/test_rake_pseudo_status.rb +21 -0
- data/gems/gems/rake-10.5.0/test/test_rake_rake_test_loader.rb +20 -0
- data/gems/gems/rake-10.5.0/test/test_rake_reduce_compat.rb +26 -0
- data/gems/gems/rake-10.5.0/test/test_rake_require.rb +40 -0
- data/gems/gems/rake-10.5.0/test/test_rake_rules.rb +388 -0
- data/gems/gems/rake-10.5.0/test/test_rake_scope.rb +44 -0
- data/gems/gems/rake-10.5.0/test/test_rake_task.rb +393 -0
- data/gems/gems/rake-10.5.0/test/test_rake_task_argument_parsing.rb +119 -0
- data/gems/gems/rake-10.5.0/test/test_rake_task_arguments.rb +127 -0
- data/gems/gems/rake-10.5.0/test/test_rake_task_lib.rb +9 -0
- data/gems/gems/rake-10.5.0/test/test_rake_task_manager.rb +178 -0
- data/gems/gems/rake-10.5.0/test/test_rake_task_manager_argument_resolution.rb +19 -0
- data/gems/gems/rake-10.5.0/test/test_rake_task_with_arguments.rb +172 -0
- data/gems/gems/rake-10.5.0/test/test_rake_test_task.rb +146 -0
- data/gems/gems/rake-10.5.0/test/test_rake_thread_pool.rb +145 -0
- data/gems/gems/rake-10.5.0/test/test_rake_top_level_functions.rb +71 -0
- data/gems/gems/rake-10.5.0/test/test_rake_win32.rb +72 -0
- data/gems/gems/rake-10.5.0/test/test_thread_history_display.rb +101 -0
- data/gems/gems/rake-10.5.0/test/test_trace_output.rb +52 -0
- data/gems/gems/rspec-3.6.0/LICENSE.md +27 -0
- data/gems/gems/rspec-3.6.0/README.md +39 -0
- data/gems/gems/rspec-3.6.0/lib/rspec.rb +3 -0
- data/gems/gems/rspec-3.6.0/lib/rspec/version.rb +5 -0
- data/gems/gems/rspec-core-3.6.0/.document +5 -0
- data/gems/gems/rspec-core-3.6.0/.yardopts +8 -0
- data/gems/gems/rspec-core-3.6.0/Changelog.md +2167 -0
- data/gems/gems/rspec-core-3.6.0/LICENSE.md +26 -0
- data/gems/gems/rspec-core-3.6.0/README.md +384 -0
- data/gems/gems/rspec-core-3.6.0/exe/rspec +4 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/autorun.rb +3 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core.rb +185 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/backtrace_formatter.rb +65 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/bisect/coordinator.rb +66 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/bisect/example_minimizer.rb +169 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/bisect/runner.rb +169 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/bisect/server.rb +70 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/configuration.rb +2177 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/configuration_options.rb +196 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/drb.rb +113 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/dsl.rb +98 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/example.rb +653 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/example_group.rb +883 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/example_status_persister.rb +235 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/filter_manager.rb +231 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/flat_map.rb +20 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters.rb +265 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/base_formatter.rb +70 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/base_text_formatter.rb +75 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/bisect_formatter.rb +69 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/bisect_progress_formatter.rb +144 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/console_codes.rb +68 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/deprecation_formatter.rb +223 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/documentation_formatter.rb +70 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/exception_presenter.rb +496 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/fallback_message_formatter.rb +28 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/helpers.rb +110 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/html_formatter.rb +153 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/html_printer.rb +414 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/html_snippet_extractor.rb +118 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/json_formatter.rb +101 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/profile_formatter.rb +68 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/progress_formatter.rb +29 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/protocol.rb +182 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/snippet_extractor.rb +134 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/formatters/syntax_highlighter.rb +91 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/hooks.rb +624 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/invocations.rb +85 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/memoized_helpers.rb +535 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/metadata.rb +499 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/metadata_filter.rb +255 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/minitest_assertions_adapter.rb +31 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/mocking_adapters/flexmock.rb +31 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/mocking_adapters/mocha.rb +57 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/mocking_adapters/null.rb +14 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/mocking_adapters/rr.rb +31 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/mocking_adapters/rspec.rb +32 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/notifications.rb +514 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/option_parser.rb +309 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/ordering.rb +158 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/output_wrapper.rb +29 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/pending.rb +165 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/profiler.rb +32 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/project_initializer.rb +48 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/project_initializer/.rspec +1 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/project_initializer/spec/spec_helper.rb +100 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/rake_task.rb +168 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/reporter.rb +260 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/ruby_project.rb +53 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/runner.rb +193 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/sandbox.rb +37 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/set.rb +54 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/shared_context.rb +55 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/shared_example_group.rb +271 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/shell_escape.rb +49 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/test_unit_assertions_adapter.rb +30 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/version.rb +9 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/warnings.rb +40 -0
- data/gems/gems/rspec-core-3.6.0/lib/rspec/core/world.rb +264 -0
- data/gems/gems/rspec-expectations-3.6.0/.document +5 -0
- data/gems/gems/rspec-expectations-3.6.0/.yardopts +6 -0
- data/gems/gems/rspec-expectations-3.6.0/Changelog.md +1072 -0
- data/gems/gems/rspec-expectations-3.6.0/LICENSE.md +25 -0
- data/gems/gems/rspec-expectations-3.6.0/README.md +305 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/expectations.rb +82 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/expectations/block_snippet_extractor.rb +253 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/expectations/configuration.rb +201 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/expectations/expectation_target.rb +127 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/expectations/fail_with.rb +39 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/expectations/failure_aggregator.rb +194 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/expectations/handler.rb +170 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/expectations/minitest_integration.rb +58 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/expectations/syntax.rb +132 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/expectations/version.rb +8 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers.rb +1025 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/aliased_matcher.rb +116 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in.rb +52 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/all.rb +85 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/base_matcher.rb +193 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/be.rb +288 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/be_between.rb +77 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/be_instance_of.rb +22 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/be_kind_of.rb +16 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/be_within.rb +72 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/change.rb +387 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/compound.rb +272 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/contain_exactly.rb +301 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/cover.rb +24 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/eq.rb +40 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/eql.rb +34 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/equal.rb +81 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/exist.rb +90 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/has.rb +103 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/have_attributes.rb +114 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/include.rb +143 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/match.rb +106 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/operators.rb +128 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/output.rb +200 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/raise_error.rb +230 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/respond_to.rb +165 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/satisfy.rb +60 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/start_or_end_with.rb +94 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/throw_symbol.rb +132 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/built_in/yield.rb +432 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/composable.rb +169 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/dsl.rb +527 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/english_phrasing.rb +58 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/expecteds_for_multiple_diffs.rb +73 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/fail_matchers.rb +42 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/generated_descriptions.rb +42 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/matcher_delegator.rb +35 -0
- data/gems/gems/rspec-expectations-3.6.0/lib/rspec/matchers/matcher_protocol.rb +99 -0
- data/gems/gems/rspec-mocks-3.6.0/.document +5 -0
- data/gems/gems/rspec-mocks-3.6.0/.yardopts +6 -0
- data/gems/gems/rspec-mocks-3.6.0/Changelog.md +1073 -0
- data/gems/gems/rspec-mocks-3.6.0/LICENSE.md +25 -0
- data/gems/gems/rspec-mocks-3.6.0/README.md +460 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks.rb +130 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/any_instance.rb +11 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/any_instance/chain.rb +110 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/any_instance/error_generator.rb +31 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/any_instance/expect_chain_chain.rb +31 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/any_instance/expectation_chain.rb +50 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/any_instance/message_chains.rb +83 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/any_instance/proxy.rb +116 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/any_instance/recorder.rb +289 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/any_instance/stub_chain.rb +51 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/any_instance/stub_chain_chain.rb +23 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/argument_list_matcher.rb +100 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/argument_matchers.rb +320 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/configuration.rb +212 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/error_generator.rb +369 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/example_methods.rb +434 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/instance_method_stasher.rb +146 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/marshal_extension.rb +41 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/matchers/expectation_customization.rb +20 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/matchers/have_received.rb +130 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/matchers/receive.rb +132 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/matchers/receive_message_chain.rb +82 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/matchers/receive_messages.rb +77 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/message_chain.rb +87 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/message_expectation.rb +740 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/method_double.rb +287 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/method_reference.rb +202 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/minitest_integration.rb +68 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/mutate_const.rb +339 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/object_reference.rb +149 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/order_group.rb +81 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/proxy.rb +484 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/space.rb +238 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/standalone.rb +3 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/syntax.rb +325 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/targets.rb +124 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/test_double.rb +171 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/verifying_double.rb +129 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/verifying_message_expectation.rb +54 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/verifying_proxy.rb +220 -0
- data/gems/gems/rspec-mocks-3.6.0/lib/rspec/mocks/version.rb +9 -0
- data/gems/gems/rspec-support-3.6.0/Changelog.md +211 -0
- data/gems/gems/rspec-support-3.6.0/LICENSE.md +23 -0
- data/gems/gems/rspec-support-3.6.0/README.md +40 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support.rb +139 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/caller_filter.rb +83 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/comparable_version.rb +46 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/differ.rb +215 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/directory_maker.rb +63 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/encoded_string.rb +165 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/fuzzy_matcher.rb +48 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/hunk_generator.rb +47 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/matcher_definition.rb +42 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/method_signature_verifier.rb +392 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/mutex.rb +73 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/object_formatter.rb +268 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/recursive_const_methods.rb +76 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/reentrant_mutex.rb +53 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/ruby_features.rb +162 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/source.rb +75 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/source/location.rb +21 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/source/node.rb +107 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/source/token.rb +87 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/spec.rb +81 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/spec/deprecation_helpers.rb +64 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/spec/formatting_support.rb +9 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/spec/in_sub_process.rb +69 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/spec/library_wide_checks.rb +150 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/spec/shell_out.rb +84 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/spec/stderr_splitter.rb +63 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/spec/string_matcher.rb +46 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/spec/with_isolated_directory.rb +13 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/spec/with_isolated_stderr.rb +13 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/version.rb +7 -0
- data/gems/gems/rspec-support-3.6.0/lib/rspec/support/warnings.rb +39 -0
- data/gems/gems/thor-0.19.4/.document +5 -0
- data/gems/gems/thor-0.19.4/CHANGELOG.md +163 -0
- data/gems/gems/thor-0.19.4/CONTRIBUTING.md +15 -0
- data/gems/gems/thor-0.19.4/LICENSE.md +20 -0
- data/gems/gems/thor-0.19.4/README.md +47 -0
- data/gems/gems/thor-0.19.4/bin/thor +6 -0
- data/gems/gems/thor-0.19.4/lib/thor.rb +492 -0
- data/gems/gems/thor-0.19.4/lib/thor/actions.rb +318 -0
- data/gems/gems/thor-0.19.4/lib/thor/actions/create_file.rb +103 -0
- data/gems/gems/thor-0.19.4/lib/thor/actions/create_link.rb +59 -0
- data/gems/gems/thor-0.19.4/lib/thor/actions/directory.rb +118 -0
- data/gems/gems/thor-0.19.4/lib/thor/actions/empty_directory.rb +135 -0
- data/gems/gems/thor-0.19.4/lib/thor/actions/file_manipulation.rb +327 -0
- data/gems/gems/thor-0.19.4/lib/thor/actions/inject_into_file.rb +103 -0
- data/gems/gems/thor-0.19.4/lib/thor/base.rb +656 -0
- data/gems/gems/thor-0.19.4/lib/thor/command.rb +133 -0
- data/gems/gems/thor-0.19.4/lib/thor/core_ext/hash_with_indifferent_access.rb +85 -0
- data/gems/gems/thor-0.19.4/lib/thor/core_ext/io_binary_read.rb +12 -0
- data/gems/gems/thor-0.19.4/lib/thor/core_ext/ordered_hash.rb +129 -0
- data/gems/gems/thor-0.19.4/lib/thor/error.rb +32 -0
- data/gems/gems/thor-0.19.4/lib/thor/group.rb +281 -0
- data/gems/gems/thor-0.19.4/lib/thor/invocation.rb +177 -0
- data/gems/gems/thor-0.19.4/lib/thor/line_editor.rb +17 -0
- data/gems/gems/thor-0.19.4/lib/thor/line_editor/basic.rb +35 -0
- data/gems/gems/thor-0.19.4/lib/thor/line_editor/readline.rb +88 -0
- data/gems/gems/thor-0.19.4/lib/thor/parser.rb +4 -0
- data/gems/gems/thor-0.19.4/lib/thor/parser/argument.rb +70 -0
- data/gems/gems/thor-0.19.4/lib/thor/parser/arguments.rb +175 -0
- data/gems/gems/thor-0.19.4/lib/thor/parser/option.rb +146 -0
- data/gems/gems/thor-0.19.4/lib/thor/parser/options.rb +220 -0
- data/gems/gems/thor-0.19.4/lib/thor/rake_compat.rb +71 -0
- data/gems/gems/thor-0.19.4/lib/thor/runner.rb +322 -0
- data/gems/gems/thor-0.19.4/lib/thor/shell.rb +81 -0
- data/gems/gems/thor-0.19.4/lib/thor/shell/basic.rb +436 -0
- data/gems/gems/thor-0.19.4/lib/thor/shell/color.rb +149 -0
- data/gems/gems/thor-0.19.4/lib/thor/shell/html.rb +126 -0
- data/gems/gems/thor-0.19.4/lib/thor/util.rb +268 -0
- data/gems/gems/thor-0.19.4/lib/thor/version.rb +3 -0
- data/gems/gems/thor-0.19.4/thor.gemspec +21 -0
- data/gems/gems/unicode-0.4.4.4/README +156 -0
- data/gems/gems/unicode-0.4.4.4/Rakefile +103 -0
- data/gems/gems/unicode-0.4.4.4/ext/unicode/.sitearchdir.-.unicode.time +0 -0
- data/gems/gems/unicode-0.4.4.4/ext/unicode/Makefile +264 -0
- data/gems/gems/unicode-0.4.4.4/ext/unicode/extconf.rb +3 -0
- data/gems/gems/unicode-0.4.4.4/ext/unicode/unicode.c +1325 -0
- data/gems/gems/unicode-0.4.4.4/ext/unicode/unicode.o +0 -0
- data/gems/gems/unicode-0.4.4.4/ext/unicode/unicode_native.bundle +0 -0
- data/gems/gems/unicode-0.4.4.4/ext/unicode/unidata.map +24555 -0
- data/gems/gems/unicode-0.4.4.4/ext/unicode/ustring.c +208 -0
- data/gems/gems/unicode-0.4.4.4/ext/unicode/ustring.h +48 -0
- data/gems/gems/unicode-0.4.4.4/ext/unicode/ustring.o +0 -0
- data/gems/gems/unicode-0.4.4.4/ext/unicode/wstring.c +257 -0
- data/gems/gems/unicode-0.4.4.4/ext/unicode/wstring.h +43 -0
- data/gems/gems/unicode-0.4.4.4/ext/unicode/wstring.o +0 -0
- data/gems/gems/unicode-0.4.4.4/lib/unicode.rb +6 -0
- data/gems/gems/unicode-0.4.4.4/lib/unicode/unicode_native.bundle +0 -0
- data/gems/gems/unicode-0.4.4.4/test/test.rb +69 -0
- data/gems/gems/unicode-0.4.4.4/tools/README +7 -0
- data/gems/gems/unicode-0.4.4.4/tools/mkunidata.rb +293 -0
- data/gems/gems/unicode-0.4.4.4/tools/normtest.rb +111 -0
- data/gems/gems/unicode-0.4.4.4/unicode.gemspec +30 -0
- data/gems/specifications/bibtex-ruby-4.4.4.gemspec +32 -0
- data/gems/specifications/diff-lcs-1.3.gemspec +61 -0
- data/gems/specifications/latex-decode-0.2.2.gemspec +35 -0
- data/gems/specifications/rake-10.5.0.gemspec +43 -0
- data/gems/specifications/rspec-3.6.0.gemspec +42 -0
- data/gems/specifications/rspec-core-3.6.0.gemspec +62 -0
- data/gems/specifications/rspec-expectations-3.6.0.gemspec +50 -0
- data/gems/specifications/rspec-mocks-3.6.0.gemspec +50 -0
- data/gems/specifications/rspec-support-3.6.0.gemspec +41 -0
- data/gems/specifications/thor-0.19.4.gemspec +35 -0
- data/gems/specifications/unicode-0.4.4.4.gemspec +25 -0
- data/lib/bibtex_to_scrapbox.rb +67 -0
- data/lib/bibtex_to_scrapbox/version.rb +3 -0
- data/lib/cli.rb +23 -0
- metadata +740 -0
@@ -0,0 +1,883 @@
|
|
1
|
+
RSpec::Support.require_rspec_support 'recursive_const_methods'
|
2
|
+
|
3
|
+
module RSpec
|
4
|
+
module Core
|
5
|
+
# rubocop:disable Metrics/ClassLength
|
6
|
+
# ExampleGroup and {Example} are the main structural elements of
|
7
|
+
# rspec-core. Consider this example:
|
8
|
+
#
|
9
|
+
# describe Thing do
|
10
|
+
# it "does something" do
|
11
|
+
# end
|
12
|
+
# end
|
13
|
+
#
|
14
|
+
# The object returned by `describe Thing` is a subclass of ExampleGroup.
|
15
|
+
# The object returned by `it "does something"` is an instance of Example,
|
16
|
+
# which serves as a wrapper for an instance of the ExampleGroup in which it
|
17
|
+
# is declared.
|
18
|
+
#
|
19
|
+
# Example group bodies (e.g. `describe` or `context` blocks) are evaluated
|
20
|
+
# in the context of a new subclass of ExampleGroup. Individual examples are
|
21
|
+
# evaluated in the context of an instance of the specific ExampleGroup
|
22
|
+
# subclass to which they belong.
|
23
|
+
#
|
24
|
+
# Besides the class methods defined here, there are other interesting macros
|
25
|
+
# defined in {Hooks}, {MemoizedHelpers::ClassMethods} and
|
26
|
+
# {SharedExampleGroup}. There are additional instance methods available to
|
27
|
+
# your examples defined in {MemoizedHelpers} and {Pending}.
|
28
|
+
class ExampleGroup
|
29
|
+
extend Hooks
|
30
|
+
|
31
|
+
include MemoizedHelpers
|
32
|
+
extend MemoizedHelpers::ClassMethods
|
33
|
+
include Pending
|
34
|
+
extend SharedExampleGroup
|
35
|
+
|
36
|
+
# Define a singleton method for the singleton class (remove the method if
|
37
|
+
# it's already been defined).
|
38
|
+
# @private
|
39
|
+
def self.idempotently_define_singleton_method(name, &definition)
|
40
|
+
(class << self; self; end).module_exec do
|
41
|
+
remove_method(name) if method_defined?(name) && instance_method(name).owner == self
|
42
|
+
define_method(name, &definition)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
# @!group Metadata
|
47
|
+
|
48
|
+
# The [Metadata](Metadata) object associated with this group.
|
49
|
+
# @see Metadata
|
50
|
+
def self.metadata
|
51
|
+
@metadata ||= nil
|
52
|
+
end
|
53
|
+
|
54
|
+
# Temporarily replace the provided metadata.
|
55
|
+
# Intended primarily to allow an example group's singleton class
|
56
|
+
# to return the metadata of the example that it exists for. This
|
57
|
+
# is necessary for shared example group inclusion to work properly
|
58
|
+
# with singleton example groups.
|
59
|
+
# @private
|
60
|
+
def self.with_replaced_metadata(meta)
|
61
|
+
orig_metadata = metadata
|
62
|
+
@metadata = meta
|
63
|
+
yield
|
64
|
+
ensure
|
65
|
+
@metadata = orig_metadata
|
66
|
+
end
|
67
|
+
|
68
|
+
# @private
|
69
|
+
# @return [Metadata] belonging to the parent of a nested {ExampleGroup}
|
70
|
+
def self.superclass_metadata
|
71
|
+
@superclass_metadata ||= superclass.respond_to?(:metadata) ? superclass.metadata : nil
|
72
|
+
end
|
73
|
+
|
74
|
+
# @private
|
75
|
+
def self.delegate_to_metadata(*names)
|
76
|
+
names.each do |name|
|
77
|
+
idempotently_define_singleton_method(name) { metadata.fetch(name) }
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
delegate_to_metadata :described_class, :file_path, :location
|
82
|
+
|
83
|
+
# @return [String] the current example group description
|
84
|
+
def self.description
|
85
|
+
description = metadata[:description]
|
86
|
+
RSpec.configuration.format_docstrings_block.call(description)
|
87
|
+
end
|
88
|
+
|
89
|
+
# Returns the class or module passed to the `describe` method (or alias).
|
90
|
+
# Returns nil if the subject is not a class or module.
|
91
|
+
# @example
|
92
|
+
# describe Thing do
|
93
|
+
# it "does something" do
|
94
|
+
# described_class == Thing
|
95
|
+
# end
|
96
|
+
# end
|
97
|
+
#
|
98
|
+
def described_class
|
99
|
+
self.class.described_class
|
100
|
+
end
|
101
|
+
|
102
|
+
# @!endgroup
|
103
|
+
|
104
|
+
# @!group Defining Examples
|
105
|
+
|
106
|
+
# @private
|
107
|
+
# @macro [attach] define_example_method
|
108
|
+
# @!scope class
|
109
|
+
# @overload $1
|
110
|
+
# @overload $1(&example_implementation)
|
111
|
+
# @param example_implementation [Block] The implementation of the example.
|
112
|
+
# @overload $1(doc_string, *metadata_keys, metadata={})
|
113
|
+
# @param doc_string [String] The example's doc string.
|
114
|
+
# @param metadata [Hash] Metadata for the example.
|
115
|
+
# @param metadata_keys [Array<Symbol>] Metadata tags for the example.
|
116
|
+
# Will be transformed into hash entries with `true` values.
|
117
|
+
# @overload $1(doc_string, *metadata_keys, metadata={}, &example_implementation)
|
118
|
+
# @param doc_string [String] The example's doc string.
|
119
|
+
# @param metadata [Hash] Metadata for the example.
|
120
|
+
# @param metadata_keys [Array<Symbol>] Metadata tags for the example.
|
121
|
+
# Will be transformed into hash entries with `true` values.
|
122
|
+
# @param example_implementation [Block] The implementation of the example.
|
123
|
+
# @yield [Example] the example object
|
124
|
+
# @example
|
125
|
+
# $1 do
|
126
|
+
# end
|
127
|
+
#
|
128
|
+
# $1 "does something" do
|
129
|
+
# end
|
130
|
+
#
|
131
|
+
# $1 "does something", :slow, :uses_js do
|
132
|
+
# end
|
133
|
+
#
|
134
|
+
# $1 "does something", :with => 'additional metadata' do
|
135
|
+
# end
|
136
|
+
#
|
137
|
+
# $1 "does something" do |ex|
|
138
|
+
# # ex is the Example object that contains metadata about the example
|
139
|
+
# end
|
140
|
+
def self.define_example_method(name, extra_options={})
|
141
|
+
idempotently_define_singleton_method(name) do |*all_args, &block|
|
142
|
+
desc, *args = *all_args
|
143
|
+
|
144
|
+
options = Metadata.build_hash_from(args)
|
145
|
+
options.update(:skip => RSpec::Core::Pending::NOT_YET_IMPLEMENTED) unless block
|
146
|
+
options.update(extra_options)
|
147
|
+
|
148
|
+
RSpec::Core::Example.new(self, desc, options, block)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
# Defines an example within a group.
|
153
|
+
define_example_method :example
|
154
|
+
# Defines an example within a group.
|
155
|
+
# This is the primary API to define a code example.
|
156
|
+
define_example_method :it
|
157
|
+
# Defines an example within a group.
|
158
|
+
# Useful for when your docstring does not read well off of `it`.
|
159
|
+
# @example
|
160
|
+
# RSpec.describe MyClass do
|
161
|
+
# specify "#do_something is deprecated" do
|
162
|
+
# # ...
|
163
|
+
# end
|
164
|
+
# end
|
165
|
+
define_example_method :specify
|
166
|
+
|
167
|
+
# Shortcut to define an example with `:focus => true`.
|
168
|
+
# @see example
|
169
|
+
define_example_method :focus, :focus => true
|
170
|
+
# Shortcut to define an example with `:focus => true`.
|
171
|
+
# @see example
|
172
|
+
define_example_method :fexample, :focus => true
|
173
|
+
# Shortcut to define an example with `:focus => true`.
|
174
|
+
# @see example
|
175
|
+
define_example_method :fit, :focus => true
|
176
|
+
# Shortcut to define an example with `:focus => true`.
|
177
|
+
# @see example
|
178
|
+
define_example_method :fspecify, :focus => true
|
179
|
+
# Shortcut to define an example with `:skip => 'Temporarily skipped with xexample'`.
|
180
|
+
# @see example
|
181
|
+
define_example_method :xexample, :skip => 'Temporarily skipped with xexample'
|
182
|
+
# Shortcut to define an example with `:skip => 'Temporarily skipped with xit'`.
|
183
|
+
# @see example
|
184
|
+
define_example_method :xit, :skip => 'Temporarily skipped with xit'
|
185
|
+
# Shortcut to define an example with `:skip => 'Temporarily skipped with xspecify'`.
|
186
|
+
# @see example
|
187
|
+
define_example_method :xspecify, :skip => 'Temporarily skipped with xspecify'
|
188
|
+
# Shortcut to define an example with `:skip => true`
|
189
|
+
# @see example
|
190
|
+
define_example_method :skip, :skip => true
|
191
|
+
# Shortcut to define an example with `:pending => true`
|
192
|
+
# @see example
|
193
|
+
define_example_method :pending, :pending => true
|
194
|
+
|
195
|
+
# @!endgroup
|
196
|
+
|
197
|
+
# @!group Defining Example Groups
|
198
|
+
|
199
|
+
# @private
|
200
|
+
# @macro [attach] define_example_group_method
|
201
|
+
# @!scope class
|
202
|
+
# @overload $1
|
203
|
+
# @overload $1(&example_group_definition)
|
204
|
+
# @param example_group_definition [Block] The definition of the example group.
|
205
|
+
# @overload $1(doc_string, *metadata_keys, metadata={}, &example_implementation)
|
206
|
+
# @param doc_string [String] The group's doc string.
|
207
|
+
# @param metadata [Hash] Metadata for the group.
|
208
|
+
# @param metadata_keys [Array<Symbol>] Metadata tags for the group.
|
209
|
+
# Will be transformed into hash entries with `true` values.
|
210
|
+
# @param example_group_definition [Block] The definition of the example group.
|
211
|
+
#
|
212
|
+
# Generates a subclass of this example group which inherits
|
213
|
+
# everything except the examples themselves.
|
214
|
+
#
|
215
|
+
# @example
|
216
|
+
#
|
217
|
+
# RSpec.describe "something" do # << This describe method is defined in
|
218
|
+
# # << RSpec::Core::DSL, included in the
|
219
|
+
# # << global namespace (optional)
|
220
|
+
# before do
|
221
|
+
# do_something_before
|
222
|
+
# end
|
223
|
+
#
|
224
|
+
# let(:thing) { Thing.new }
|
225
|
+
#
|
226
|
+
# $1 "attribute (of something)" do
|
227
|
+
# # examples in the group get the before hook
|
228
|
+
# # declared above, and can access `thing`
|
229
|
+
# end
|
230
|
+
# end
|
231
|
+
#
|
232
|
+
# @see DSL#describe
|
233
|
+
def self.define_example_group_method(name, metadata={})
|
234
|
+
idempotently_define_singleton_method(name) do |*args, &example_group_block|
|
235
|
+
thread_data = RSpec::Support.thread_local_data
|
236
|
+
top_level = self == ExampleGroup
|
237
|
+
|
238
|
+
registration_collection =
|
239
|
+
if top_level
|
240
|
+
if thread_data[:in_example_group]
|
241
|
+
raise "Creating an isolated context from within a context is " \
|
242
|
+
"not allowed. Change `RSpec.#{name}` to `#{name}` or " \
|
243
|
+
"move this to a top-level scope."
|
244
|
+
end
|
245
|
+
|
246
|
+
thread_data[:in_example_group] = true
|
247
|
+
RSpec.world.example_groups
|
248
|
+
else
|
249
|
+
children
|
250
|
+
end
|
251
|
+
|
252
|
+
begin
|
253
|
+
description = args.shift
|
254
|
+
combined_metadata = metadata.dup
|
255
|
+
combined_metadata.merge!(args.pop) if args.last.is_a? Hash
|
256
|
+
args << combined_metadata
|
257
|
+
|
258
|
+
subclass(self, description, args, registration_collection, &example_group_block)
|
259
|
+
ensure
|
260
|
+
thread_data.delete(:in_example_group) if top_level
|
261
|
+
end
|
262
|
+
end
|
263
|
+
|
264
|
+
RSpec::Core::DSL.expose_example_group_alias(name)
|
265
|
+
end
|
266
|
+
|
267
|
+
define_example_group_method :example_group
|
268
|
+
|
269
|
+
# An alias of `example_group`. Generally used when grouping examples by a
|
270
|
+
# thing you are describing (e.g. an object, class or method).
|
271
|
+
# @see example_group
|
272
|
+
define_example_group_method :describe
|
273
|
+
|
274
|
+
# An alias of `example_group`. Generally used when grouping examples
|
275
|
+
# contextually (e.g. "with xyz", "when xyz" or "if xyz").
|
276
|
+
# @see example_group
|
277
|
+
define_example_group_method :context
|
278
|
+
|
279
|
+
# Shortcut to temporarily make an example group skipped.
|
280
|
+
# @see example_group
|
281
|
+
define_example_group_method :xdescribe, :skip => "Temporarily skipped with xdescribe"
|
282
|
+
|
283
|
+
# Shortcut to temporarily make an example group skipped.
|
284
|
+
# @see example_group
|
285
|
+
define_example_group_method :xcontext, :skip => "Temporarily skipped with xcontext"
|
286
|
+
|
287
|
+
# Shortcut to define an example group with `:focus => true`.
|
288
|
+
# @see example_group
|
289
|
+
define_example_group_method :fdescribe, :focus => true
|
290
|
+
|
291
|
+
# Shortcut to define an example group with `:focus => true`.
|
292
|
+
# @see example_group
|
293
|
+
define_example_group_method :fcontext, :focus => true
|
294
|
+
|
295
|
+
# @!endgroup
|
296
|
+
|
297
|
+
# @!group Including Shared Example Groups
|
298
|
+
|
299
|
+
# @private
|
300
|
+
# @macro [attach] define_nested_shared_group_method
|
301
|
+
# @!scope class
|
302
|
+
#
|
303
|
+
# @see SharedExampleGroup
|
304
|
+
def self.define_nested_shared_group_method(new_name, report_label="it should behave like")
|
305
|
+
idempotently_define_singleton_method(new_name) do |name, *args, &customization_block|
|
306
|
+
# Pass :caller so the :location metadata is set properly.
|
307
|
+
# Otherwise, it'll be set to the next line because that's
|
308
|
+
# the block's source_location.
|
309
|
+
group = example_group("#{report_label} #{name}", :caller => (the_caller = caller)) do
|
310
|
+
find_and_eval_shared("examples", name, the_caller.first, *args, &customization_block)
|
311
|
+
end
|
312
|
+
group.metadata[:shared_group_name] = name
|
313
|
+
group
|
314
|
+
end
|
315
|
+
end
|
316
|
+
|
317
|
+
# Generates a nested example group and includes the shared content
|
318
|
+
# mapped to `name` in the nested group.
|
319
|
+
define_nested_shared_group_method :it_behaves_like, "behaves like"
|
320
|
+
# Generates a nested example group and includes the shared content
|
321
|
+
# mapped to `name` in the nested group.
|
322
|
+
define_nested_shared_group_method :it_should_behave_like
|
323
|
+
|
324
|
+
# Includes shared content mapped to `name` directly in the group in which
|
325
|
+
# it is declared, as opposed to `it_behaves_like`, which creates a nested
|
326
|
+
# group. If given a block, that block is also eval'd in the current
|
327
|
+
# context.
|
328
|
+
#
|
329
|
+
# @see SharedExampleGroup
|
330
|
+
def self.include_context(name, *args, &block)
|
331
|
+
find_and_eval_shared("context", name, caller.first, *args, &block)
|
332
|
+
end
|
333
|
+
|
334
|
+
# Includes shared content mapped to `name` directly in the group in which
|
335
|
+
# it is declared, as opposed to `it_behaves_like`, which creates a nested
|
336
|
+
# group. If given a block, that block is also eval'd in the current
|
337
|
+
# context.
|
338
|
+
#
|
339
|
+
# @see SharedExampleGroup
|
340
|
+
def self.include_examples(name, *args, &block)
|
341
|
+
find_and_eval_shared("examples", name, caller.first, *args, &block)
|
342
|
+
end
|
343
|
+
|
344
|
+
# Clear memoized values when adding/removing examples
|
345
|
+
# @private
|
346
|
+
def self.reset_memoized
|
347
|
+
@descendant_filtered_examples = nil
|
348
|
+
@_descendants = nil
|
349
|
+
@parent_groups = nil
|
350
|
+
@declaration_locations = nil
|
351
|
+
end
|
352
|
+
|
353
|
+
# Adds an example to the example group
|
354
|
+
def self.add_example(example)
|
355
|
+
reset_memoized
|
356
|
+
examples << example
|
357
|
+
end
|
358
|
+
|
359
|
+
# Removes an example from the example group
|
360
|
+
def self.remove_example(example)
|
361
|
+
reset_memoized
|
362
|
+
examples.delete example
|
363
|
+
end
|
364
|
+
|
365
|
+
# @private
|
366
|
+
def self.find_and_eval_shared(label, name, inclusion_location, *args, &customization_block)
|
367
|
+
shared_module = RSpec.world.shared_example_group_registry.find(parent_groups, name)
|
368
|
+
|
369
|
+
unless shared_module
|
370
|
+
raise ArgumentError, "Could not find shared #{label} #{name.inspect}"
|
371
|
+
end
|
372
|
+
|
373
|
+
shared_module.include_in(
|
374
|
+
self, Metadata.relative_path(inclusion_location),
|
375
|
+
args, customization_block
|
376
|
+
)
|
377
|
+
end
|
378
|
+
|
379
|
+
# @!endgroup
|
380
|
+
|
381
|
+
# @private
|
382
|
+
def self.subclass(parent, description, args, registration_collection, &example_group_block)
|
383
|
+
subclass = Class.new(parent)
|
384
|
+
subclass.set_it_up(description, args, registration_collection, &example_group_block)
|
385
|
+
subclass.module_exec(&example_group_block) if example_group_block
|
386
|
+
|
387
|
+
# The LetDefinitions module must be included _after_ other modules
|
388
|
+
# to ensure that it takes precedence when there are name collisions.
|
389
|
+
# Thus, we delay including it until after the example group block
|
390
|
+
# has been eval'd.
|
391
|
+
MemoizedHelpers.define_helpers_on(subclass)
|
392
|
+
|
393
|
+
subclass
|
394
|
+
end
|
395
|
+
|
396
|
+
# @private
|
397
|
+
def self.set_it_up(description, args, registration_collection, &example_group_block)
|
398
|
+
# Ruby 1.9 has a bug that can lead to infinite recursion and a
|
399
|
+
# SystemStackError if you include a module in a superclass after
|
400
|
+
# including it in a subclass: https://gist.github.com/845896
|
401
|
+
# To prevent this, we must include any modules in
|
402
|
+
# RSpec::Core::ExampleGroup before users create example groups and have
|
403
|
+
# a chance to include the same module in a subclass of
|
404
|
+
# RSpec::Core::ExampleGroup. So we need to configure example groups
|
405
|
+
# here.
|
406
|
+
ensure_example_groups_are_configured
|
407
|
+
|
408
|
+
# Register the example with the group before creating the metadata hash.
|
409
|
+
# This is necessary since creating the metadata hash triggers
|
410
|
+
# `when_first_matching_example_defined` callbacks, in which users can
|
411
|
+
# load RSpec support code which defines hooks. For that to work, the
|
412
|
+
# examples and example groups must be registered at the time the
|
413
|
+
# support code is called or be defined afterwards.
|
414
|
+
# Begin defined beforehand but registered afterwards causes hooks to
|
415
|
+
# not be applied where they should.
|
416
|
+
registration_collection << self
|
417
|
+
|
418
|
+
@user_metadata = Metadata.build_hash_from(args)
|
419
|
+
|
420
|
+
@metadata = Metadata::ExampleGroupHash.create(
|
421
|
+
superclass_metadata, @user_metadata,
|
422
|
+
superclass.method(:next_runnable_index_for),
|
423
|
+
description, *args, &example_group_block
|
424
|
+
)
|
425
|
+
ExampleGroups.assign_const(self)
|
426
|
+
|
427
|
+
@currently_executing_a_context_hook = false
|
428
|
+
|
429
|
+
RSpec.configuration.configure_group(self)
|
430
|
+
end
|
431
|
+
|
432
|
+
# @private
|
433
|
+
def self.examples
|
434
|
+
@examples ||= []
|
435
|
+
end
|
436
|
+
|
437
|
+
# @private
|
438
|
+
def self.filtered_examples
|
439
|
+
RSpec.world.filtered_examples[self]
|
440
|
+
end
|
441
|
+
|
442
|
+
# @private
|
443
|
+
def self.descendant_filtered_examples
|
444
|
+
@descendant_filtered_examples ||= filtered_examples +
|
445
|
+
FlatMap.flat_map(children, &:descendant_filtered_examples)
|
446
|
+
end
|
447
|
+
|
448
|
+
# @private
|
449
|
+
def self.children
|
450
|
+
@children ||= []
|
451
|
+
end
|
452
|
+
|
453
|
+
# @private
|
454
|
+
# Traverses the tree of groups, starting with `self`, then the children, recursively.
|
455
|
+
# Halts the traversal of a branch of the tree as soon as the passed block returns true.
|
456
|
+
# Note that siblings groups and their sub-trees will continue to be explored.
|
457
|
+
# This is intended to make it easy to find the top-most group that satisfies some
|
458
|
+
# condition.
|
459
|
+
def self.traverse_tree_until(&block)
|
460
|
+
return if yield self
|
461
|
+
|
462
|
+
children.each do |child|
|
463
|
+
child.traverse_tree_until(&block)
|
464
|
+
end
|
465
|
+
end
|
466
|
+
|
467
|
+
# @private
|
468
|
+
def self.next_runnable_index_for(file)
|
469
|
+
if self == ExampleGroup
|
470
|
+
# We add 1 so the ids start at 1 instead of 0. This is
|
471
|
+
# necessary for this branch (but not for the other one)
|
472
|
+
# because we register examples and groups with the
|
473
|
+
# `children` and `examples` collection BEFORE this
|
474
|
+
# method is called as part of metadata hash creation,
|
475
|
+
# but the example group is recorded with
|
476
|
+
# `RSpec.world.example_group_counts_by_spec_file` AFTER
|
477
|
+
# the metadata hash is created and the group is returned
|
478
|
+
# to the caller.
|
479
|
+
RSpec.world.num_example_groups_defined_in(file) + 1
|
480
|
+
else
|
481
|
+
children.count + examples.count
|
482
|
+
end
|
483
|
+
end
|
484
|
+
|
485
|
+
# @private
|
486
|
+
def self.descendants
|
487
|
+
@_descendants ||= [self] + FlatMap.flat_map(children, &:descendants)
|
488
|
+
end
|
489
|
+
|
490
|
+
## @private
|
491
|
+
def self.parent_groups
|
492
|
+
@parent_groups ||= ancestors.select { |a| a < RSpec::Core::ExampleGroup }
|
493
|
+
end
|
494
|
+
|
495
|
+
# @private
|
496
|
+
def self.top_level?
|
497
|
+
superclass == ExampleGroup
|
498
|
+
end
|
499
|
+
|
500
|
+
# @private
|
501
|
+
def self.ensure_example_groups_are_configured
|
502
|
+
unless defined?(@@example_groups_configured)
|
503
|
+
RSpec.configuration.configure_mock_framework
|
504
|
+
RSpec.configuration.configure_expectation_framework
|
505
|
+
# rubocop:disable Style/ClassVars
|
506
|
+
@@example_groups_configured = true
|
507
|
+
# rubocop:enable Style/ClassVars
|
508
|
+
end
|
509
|
+
end
|
510
|
+
|
511
|
+
# @private
|
512
|
+
def self.before_context_ivars
|
513
|
+
@before_context_ivars ||= {}
|
514
|
+
end
|
515
|
+
|
516
|
+
# @private
|
517
|
+
def self.store_before_context_ivars(example_group_instance)
|
518
|
+
each_instance_variable_for_example(example_group_instance) do |ivar|
|
519
|
+
before_context_ivars[ivar] = example_group_instance.instance_variable_get(ivar)
|
520
|
+
end
|
521
|
+
end
|
522
|
+
|
523
|
+
# Returns true if a `before(:context)` or `after(:context)`
|
524
|
+
# hook is currently executing.
|
525
|
+
def self.currently_executing_a_context_hook?
|
526
|
+
@currently_executing_a_context_hook
|
527
|
+
end
|
528
|
+
|
529
|
+
# @private
|
530
|
+
def self.run_before_context_hooks(example_group_instance)
|
531
|
+
set_ivars(example_group_instance, superclass_before_context_ivars)
|
532
|
+
|
533
|
+
@currently_executing_a_context_hook = true
|
534
|
+
|
535
|
+
ContextHookMemoized::Before.isolate_for_context_hook(example_group_instance) do
|
536
|
+
hooks.run(:before, :context, example_group_instance)
|
537
|
+
end
|
538
|
+
ensure
|
539
|
+
store_before_context_ivars(example_group_instance)
|
540
|
+
@currently_executing_a_context_hook = false
|
541
|
+
end
|
542
|
+
|
543
|
+
if RUBY_VERSION.to_f >= 1.9
|
544
|
+
# @private
|
545
|
+
def self.superclass_before_context_ivars
|
546
|
+
superclass.before_context_ivars
|
547
|
+
end
|
548
|
+
else # 1.8.7
|
549
|
+
# :nocov:
|
550
|
+
# @private
|
551
|
+
def self.superclass_before_context_ivars
|
552
|
+
if superclass.respond_to?(:before_context_ivars)
|
553
|
+
superclass.before_context_ivars
|
554
|
+
else
|
555
|
+
# `self` must be the singleton class of an ExampleGroup instance.
|
556
|
+
# On 1.8.7, the superclass of a singleton class of an instance of A
|
557
|
+
# is A's singleton class. On 1.9+, it's A. On 1.8.7, the first ancestor
|
558
|
+
# is A, so we can mirror 1.8.7's behavior here. Note that we have to
|
559
|
+
# search for the first that responds to `before_context_ivars`
|
560
|
+
# in case a module has been included in the singleton class.
|
561
|
+
ancestors.find { |a| a.respond_to?(:before_context_ivars) }.before_context_ivars
|
562
|
+
end
|
563
|
+
end
|
564
|
+
# :nocov:
|
565
|
+
end
|
566
|
+
|
567
|
+
# @private
|
568
|
+
def self.run_after_context_hooks(example_group_instance)
|
569
|
+
set_ivars(example_group_instance, before_context_ivars)
|
570
|
+
|
571
|
+
@currently_executing_a_context_hook = true
|
572
|
+
|
573
|
+
ContextHookMemoized::After.isolate_for_context_hook(example_group_instance) do
|
574
|
+
hooks.run(:after, :context, example_group_instance)
|
575
|
+
end
|
576
|
+
ensure
|
577
|
+
before_context_ivars.clear
|
578
|
+
@currently_executing_a_context_hook = false
|
579
|
+
end
|
580
|
+
|
581
|
+
# Runs all the examples in this group.
|
582
|
+
def self.run(reporter=RSpec::Core::NullReporter)
|
583
|
+
return if RSpec.world.wants_to_quit
|
584
|
+
reporter.example_group_started(self)
|
585
|
+
|
586
|
+
should_run_context_hooks = descendant_filtered_examples.any?
|
587
|
+
begin
|
588
|
+
run_before_context_hooks(new('before(:context) hook')) if should_run_context_hooks
|
589
|
+
result_for_this_group = run_examples(reporter)
|
590
|
+
results_for_descendants = ordering_strategy.order(children).map { |child| child.run(reporter) }.all?
|
591
|
+
result_for_this_group && results_for_descendants
|
592
|
+
rescue Pending::SkipDeclaredInExample => ex
|
593
|
+
for_filtered_examples(reporter) { |example| example.skip_with_exception(reporter, ex) }
|
594
|
+
true
|
595
|
+
rescue Support::AllExceptionsExceptOnesWeMustNotRescue => ex
|
596
|
+
for_filtered_examples(reporter) { |example| example.fail_with_exception(reporter, ex) }
|
597
|
+
RSpec.world.wants_to_quit = true if reporter.fail_fast_limit_met?
|
598
|
+
false
|
599
|
+
ensure
|
600
|
+
run_after_context_hooks(new('after(:context) hook')) if should_run_context_hooks
|
601
|
+
reporter.example_group_finished(self)
|
602
|
+
end
|
603
|
+
end
|
604
|
+
|
605
|
+
# @private
|
606
|
+
def self.ordering_strategy
|
607
|
+
order = metadata.fetch(:order, :global)
|
608
|
+
registry = RSpec.configuration.ordering_registry
|
609
|
+
|
610
|
+
registry.fetch(order) do
|
611
|
+
warn <<-WARNING.gsub(/^ +\|/, '')
|
612
|
+
|WARNING: Ignoring unknown ordering specified using `:order => #{order.inspect}` metadata.
|
613
|
+
| Falling back to configured global ordering.
|
614
|
+
| Unrecognized ordering specified at: #{location}
|
615
|
+
WARNING
|
616
|
+
|
617
|
+
registry.fetch(:global)
|
618
|
+
end
|
619
|
+
end
|
620
|
+
|
621
|
+
# @private
|
622
|
+
def self.run_examples(reporter)
|
623
|
+
ordering_strategy.order(filtered_examples).map do |example|
|
624
|
+
next if RSpec.world.wants_to_quit
|
625
|
+
instance = new(example.inspect_output)
|
626
|
+
set_ivars(instance, before_context_ivars)
|
627
|
+
succeeded = example.run(instance, reporter)
|
628
|
+
if !succeeded && reporter.fail_fast_limit_met?
|
629
|
+
RSpec.world.wants_to_quit = true
|
630
|
+
end
|
631
|
+
succeeded
|
632
|
+
end.all?
|
633
|
+
end
|
634
|
+
|
635
|
+
# @private
|
636
|
+
def self.for_filtered_examples(reporter, &block)
|
637
|
+
filtered_examples.each(&block)
|
638
|
+
|
639
|
+
children.each do |child|
|
640
|
+
reporter.example_group_started(child)
|
641
|
+
child.for_filtered_examples(reporter, &block)
|
642
|
+
reporter.example_group_finished(child)
|
643
|
+
end
|
644
|
+
false
|
645
|
+
end
|
646
|
+
|
647
|
+
# @private
|
648
|
+
def self.declaration_locations
|
649
|
+
@declaration_locations ||= [Metadata.location_tuple_from(metadata)] +
|
650
|
+
examples.map { |e| Metadata.location_tuple_from(e.metadata) } +
|
651
|
+
FlatMap.flat_map(children, &:declaration_locations)
|
652
|
+
end
|
653
|
+
|
654
|
+
# @return [String] the unique id of this example group. Pass
|
655
|
+
# this at the command line to re-run this exact example group.
|
656
|
+
def self.id
|
657
|
+
Metadata.id_from(metadata)
|
658
|
+
end
|
659
|
+
|
660
|
+
# @private
|
661
|
+
def self.top_level_description
|
662
|
+
parent_groups.last.description
|
663
|
+
end
|
664
|
+
|
665
|
+
# @private
|
666
|
+
def self.set_ivars(instance, ivars)
|
667
|
+
ivars.each { |name, value| instance.instance_variable_set(name, value) }
|
668
|
+
end
|
669
|
+
|
670
|
+
if RUBY_VERSION.to_f < 1.9
|
671
|
+
# :nocov:
|
672
|
+
# @private
|
673
|
+
INSTANCE_VARIABLE_TO_IGNORE = '@__inspect_output'.freeze
|
674
|
+
# :nocov:
|
675
|
+
else
|
676
|
+
# @private
|
677
|
+
INSTANCE_VARIABLE_TO_IGNORE = :@__inspect_output
|
678
|
+
end
|
679
|
+
|
680
|
+
# @private
|
681
|
+
def self.each_instance_variable_for_example(group)
|
682
|
+
group.instance_variables.each do |ivar|
|
683
|
+
yield ivar unless ivar == INSTANCE_VARIABLE_TO_IGNORE
|
684
|
+
end
|
685
|
+
end
|
686
|
+
|
687
|
+
def initialize(inspect_output=nil)
|
688
|
+
@__inspect_output = inspect_output || '(no description provided)'
|
689
|
+
super() # no args get passed
|
690
|
+
end
|
691
|
+
|
692
|
+
# @private
|
693
|
+
def inspect
|
694
|
+
"#<#{self.class} #{@__inspect_output}>"
|
695
|
+
end
|
696
|
+
|
697
|
+
unless method_defined?(:singleton_class) # for 1.8.7
|
698
|
+
# :nocov:
|
699
|
+
# @private
|
700
|
+
def singleton_class
|
701
|
+
class << self; self; end
|
702
|
+
end
|
703
|
+
# :nocov:
|
704
|
+
end
|
705
|
+
|
706
|
+
# @private
|
707
|
+
def self.update_inherited_metadata(updates)
|
708
|
+
metadata.update(updates) do |key, existing_group_value, new_inherited_value|
|
709
|
+
@user_metadata.key?(key) ? existing_group_value : new_inherited_value
|
710
|
+
end
|
711
|
+
|
712
|
+
RSpec.configuration.configure_group(self)
|
713
|
+
examples.each { |ex| ex.update_inherited_metadata(updates) }
|
714
|
+
children.each { |group| group.update_inherited_metadata(updates) }
|
715
|
+
end
|
716
|
+
|
717
|
+
# Raised when an RSpec API is called in the wrong scope, such as `before`
|
718
|
+
# being called from within an example rather than from within an example
|
719
|
+
# group block.
|
720
|
+
WrongScopeError = Class.new(NoMethodError)
|
721
|
+
|
722
|
+
def self.method_missing(name, *args)
|
723
|
+
if method_defined?(name)
|
724
|
+
raise WrongScopeError,
|
725
|
+
"`#{name}` is not available on an example group (e.g. a " \
|
726
|
+
"`describe` or `context` block). It is only available from " \
|
727
|
+
"within individual examples (e.g. `it` blocks) or from " \
|
728
|
+
"constructs that run in the scope of an example (e.g. " \
|
729
|
+
"`before`, `let`, etc)."
|
730
|
+
end
|
731
|
+
|
732
|
+
super
|
733
|
+
end
|
734
|
+
private_class_method :method_missing
|
735
|
+
|
736
|
+
private
|
737
|
+
|
738
|
+
def method_missing(name, *args)
|
739
|
+
if self.class.respond_to?(name)
|
740
|
+
raise WrongScopeError,
|
741
|
+
"`#{name}` is not available from within an example (e.g. an " \
|
742
|
+
"`it` block) or from constructs that run in the scope of an " \
|
743
|
+
"example (e.g. `before`, `let`, etc). It is only available " \
|
744
|
+
"on an example group (e.g. a `describe` or `context` block)."
|
745
|
+
end
|
746
|
+
|
747
|
+
super
|
748
|
+
end
|
749
|
+
end
|
750
|
+
# rubocop:enable Metrics/ClassLength
|
751
|
+
|
752
|
+
# @private
|
753
|
+
# Unnamed example group used by `SuiteHookContext`.
|
754
|
+
class AnonymousExampleGroup < ExampleGroup
|
755
|
+
def self.metadata
|
756
|
+
{}
|
757
|
+
end
|
758
|
+
end
|
759
|
+
|
760
|
+
# Contains information about the inclusion site of a shared example group.
|
761
|
+
class SharedExampleGroupInclusionStackFrame
|
762
|
+
# @return [String] the name of the shared example group
|
763
|
+
attr_reader :shared_group_name
|
764
|
+
# @return [String] the location where the shared example was included
|
765
|
+
attr_reader :inclusion_location
|
766
|
+
|
767
|
+
def initialize(shared_group_name, inclusion_location)
|
768
|
+
@shared_group_name = shared_group_name
|
769
|
+
@inclusion_location = inclusion_location
|
770
|
+
end
|
771
|
+
|
772
|
+
# @return [String] The {#inclusion_location}, formatted for display by a formatter.
|
773
|
+
def formatted_inclusion_location
|
774
|
+
@formatted_inclusion_location ||= begin
|
775
|
+
RSpec.configuration.backtrace_formatter.backtrace_line(
|
776
|
+
inclusion_location.sub(/(:\d+):in .+$/, '\1')
|
777
|
+
)
|
778
|
+
end
|
779
|
+
end
|
780
|
+
|
781
|
+
# @return [String] Description of this stack frame, in the form used by
|
782
|
+
# RSpec's built-in formatters.
|
783
|
+
def description
|
784
|
+
@description ||= "Shared Example Group: #{shared_group_name.inspect} " \
|
785
|
+
"called from #{formatted_inclusion_location}"
|
786
|
+
end
|
787
|
+
|
788
|
+
# @private
|
789
|
+
def self.current_backtrace
|
790
|
+
shared_example_group_inclusions.reverse
|
791
|
+
end
|
792
|
+
|
793
|
+
# @private
|
794
|
+
def self.with_frame(name, location)
|
795
|
+
current_stack = shared_example_group_inclusions
|
796
|
+
if current_stack.any? { |frame| frame.shared_group_name == name }
|
797
|
+
raise ArgumentError, "can't include shared examples recursively"
|
798
|
+
else
|
799
|
+
current_stack << new(name, location)
|
800
|
+
yield
|
801
|
+
end
|
802
|
+
ensure
|
803
|
+
current_stack.pop
|
804
|
+
end
|
805
|
+
|
806
|
+
# @private
|
807
|
+
def self.shared_example_group_inclusions
|
808
|
+
RSpec::Support.thread_local_data[:shared_example_group_inclusions] ||= []
|
809
|
+
end
|
810
|
+
end
|
811
|
+
end
|
812
|
+
|
813
|
+
# @private
|
814
|
+
#
|
815
|
+
# Namespace for the example group subclasses generated by top-level
|
816
|
+
# `describe`.
|
817
|
+
module ExampleGroups
|
818
|
+
extend Support::RecursiveConstMethods
|
819
|
+
|
820
|
+
def self.assign_const(group)
|
821
|
+
base_name = base_name_for(group)
|
822
|
+
const_scope = constant_scope_for(group)
|
823
|
+
name = disambiguate(base_name, const_scope)
|
824
|
+
|
825
|
+
const_scope.const_set(name, group)
|
826
|
+
end
|
827
|
+
|
828
|
+
def self.constant_scope_for(group)
|
829
|
+
const_scope = group.superclass
|
830
|
+
const_scope = self if const_scope == ::RSpec::Core::ExampleGroup
|
831
|
+
const_scope
|
832
|
+
end
|
833
|
+
|
834
|
+
def self.remove_all_constants
|
835
|
+
constants.each do |constant|
|
836
|
+
__send__(:remove_const, constant)
|
837
|
+
end
|
838
|
+
end
|
839
|
+
|
840
|
+
def self.base_name_for(group)
|
841
|
+
return "Anonymous" if group.description.empty?
|
842
|
+
|
843
|
+
# Convert to CamelCase.
|
844
|
+
name = ' ' << group.description
|
845
|
+
name.gsub!(/[^0-9a-zA-Z]+([0-9a-zA-Z])/) do
|
846
|
+
match = ::Regexp.last_match[1]
|
847
|
+
match.upcase!
|
848
|
+
match
|
849
|
+
end
|
850
|
+
|
851
|
+
name.lstrip! # Remove leading whitespace
|
852
|
+
name.gsub!(/\W/, ''.freeze) # JRuby, RBX and others don't like non-ascii in const names
|
853
|
+
|
854
|
+
# Ruby requires first const letter to be A-Z. Use `Nested`
|
855
|
+
# as necessary to enforce that.
|
856
|
+
name.gsub!(/\A([^A-Z]|\z)/, 'Nested\1'.freeze)
|
857
|
+
|
858
|
+
name
|
859
|
+
end
|
860
|
+
|
861
|
+
if RUBY_VERSION == '1.9.2'
|
862
|
+
# :nocov:
|
863
|
+
class << self
|
864
|
+
alias _base_name_for base_name_for
|
865
|
+
def base_name_for(group)
|
866
|
+
_base_name_for(group) + '_'
|
867
|
+
end
|
868
|
+
end
|
869
|
+
private_class_method :_base_name_for
|
870
|
+
# :nocov:
|
871
|
+
end
|
872
|
+
|
873
|
+
def self.disambiguate(name, const_scope)
|
874
|
+
return name unless const_defined_on?(const_scope, name)
|
875
|
+
|
876
|
+
# Add a trailing number if needed to disambiguate from an existing
|
877
|
+
# constant.
|
878
|
+
name << "_2"
|
879
|
+
name.next! while const_defined_on?(const_scope, name)
|
880
|
+
name
|
881
|
+
end
|
882
|
+
end
|
883
|
+
end
|