sublimetheme 1.0.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.
Files changed (276) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +4 -0
  5. data/CODE_OF_CONDUCT.md +13 -0
  6. data/Gemfile +4 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +230 -0
  9. data/Rakefile +8 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +7 -0
  12. data/lib/sublimetheme.rb +6832 -0
  13. data/lib/sublimetheme/version.rb +3 -0
  14. data/path/bin/htmldiff +25 -0
  15. data/path/bin/htmldiff.bat +6 -0
  16. data/path/bin/ldiff +25 -0
  17. data/path/bin/ldiff.bat +6 -0
  18. data/path/bin/rspec +23 -0
  19. data/path/bin/rspec.bat +6 -0
  20. data/path/cache/diff-lcs-1.2.5.gem +0 -0
  21. data/path/cache/rspec-3.3.0.gem +0 -0
  22. data/path/cache/rspec-core-3.3.2.gem +0 -0
  23. data/path/cache/rspec-expectations-3.3.1.gem +0 -0
  24. data/path/cache/rspec-mocks-3.3.2.gem +0 -0
  25. data/path/cache/rspec-support-3.3.0.gem +0 -0
  26. data/path/gems/diff-lcs-1.2.5/.autotest +3 -0
  27. data/path/gems/diff-lcs-1.2.5/.gemtest +0 -0
  28. data/path/gems/diff-lcs-1.2.5/.hoerc +2 -0
  29. data/path/gems/diff-lcs-1.2.5/.rspec +2 -0
  30. data/path/gems/diff-lcs-1.2.5/.travis.yml +22 -0
  31. data/path/gems/diff-lcs-1.2.5/Contributing.rdoc +64 -0
  32. data/path/gems/diff-lcs-1.2.5/Gemfile +20 -0
  33. data/path/gems/diff-lcs-1.2.5/History.rdoc +152 -0
  34. data/path/gems/diff-lcs-1.2.5/License.rdoc +39 -0
  35. data/path/gems/diff-lcs-1.2.5/Manifest.txt +38 -0
  36. data/path/gems/diff-lcs-1.2.5/README.rdoc +85 -0
  37. data/path/gems/diff-lcs-1.2.5/Rakefile +41 -0
  38. data/path/gems/diff-lcs-1.2.5/autotest/discover.rb +1 -0
  39. data/path/gems/diff-lcs-1.2.5/bin/htmldiff +32 -0
  40. data/path/gems/diff-lcs-1.2.5/bin/ldiff +6 -0
  41. data/path/gems/diff-lcs-1.2.5/docs/COPYING.txt +339 -0
  42. data/path/gems/diff-lcs-1.2.5/docs/artistic.txt +127 -0
  43. data/path/gems/diff-lcs-1.2.5/lib/diff-lcs.rb +3 -0
  44. data/path/gems/diff-lcs-1.2.5/lib/diff/lcs.rb +805 -0
  45. data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/array.rb +7 -0
  46. data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/block.rb +37 -0
  47. data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/callbacks.rb +322 -0
  48. data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/change.rb +177 -0
  49. data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/htmldiff.rb +149 -0
  50. data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/hunk.rb +276 -0
  51. data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/internals.rb +301 -0
  52. data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/ldiff.rb +195 -0
  53. data/path/gems/diff-lcs-1.2.5/lib/diff/lcs/string.rb +5 -0
  54. data/path/gems/diff-lcs-1.2.5/spec/change_spec.rb +65 -0
  55. data/path/gems/diff-lcs-1.2.5/spec/diff_spec.rb +47 -0
  56. data/path/gems/diff-lcs-1.2.5/spec/hunk_spec.rb +72 -0
  57. data/path/gems/diff-lcs-1.2.5/spec/issues_spec.rb +24 -0
  58. data/path/gems/diff-lcs-1.2.5/spec/lcs_spec.rb +54 -0
  59. data/path/gems/diff-lcs-1.2.5/spec/patch_spec.rb +414 -0
  60. data/path/gems/diff-lcs-1.2.5/spec/sdiff_spec.rb +214 -0
  61. data/path/gems/diff-lcs-1.2.5/spec/spec_helper.rb +290 -0
  62. data/path/gems/diff-lcs-1.2.5/spec/traverse_balanced_spec.rb +310 -0
  63. data/path/gems/diff-lcs-1.2.5/spec/traverse_sequences_spec.rb +139 -0
  64. data/path/gems/rspec-3.3.0/License.txt +24 -0
  65. data/path/gems/rspec-3.3.0/README.md +34 -0
  66. data/path/gems/rspec-3.3.0/lib/rspec.rb +3 -0
  67. data/path/gems/rspec-3.3.0/lib/rspec/version.rb +5 -0
  68. data/path/gems/rspec-core-3.3.2/.document +5 -0
  69. data/path/gems/rspec-core-3.3.2/.yardopts +8 -0
  70. data/path/gems/rspec-core-3.3.2/Changelog.md +1856 -0
  71. data/path/gems/rspec-core-3.3.2/License.txt +25 -0
  72. data/path/gems/rspec-core-3.3.2/README.md +369 -0
  73. data/path/gems/rspec-core-3.3.2/exe/rspec +4 -0
  74. data/path/gems/rspec-core-3.3.2/lib/rspec/autorun.rb +3 -0
  75. data/path/gems/rspec-core-3.3.2/lib/rspec/core.rb +181 -0
  76. data/path/gems/rspec-core-3.3.2/lib/rspec/core/backtrace_formatter.rb +64 -0
  77. data/path/gems/rspec-core-3.3.2/lib/rspec/core/bisect/coordinator.rb +66 -0
  78. data/path/gems/rspec-core-3.3.2/lib/rspec/core/bisect/example_minimizer.rb +130 -0
  79. data/path/gems/rspec-core-3.3.2/lib/rspec/core/bisect/runner.rb +139 -0
  80. data/path/gems/rspec-core-3.3.2/lib/rspec/core/bisect/server.rb +61 -0
  81. data/path/gems/rspec-core-3.3.2/lib/rspec/core/bisect/subset_enumerator.rb +39 -0
  82. data/path/gems/rspec-core-3.3.2/lib/rspec/core/configuration.rb +1807 -0
  83. data/path/gems/rspec-core-3.3.2/lib/rspec/core/configuration_options.rb +191 -0
  84. data/path/gems/rspec-core-3.3.2/lib/rspec/core/drb.rb +111 -0
  85. data/path/gems/rspec-core-3.3.2/lib/rspec/core/dsl.rb +96 -0
  86. data/path/gems/rspec-core-3.3.2/lib/rspec/core/example.rb +573 -0
  87. data/path/gems/rspec-core-3.3.2/lib/rspec/core/example_group.rb +796 -0
  88. data/path/gems/rspec-core-3.3.2/lib/rspec/core/example_status_persister.rb +235 -0
  89. data/path/gems/rspec-core-3.3.2/lib/rspec/core/filter_manager.rb +231 -0
  90. data/path/gems/rspec-core-3.3.2/lib/rspec/core/flat_map.rb +20 -0
  91. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters.rb +254 -0
  92. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/base_formatter.rb +70 -0
  93. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/base_text_formatter.rb +77 -0
  94. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/bisect_formatter.rb +68 -0
  95. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/bisect_progress_formatter.rb +115 -0
  96. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/console_codes.rb +65 -0
  97. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/deprecation_formatter.rb +223 -0
  98. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/documentation_formatter.rb +70 -0
  99. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/exception_presenter.rb +393 -0
  100. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/fallback_message_formatter.rb +28 -0
  101. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/helpers.rb +109 -0
  102. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/html_formatter.rb +151 -0
  103. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/html_printer.rb +415 -0
  104. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/json_formatter.rb +96 -0
  105. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/profile_formatter.rb +68 -0
  106. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/progress_formatter.rb +28 -0
  107. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/protocol.rb +172 -0
  108. data/path/gems/rspec-core-3.3.2/lib/rspec/core/formatters/snippet_extractor.rb +116 -0
  109. data/path/gems/rspec-core-3.3.2/lib/rspec/core/hooks.rb +638 -0
  110. data/path/gems/rspec-core-3.3.2/lib/rspec/core/memoized_helpers.rb +532 -0
  111. data/path/gems/rspec-core-3.3.2/lib/rspec/core/metadata.rb +490 -0
  112. data/path/gems/rspec-core-3.3.2/lib/rspec/core/metadata_filter.rb +235 -0
  113. data/path/gems/rspec-core-3.3.2/lib/rspec/core/minitest_assertions_adapter.rb +31 -0
  114. data/path/gems/rspec-core-3.3.2/lib/rspec/core/mocking_adapters/flexmock.rb +31 -0
  115. data/path/gems/rspec-core-3.3.2/lib/rspec/core/mocking_adapters/mocha.rb +57 -0
  116. data/path/gems/rspec-core-3.3.2/lib/rspec/core/mocking_adapters/null.rb +14 -0
  117. data/path/gems/rspec-core-3.3.2/lib/rspec/core/mocking_adapters/rr.rb +31 -0
  118. data/path/gems/rspec-core-3.3.2/lib/rspec/core/mocking_adapters/rspec.rb +32 -0
  119. data/path/gems/rspec-core-3.3.2/lib/rspec/core/mutex.rb +63 -0
  120. data/path/gems/rspec-core-3.3.2/lib/rspec/core/notifications.rb +498 -0
  121. data/path/gems/rspec-core-3.3.2/lib/rspec/core/option_parser.rb +301 -0
  122. data/path/gems/rspec-core-3.3.2/lib/rspec/core/ordering.rb +158 -0
  123. data/path/gems/rspec-core-3.3.2/lib/rspec/core/pending.rb +165 -0
  124. data/path/gems/rspec-core-3.3.2/lib/rspec/core/profiler.rb +32 -0
  125. data/path/gems/rspec-core-3.3.2/lib/rspec/core/project_initializer.rb +48 -0
  126. data/path/gems/rspec-core-3.3.2/lib/rspec/core/project_initializer/.rspec +2 -0
  127. data/path/gems/rspec-core-3.3.2/lib/rspec/core/project_initializer/spec/spec_helper.rb +96 -0
  128. data/path/gems/rspec-core-3.3.2/lib/rspec/core/rake_task.rb +158 -0
  129. data/path/gems/rspec-core-3.3.2/lib/rspec/core/reentrant_mutex.rb +52 -0
  130. data/path/gems/rspec-core-3.3.2/lib/rspec/core/reporter.rb +220 -0
  131. data/path/gems/rspec-core-3.3.2/lib/rspec/core/ruby_project.rb +53 -0
  132. data/path/gems/rspec-core-3.3.2/lib/rspec/core/runner.rb +179 -0
  133. data/path/gems/rspec-core-3.3.2/lib/rspec/core/sandbox.rb +37 -0
  134. data/path/gems/rspec-core-3.3.2/lib/rspec/core/set.rb +49 -0
  135. data/path/gems/rspec-core-3.3.2/lib/rspec/core/shared_context.rb +55 -0
  136. data/path/gems/rspec-core-3.3.2/lib/rspec/core/shared_example_group.rb +210 -0
  137. data/path/gems/rspec-core-3.3.2/lib/rspec/core/shell_escape.rb +49 -0
  138. data/path/gems/rspec-core-3.3.2/lib/rspec/core/test_unit_assertions_adapter.rb +30 -0
  139. data/path/gems/rspec-core-3.3.2/lib/rspec/core/version.rb +9 -0
  140. data/path/gems/rspec-core-3.3.2/lib/rspec/core/warnings.rb +40 -0
  141. data/path/gems/rspec-core-3.3.2/lib/rspec/core/world.rb +178 -0
  142. data/path/gems/rspec-expectations-3.3.1/.document +5 -0
  143. data/path/gems/rspec-expectations-3.3.1/.yardopts +6 -0
  144. data/path/gems/rspec-expectations-3.3.1/Changelog.md +953 -0
  145. data/path/gems/rspec-expectations-3.3.1/License.txt +24 -0
  146. data/path/gems/rspec-expectations-3.3.1/README.md +289 -0
  147. data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations.rb +81 -0
  148. data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations/configuration.rb +164 -0
  149. data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations/expectation_target.rb +113 -0
  150. data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations/fail_with.rb +31 -0
  151. data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations/failure_aggregator.rb +194 -0
  152. data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations/handler.rb +170 -0
  153. data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations/minitest_integration.rb +31 -0
  154. data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations/syntax.rb +132 -0
  155. data/path/gems/rspec-expectations-3.3.1/lib/rspec/expectations/version.rb +8 -0
  156. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers.rb +1009 -0
  157. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/aliased_matcher.rb +116 -0
  158. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in.rb +52 -0
  159. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/all.rb +85 -0
  160. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/base_matcher.rb +181 -0
  161. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/be.rb +285 -0
  162. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/be_between.rb +77 -0
  163. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/be_instance_of.rb +22 -0
  164. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/be_kind_of.rb +16 -0
  165. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/be_within.rb +72 -0
  166. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/change.rb +337 -0
  167. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/compound.rb +293 -0
  168. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/contain_exactly.rb +253 -0
  169. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/cover.rb +24 -0
  170. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/eq.rb +40 -0
  171. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/eql.rb +34 -0
  172. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/equal.rb +81 -0
  173. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/exist.rb +86 -0
  174. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/has.rb +103 -0
  175. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/have_attributes.rb +114 -0
  176. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/include.rb +130 -0
  177. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/match.rb +37 -0
  178. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/operators.rb +128 -0
  179. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/output.rb +200 -0
  180. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/raise_error.rb +216 -0
  181. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/respond_to.rb +90 -0
  182. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/satisfy.rb +37 -0
  183. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/start_or_end_with.rb +94 -0
  184. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/throw_symbol.rb +132 -0
  185. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/built_in/yield.rb +418 -0
  186. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/composable.rb +184 -0
  187. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/dsl.rb +453 -0
  188. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/english_phrasing.rb +42 -0
  189. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/expecteds_for_multiple_diffs.rb +73 -0
  190. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/fail_matchers.rb +42 -0
  191. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/generated_descriptions.rb +42 -0
  192. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/matcher_delegator.rb +35 -0
  193. data/path/gems/rspec-expectations-3.3.1/lib/rspec/matchers/matcher_protocol.rb +99 -0
  194. data/path/gems/rspec-mocks-3.3.2/.document +5 -0
  195. data/path/gems/rspec-mocks-3.3.2/.yardopts +6 -0
  196. data/path/gems/rspec-mocks-3.3.2/Changelog.md +965 -0
  197. data/path/gems/rspec-mocks-3.3.2/License.txt +24 -0
  198. data/path/gems/rspec-mocks-3.3.2/README.md +430 -0
  199. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks.rb +126 -0
  200. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance.rb +11 -0
  201. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/chain.rb +110 -0
  202. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/error_generator.rb +31 -0
  203. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/expect_chain_chain.rb +35 -0
  204. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/expectation_chain.rb +48 -0
  205. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/message_chains.rb +83 -0
  206. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/proxy.rb +116 -0
  207. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/recorder.rb +264 -0
  208. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/stub_chain.rb +46 -0
  209. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/any_instance/stub_chain_chain.rb +27 -0
  210. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/argument_list_matcher.rb +100 -0
  211. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/argument_matchers.rb +320 -0
  212. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/configuration.rb +188 -0
  213. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/error_generator.rb +362 -0
  214. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/example_methods.rb +421 -0
  215. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/instance_method_stasher.rb +135 -0
  216. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/marshal_extension.rb +41 -0
  217. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/matchers/expectation_customization.rb +20 -0
  218. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/matchers/have_received.rb +116 -0
  219. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/matchers/receive.rb +130 -0
  220. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/matchers/receive_message_chain.rb +80 -0
  221. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/matchers/receive_messages.rb +75 -0
  222. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/message_chain.rb +87 -0
  223. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/message_expectation.rb +717 -0
  224. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/method_double.rb +287 -0
  225. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/method_reference.rb +192 -0
  226. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/mutate_const.rb +335 -0
  227. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/mutex.rb +73 -0
  228. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/object_reference.rb +149 -0
  229. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/order_group.rb +81 -0
  230. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/proxy.rb +439 -0
  231. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/reentrant_mutex.rb +53 -0
  232. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/space.rb +238 -0
  233. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/standalone.rb +3 -0
  234. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/syntax.rb +325 -0
  235. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/targets.rb +97 -0
  236. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/test_double.rb +170 -0
  237. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/verifying_double.rb +129 -0
  238. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/verifying_message_expecation.rb +54 -0
  239. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/verifying_proxy.rb +213 -0
  240. data/path/gems/rspec-mocks-3.3.2/lib/rspec/mocks/version.rb +9 -0
  241. data/path/gems/rspec-support-3.3.0/Changelog.md +125 -0
  242. data/path/gems/rspec-support-3.3.0/LICENSE.txt +22 -0
  243. data/path/gems/rspec-support-3.3.0/README.md +26 -0
  244. data/path/gems/rspec-support-3.3.0/lib/rspec/support.rb +111 -0
  245. data/path/gems/rspec-support-3.3.0/lib/rspec/support/caller_filter.rb +83 -0
  246. data/path/gems/rspec-support-3.3.0/lib/rspec/support/differ.rb +215 -0
  247. data/path/gems/rspec-support-3.3.0/lib/rspec/support/directory_maker.rb +63 -0
  248. data/path/gems/rspec-support-3.3.0/lib/rspec/support/encoded_string.rb +155 -0
  249. data/path/gems/rspec-support-3.3.0/lib/rspec/support/fuzzy_matcher.rb +48 -0
  250. data/path/gems/rspec-support-3.3.0/lib/rspec/support/hunk_generator.rb +47 -0
  251. data/path/gems/rspec-support-3.3.0/lib/rspec/support/matcher_definition.rb +42 -0
  252. data/path/gems/rspec-support-3.3.0/lib/rspec/support/method_signature_verifier.rb +273 -0
  253. data/path/gems/rspec-support-3.3.0/lib/rspec/support/object_formatter.rb +93 -0
  254. data/path/gems/rspec-support-3.3.0/lib/rspec/support/recursive_const_methods.rb +76 -0
  255. data/path/gems/rspec-support-3.3.0/lib/rspec/support/ruby_features.rb +118 -0
  256. data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec.rb +81 -0
  257. data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/deprecation_helpers.rb +64 -0
  258. data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/formatting_support.rb +9 -0
  259. data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/in_sub_process.rb +52 -0
  260. data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/library_wide_checks.rb +145 -0
  261. data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/shell_out.rb +71 -0
  262. data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/stderr_splitter.rb +63 -0
  263. data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/string_matcher.rb +46 -0
  264. data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/with_isolated_directory.rb +9 -0
  265. data/path/gems/rspec-support-3.3.0/lib/rspec/support/spec/with_isolated_stderr.rb +13 -0
  266. data/path/gems/rspec-support-3.3.0/lib/rspec/support/version.rb +7 -0
  267. data/path/gems/rspec-support-3.3.0/lib/rspec/support/version_checker.rb +53 -0
  268. data/path/gems/rspec-support-3.3.0/lib/rspec/support/warnings.rb +39 -0
  269. data/path/specifications/diff-lcs-1.2.5.gemspec +68 -0
  270. data/path/specifications/rspec-3.3.0.gemspec +42 -0
  271. data/path/specifications/rspec-core-3.3.2.gemspec +68 -0
  272. data/path/specifications/rspec-expectations-3.3.1.gemspec +50 -0
  273. data/path/specifications/rspec-mocks-3.3.2.gemspec +53 -0
  274. data/path/specifications/rspec-support-3.3.0.gemspec +38 -0
  275. data/sublimetheme.gemspec +32 -0
  276. metadata +363 -0
@@ -0,0 +1,335 @@
1
+ RSpec::Support.require_rspec_support 'recursive_const_methods'
2
+
3
+ module RSpec
4
+ module Mocks
5
+ # Provides information about constants that may (or may not)
6
+ # have been mutated by rspec-mocks.
7
+ class Constant
8
+ extend Support::RecursiveConstMethods
9
+
10
+ # @api private
11
+ def initialize(name)
12
+ @name = name
13
+ @previously_defined = false
14
+ @stubbed = false
15
+ @hidden = false
16
+ @valid_name = true
17
+ yield self if block_given?
18
+ end
19
+
20
+ # @return [String] The fully qualified name of the constant.
21
+ attr_reader :name
22
+
23
+ # @return [Object, nil] The original value (e.g. before it
24
+ # was mutated by rspec-mocks) of the constant, or
25
+ # nil if the constant was not previously defined.
26
+ attr_accessor :original_value
27
+
28
+ # @private
29
+ attr_writer :previously_defined, :stubbed, :hidden, :valid_name
30
+
31
+ # @return [Boolean] Whether or not the constant was defined
32
+ # before the current example.
33
+ def previously_defined?
34
+ @previously_defined
35
+ end
36
+
37
+ # @return [Boolean] Whether or not rspec-mocks has mutated
38
+ # (stubbed or hidden) this constant.
39
+ def mutated?
40
+ @stubbed || @hidden
41
+ end
42
+
43
+ # @return [Boolean] Whether or not rspec-mocks has stubbed
44
+ # this constant.
45
+ def stubbed?
46
+ @stubbed
47
+ end
48
+
49
+ # @return [Boolean] Whether or not rspec-mocks has hidden
50
+ # this constant.
51
+ def hidden?
52
+ @hidden
53
+ end
54
+
55
+ # @return [Boolean] Whether or not the provided constant name
56
+ # is a valid Ruby constant name.
57
+ def valid_name?
58
+ @valid_name
59
+ end
60
+
61
+ # The default `to_s` isn't very useful, so a custom version is provided.
62
+ def to_s
63
+ "#<#{self.class.name} #{name}>"
64
+ end
65
+ alias inspect to_s
66
+
67
+ # @private
68
+ def self.unmutated(name)
69
+ previously_defined = recursive_const_defined?(name)
70
+ rescue NameError
71
+ new(name) do |c|
72
+ c.valid_name = false
73
+ end
74
+ else
75
+ new(name) do |const|
76
+ const.previously_defined = previously_defined
77
+ const.original_value = recursive_const_get(name) if previously_defined
78
+ end
79
+ end
80
+
81
+ # Queries rspec-mocks to find out information about the named constant.
82
+ #
83
+ # @param [String] name the name of the constant
84
+ # @return [Constant] an object contaning information about the named
85
+ # constant.
86
+ def self.original(name)
87
+ mutator = ::RSpec::Mocks.space.constant_mutator_for(name)
88
+ mutator ? mutator.to_constant : unmutated(name)
89
+ end
90
+ end
91
+
92
+ # Provides a means to stub constants.
93
+ class ConstantMutator
94
+ extend Support::RecursiveConstMethods
95
+
96
+ # Stubs a constant.
97
+ #
98
+ # @param (see ExampleMethods#stub_const)
99
+ # @option (see ExampleMethods#stub_const)
100
+ # @return (see ExampleMethods#stub_const)
101
+ #
102
+ # @see ExampleMethods#stub_const
103
+ # @note It's recommended that you use `stub_const` in your
104
+ # examples. This is an alternate public API that is provided
105
+ # so you can stub constants in other contexts (e.g. helper
106
+ # classes).
107
+ def self.stub(constant_name, value, options={})
108
+ mutator = if recursive_const_defined?(constant_name, &raise_on_invalid_const)
109
+ DefinedConstantReplacer
110
+ else
111
+ UndefinedConstantSetter
112
+ end
113
+
114
+ mutate(mutator.new(constant_name, value, options[:transfer_nested_constants]))
115
+ value
116
+ end
117
+
118
+ # Hides a constant.
119
+ #
120
+ # @param (see ExampleMethods#hide_const)
121
+ #
122
+ # @see ExampleMethods#hide_const
123
+ # @note It's recommended that you use `hide_const` in your
124
+ # examples. This is an alternate public API that is provided
125
+ # so you can hide constants in other contexts (e.g. helper
126
+ # classes).
127
+ def self.hide(constant_name)
128
+ mutate(ConstantHider.new(constant_name, nil, {}))
129
+ nil
130
+ end
131
+
132
+ # Contains common functionality used by all of the constant mutators.
133
+ #
134
+ # @private
135
+ class BaseMutator
136
+ include Support::RecursiveConstMethods
137
+
138
+ attr_reader :original_value, :full_constant_name
139
+
140
+ def initialize(full_constant_name, mutated_value, transfer_nested_constants)
141
+ @full_constant_name = normalize_const_name(full_constant_name)
142
+ @mutated_value = mutated_value
143
+ @transfer_nested_constants = transfer_nested_constants
144
+ @context_parts = @full_constant_name.split('::')
145
+ @const_name = @context_parts.pop
146
+ @reset_performed = false
147
+ end
148
+
149
+ def to_constant
150
+ const = Constant.new(full_constant_name)
151
+ const.original_value = original_value
152
+
153
+ const
154
+ end
155
+
156
+ def idempotently_reset
157
+ reset unless @reset_performed
158
+ @reset_performed = true
159
+ end
160
+ end
161
+
162
+ # Hides a defined constant for the duration of an example.
163
+ #
164
+ # @private
165
+ class ConstantHider < BaseMutator
166
+ def mutate
167
+ return unless (@defined = recursive_const_defined?(full_constant_name))
168
+ @context = recursive_const_get(@context_parts.join('::'))
169
+ @original_value = get_const_defined_on(@context, @const_name)
170
+
171
+ @context.__send__(:remove_const, @const_name)
172
+ end
173
+
174
+ def to_constant
175
+ return Constant.unmutated(full_constant_name) unless @defined
176
+
177
+ const = super
178
+ const.hidden = true
179
+ const.previously_defined = true
180
+
181
+ const
182
+ end
183
+
184
+ def reset
185
+ return unless @defined
186
+ @context.const_set(@const_name, @original_value)
187
+ end
188
+ end
189
+
190
+ # Replaces a defined constant for the duration of an example.
191
+ #
192
+ # @private
193
+ class DefinedConstantReplacer < BaseMutator
194
+ def initialize(*args)
195
+ super
196
+ @constants_to_transfer = []
197
+ end
198
+
199
+ def mutate
200
+ @context = recursive_const_get(@context_parts.join('::'))
201
+ @original_value = get_const_defined_on(@context, @const_name)
202
+
203
+ @constants_to_transfer = verify_constants_to_transfer!
204
+
205
+ @context.__send__(:remove_const, @const_name)
206
+ @context.const_set(@const_name, @mutated_value)
207
+
208
+ transfer_nested_constants
209
+ end
210
+
211
+ def to_constant
212
+ const = super
213
+ const.stubbed = true
214
+ const.previously_defined = true
215
+
216
+ const
217
+ end
218
+
219
+ def reset
220
+ @constants_to_transfer.each do |const|
221
+ @mutated_value.__send__(:remove_const, const)
222
+ end
223
+
224
+ @context.__send__(:remove_const, @const_name)
225
+ @context.const_set(@const_name, @original_value)
226
+ end
227
+
228
+ def transfer_nested_constants
229
+ @constants_to_transfer.each do |const|
230
+ @mutated_value.const_set(const, get_const_defined_on(original_value, const))
231
+ end
232
+ end
233
+
234
+ def verify_constants_to_transfer!
235
+ return [] unless should_transfer_nested_constants?
236
+
237
+ { @original_value => "the original value", @mutated_value => "the stubbed value" }.each do |value, description|
238
+ next if value.respond_to?(:constants)
239
+
240
+ raise ArgumentError,
241
+ "Cannot transfer nested constants for #{@full_constant_name} " \
242
+ "since #{description} is not a class or module and only classes " \
243
+ "and modules support nested constants."
244
+ end
245
+
246
+ if Array === @transfer_nested_constants
247
+ @transfer_nested_constants = @transfer_nested_constants.map(&:to_s) if RUBY_VERSION == '1.8.7'
248
+ undefined_constants = @transfer_nested_constants - constants_defined_on(@original_value)
249
+
250
+ if undefined_constants.any?
251
+ available_constants = constants_defined_on(@original_value) - @transfer_nested_constants
252
+ raise ArgumentError,
253
+ "Cannot transfer nested constant(s) #{undefined_constants.join(' and ')} " \
254
+ "for #{@full_constant_name} since they are not defined. Did you mean " \
255
+ "#{available_constants.join(' or ')}?"
256
+ end
257
+
258
+ @transfer_nested_constants
259
+ else
260
+ constants_defined_on(@original_value)
261
+ end
262
+ end
263
+
264
+ def should_transfer_nested_constants?
265
+ return true if @transfer_nested_constants
266
+ return false unless RSpec::Mocks.configuration.transfer_nested_constants?
267
+ @original_value.respond_to?(:constants) && @mutated_value.respond_to?(:constants)
268
+ end
269
+ end
270
+
271
+ # Sets an undefined constant for the duration of an example.
272
+ #
273
+ # @private
274
+ class UndefinedConstantSetter < BaseMutator
275
+ def mutate
276
+ @parent = @context_parts.inject(Object) do |klass, name|
277
+ if const_defined_on?(klass, name)
278
+ get_const_defined_on(klass, name)
279
+ else
280
+ ConstantMutator.stub(name_for(klass, name), Module.new)
281
+ end
282
+ end
283
+
284
+ @parent.const_set(@const_name, @mutated_value)
285
+ end
286
+
287
+ def to_constant
288
+ const = super
289
+ const.stubbed = true
290
+ const.previously_defined = false
291
+
292
+ const
293
+ end
294
+
295
+ def reset
296
+ @parent.__send__(:remove_const, @const_name)
297
+ end
298
+
299
+ private
300
+
301
+ def name_for(parent, name)
302
+ root = if parent == Object
303
+ ''
304
+ else
305
+ parent.name
306
+ end
307
+ root + '::' + name
308
+ end
309
+ end
310
+
311
+ # Uses the mutator to mutate (stub or hide) a constant. Ensures that
312
+ # the mutator is correctly registered so it can be backed out at the end
313
+ # of the test.
314
+ #
315
+ # @private
316
+ def self.mutate(mutator)
317
+ ::RSpec::Mocks.space.register_constant_mutator(mutator)
318
+ mutator.mutate
319
+ end
320
+
321
+ # Used internally by the constant stubbing to raise a helpful
322
+ # error when a constant like "A::B::C" is stubbed and A::B is
323
+ # not a module (and thus, it's impossible to define "A::B::C"
324
+ # since only modules can have nested constants).
325
+ #
326
+ # @api private
327
+ def self.raise_on_invalid_const
328
+ lambda do |const_name, failed_name|
329
+ raise "Cannot stub constant #{failed_name} on #{const_name} " \
330
+ "since #{const_name} is not a module."
331
+ end
332
+ end
333
+ end
334
+ end
335
+ end
@@ -0,0 +1,73 @@
1
+ module RSpec
2
+ module Mocks
3
+ # On 1.8.7, it's in the stdlib.
4
+ # We don't want to load the stdlib, b/c this is a test tool, and can affect
5
+ # the test environment, causing tests to pass where they should fail.
6
+ #
7
+ # So we're transcribing/modifying it from
8
+ # https://github.com/ruby/ruby/blob/v1_8_7_374/lib/thread.rb#L56
9
+ # Some methods we don't need are deleted. Anything I don't
10
+ # understand (there's quite a bit, actually) is left in.
11
+ #
12
+ # Some formating changes are made to appease the robot overlord:
13
+ # https://travis-ci.org/rspec/rspec-core/jobs/54410874
14
+ # @private
15
+ class Mutex
16
+ def initialize
17
+ @waiting = []
18
+ @locked = false
19
+ @waiting.taint
20
+ taint
21
+ end
22
+
23
+ # @private
24
+ def lock
25
+ while Thread.critical = true && @locked
26
+ @waiting.push Thread.current
27
+ Thread.stop
28
+ end
29
+ @locked = true
30
+ Thread.critical = false
31
+ self
32
+ end
33
+
34
+ # @private
35
+ def unlock
36
+ return unless @locked
37
+ Thread.critical = true
38
+ @locked = false
39
+ wakeup_and_run_waiting_thread
40
+ self
41
+ end
42
+
43
+ # @private
44
+ def synchronize
45
+ lock
46
+ begin
47
+ yield
48
+ ensure
49
+ unlock
50
+ end
51
+ end
52
+
53
+ private
54
+
55
+ def wakeup_and_run_waiting_thread
56
+ begin
57
+ t = @waiting.shift
58
+ t.wakeup if t
59
+ rescue ThreadError
60
+ retry
61
+ end
62
+ Thread.critical = false
63
+ begin
64
+ t.run if t
65
+ rescue ThreadError
66
+ :noop
67
+ end
68
+ end
69
+
70
+ # Avoid warnings for library wide checks spec
71
+ end unless defined?(::RSpec::Mocks::Mutex) || defined?(::Mutex)
72
+ end
73
+ end
@@ -0,0 +1,149 @@
1
+ module RSpec
2
+ module Mocks
3
+ # @private
4
+ class ObjectReference
5
+ # Returns an appropriate Object or Module reference based
6
+ # on the given argument.
7
+ def self.for(object_module_or_name, allow_direct_object_refs=false)
8
+ case object_module_or_name
9
+ when Module
10
+ if anonymous_module?(object_module_or_name)
11
+ DirectObjectReference.new(object_module_or_name)
12
+ else
13
+ # Use a `NamedObjectReference` if it has a name because this
14
+ # will use the original value of the constant in case it has
15
+ # been stubbed.
16
+ NamedObjectReference.new(name_of(object_module_or_name))
17
+ end
18
+ when String
19
+ NamedObjectReference.new(object_module_or_name)
20
+ else
21
+ if allow_direct_object_refs
22
+ DirectObjectReference.new(object_module_or_name)
23
+ else
24
+ raise ArgumentError,
25
+ "Module or String expected, got #{object_module_or_name.inspect}"
26
+ end
27
+ end
28
+ end
29
+
30
+ if Module.new.name.nil?
31
+ def self.anonymous_module?(mod)
32
+ !name_of(mod)
33
+ end
34
+ else # 1.8.7
35
+ def self.anonymous_module?(mod)
36
+ name_of(mod) == ""
37
+ end
38
+ end
39
+ private_class_method :anonymous_module?
40
+
41
+ def self.name_of(mod)
42
+ MODULE_NAME_METHOD.bind(mod).call
43
+ end
44
+ private_class_method :name_of
45
+
46
+ # @private
47
+ MODULE_NAME_METHOD = Module.instance_method(:name)
48
+ end
49
+
50
+ # An implementation of rspec-mocks' reference interface.
51
+ # Used when an object is passed to {ExampleMethods#object_double}, or
52
+ # an anonymous class or module is passed to {ExampleMethods#instance_double}
53
+ # or {ExampleMethods#class_double}.
54
+ # Represents a reference to that object.
55
+ # @see NamedObjectReference
56
+ class DirectObjectReference
57
+ # @param object [Object] the object to which this refers
58
+ def initialize(object)
59
+ @object = object
60
+ end
61
+
62
+ # @return [String] the object's description (via `#inspect`).
63
+ def description
64
+ @object.inspect
65
+ end
66
+
67
+ # Defined for interface parity with the other object reference
68
+ # implementations. Raises an `ArgumentError` to indicate that `as_stubbed_const`
69
+ # is invalid when passing an object argument to `object_double`.
70
+ def const_to_replace
71
+ raise ArgumentError,
72
+ "Can not perform constant replacement with an anonymous object."
73
+ end
74
+
75
+ # The target of the verifying double (the object itself).
76
+ #
77
+ # @return [Object]
78
+ def target
79
+ @object
80
+ end
81
+
82
+ # Always returns true for an object as the class is defined.
83
+ #
84
+ # @return [true]
85
+ def defined?
86
+ true
87
+ end
88
+
89
+ # Yields if the reference target is loaded, providing a generic mechanism
90
+ # to optionally run a bit of code only when a reference's target is
91
+ # loaded.
92
+ #
93
+ # This specific implementation always yields because direct references
94
+ # are always loaded.
95
+ #
96
+ # @yield [Object] the target of this reference.
97
+ def when_loaded
98
+ yield @object
99
+ end
100
+ end
101
+
102
+ # An implementation of rspec-mocks' reference interface.
103
+ # Used when a string is passed to {ExampleMethods#object_double},
104
+ # and when a string, named class or named module is passed to
105
+ # {ExampleMethods#instance_double}, or {ExampleMethods#class_double}.
106
+ # Represents a reference to the object named (via a constant lookup)
107
+ # by the string.
108
+ # @see DirectObjectReference
109
+ class NamedObjectReference
110
+ # @param const_name [String] constant name
111
+ def initialize(const_name)
112
+ @const_name = const_name
113
+ end
114
+
115
+ # @return [Boolean] true if the named constant is defined, false otherwise.
116
+ def defined?
117
+ !!object
118
+ end
119
+
120
+ # @return [String] the constant name to replace with a double.
121
+ def const_to_replace
122
+ @const_name
123
+ end
124
+ alias description const_to_replace
125
+
126
+ # @return [Object, nil] the target of the verifying double (the named object), or
127
+ # nil if it is not defined.
128
+ def target
129
+ object
130
+ end
131
+
132
+ # Yields if the reference target is loaded, providing a generic mechanism
133
+ # to optionally run a bit of code only when a reference's target is
134
+ # loaded.
135
+ #
136
+ # @yield [Object] the target object
137
+ def when_loaded
138
+ yield object if object
139
+ end
140
+
141
+ private
142
+
143
+ def object
144
+ return @object if defined?(@object)
145
+ @object = Constant.original(@const_name).original_value
146
+ end
147
+ end
148
+ end
149
+ end