rspec 1.2.8 → 1.2.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (238) hide show
  1. data/History.rdoc +41 -2
  2. data/Manifest.txt +11 -10
  3. data/Rakefile +47 -22
  4. data/Ruby1.9.rdoc +1 -2
  5. data/Upgrade.rdoc +56 -7
  6. data/bin/spec +2 -1
  7. data/cucumber.yml +3 -1
  8. data/examples/failing/README.txt +7 -3
  9. data/examples/failing/failing_implicit_docstrings_example.rb +0 -2
  10. data/examples/failing/mocking_example.rb +0 -2
  11. data/examples/failing/partial_mock_example.rb +0 -2
  12. data/examples/failing/pending_example.rb +0 -2
  13. data/examples/failing/predicate_example.rb +0 -2
  14. data/examples/failing/team_spec.rb +0 -3
  15. data/examples/failing/timeout_behaviour.rb +0 -2
  16. data/examples/passing/custom_formatter.rb +0 -1
  17. data/examples/passing/dynamic_spec.rb +0 -2
  18. data/examples/passing/file_accessor.rb +1 -2
  19. data/examples/passing/file_accessor_spec.rb +1 -2
  20. data/examples/passing/filtered_formatter.rb +0 -1
  21. data/examples/passing/greeter_spec.rb +0 -1
  22. data/examples/passing/helper_method_example.rb +0 -2
  23. data/examples/passing/implicit_docstrings_example.rb +0 -2
  24. data/examples/passing/io_processor_spec.rb +1 -2
  25. data/examples/passing/mocking_example.rb +0 -2
  26. data/examples/passing/nested_classes_example.rb +1 -2
  27. data/examples/passing/options_example.rb +0 -2
  28. data/examples/passing/partial_mock_example.rb +0 -2
  29. data/examples/passing/pending_example.rb +0 -2
  30. data/examples/passing/predicate_example.rb +0 -2
  31. data/examples/passing/shared_example_group_example.rb +0 -2
  32. data/examples/passing/simple_matcher_example.rb +0 -2
  33. data/examples/passing/stack_spec.rb +2 -3
  34. data/examples/passing/stack_spec_with_nested_example_groups.rb +2 -3
  35. data/examples/passing/stubbing_example.rb +0 -2
  36. data/examples/passing/yielding_example.rb +0 -2
  37. data/features/before_and_after_blocks/before_and_after_blocks.feature +4 -4
  38. data/features/command_line/line_number_option.feature +14 -14
  39. data/features/command_line/line_number_option_with_example_with_no_name.feature +2 -2
  40. data/features/example_groups/define_example_attribute.feature +41 -0
  41. data/features/example_groups/example_group_with_should_methods.feature +1 -1
  42. data/features/example_groups/implicit_docstrings.feature +7 -7
  43. data/features/example_groups/nested_groups.feature +2 -2
  44. data/features/expectations/customized_message.feature +4 -4
  45. data/features/expectations/expect_change.feature +4 -4
  46. data/features/expectations/expect_error.feature +4 -4
  47. data/features/extensions/custom_example_group.feature +10 -10
  48. data/features/formatters/custom_formatter.feature +3 -3
  49. data/features/interop/examples_and_tests_together.feature +10 -6
  50. data/features/interop/rspec_output.feature +1 -1
  51. data/features/interop/test_case_with_should_methods.feature +1 -1
  52. data/features/load_paths/add_lib_to_load_path.feature +20 -0
  53. data/features/load_paths/add_spec_to_load_path.feature +20 -0
  54. data/features/matchers/define_diffable_matcher.feature +2 -2
  55. data/features/matchers/define_matcher.feature +19 -19
  56. data/features/matchers/define_matcher_outside_rspec.feature +2 -3
  57. data/features/matchers/define_matcher_with_fluent_interface.feature +2 -2
  58. data/features/matchers/define_wrapped_matcher.feature +29 -0
  59. data/features/mock_framework_integration/use_flexmock.feature +1 -1
  60. data/features/mock_framework_integration/use_mocha.feature +1 -1
  61. data/features/mock_framework_integration/use_rr.feature +1 -1
  62. data/features/mocks/mix_stubs_and_mocks.feature +2 -2
  63. data/features/mocks/stub_implementation.feature +1 -1
  64. data/features/pending/pending_examples.feature +16 -16
  65. data/features/runner/specify_line_number.feature +4 -4
  66. data/features/spec_helper/spec_helper.feature +25 -0
  67. data/features/step_definitions/running_rspec_steps.rb +4 -2
  68. data/features/subject/explicit_subject.feature +2 -2
  69. data/features/subject/implicit_subject.feature +14 -2
  70. data/features/support/env.rb +6 -3
  71. data/lib/spec/adapters/mock_frameworks/mocha.rb +6 -1
  72. data/lib/spec/example/example_group_methods.rb +7 -0
  73. data/lib/spec/example/example_methods.rb +1 -1
  74. data/lib/spec/example/subject.rb +8 -0
  75. data/lib/spec/interop/test.rb +27 -1
  76. data/lib/spec/interop/test/unit/testcase.rb +1 -1
  77. data/lib/spec/matchers/exist.rb +2 -2
  78. data/lib/spec/matchers/extensions/instance_exec.rb +28 -20
  79. data/lib/spec/matchers/matcher.rb +21 -20
  80. data/lib/spec/mocks/argument_matchers.rb +17 -13
  81. data/lib/spec/mocks/error_generator.rb +14 -3
  82. data/lib/spec/mocks/{spec_methods.rb → example_methods.rb} +25 -11
  83. data/lib/spec/mocks/framework.rb +1 -1
  84. data/lib/spec/mocks/methods.rb +15 -0
  85. data/lib/spec/mocks/mock.rb +16 -10
  86. data/lib/spec/mocks/proxy.rb +1 -1
  87. data/lib/spec/rake/spectask.rb +3 -3
  88. data/lib/spec/runner/backtrace_tweaker.rb +41 -22
  89. data/lib/spec/runner/configuration.rb +18 -1
  90. data/lib/spec/runner/differs/default.rb +1 -1
  91. data/lib/spec/runner/drb_command_line.rb +5 -2
  92. data/lib/spec/runner/formatter/base_text_formatter.rb +8 -3
  93. data/lib/spec/runner/option_parser.rb +21 -15
  94. data/lib/spec/runner/options.rb +54 -23
  95. data/lib/spec/version.rb +3 -3
  96. data/resources/helpers/cmdline.rb +0 -1
  97. data/spec/autotest/autotest_helper.rb +4 -6
  98. data/spec/autotest/discover_spec.rb +2 -2
  99. data/spec/autotest/failed_results_re_spec.rb +1 -1
  100. data/spec/autotest/rspec_spec.rb +1 -1
  101. data/spec/spec/dsl/main_spec.rb +1 -1
  102. data/spec/spec/example/example_group_class_definition_spec.rb +1 -1
  103. data/spec/spec/example/example_group_factory_spec.rb +1 -1
  104. data/spec/spec/example/example_group_methods_spec.rb +21 -1
  105. data/spec/spec/example/example_group_proxy_spec.rb +1 -1
  106. data/spec/spec/example/example_group_spec.rb +1 -1
  107. data/spec/spec/example/example_matcher_spec.rb +1 -1
  108. data/spec/spec/example/example_methods_spec.rb +1 -1
  109. data/spec/spec/example/example_proxy_spec.rb +1 -1
  110. data/spec/spec/example/helper_method_spec.rb +1 -1
  111. data/spec/spec/example/nested_example_group_spec.rb +1 -1
  112. data/spec/spec/example/predicate_matcher_spec.rb +1 -1
  113. data/spec/spec/example/shared_example_group_spec.rb +1 -1
  114. data/spec/spec/example/subclassing_example_group_spec.rb +1 -1
  115. data/spec/spec/example/subject_spec.rb +17 -1
  116. data/spec/spec/expectations/differs/default_spec.rb +16 -3
  117. data/spec/spec/expectations/extensions/kernel_spec.rb +1 -1
  118. data/spec/spec/expectations/fail_with_spec.rb +1 -1
  119. data/spec/spec/expectations/handler_spec.rb +1 -1
  120. data/spec/spec/expectations/wrap_expectation_spec.rb +1 -1
  121. data/spec/spec/interop/test/unit/resources/test_case_with_various_names.rb +22 -0
  122. data/spec/spec/interop/test/unit/spec_spec.rb +1 -1
  123. data/spec/spec/interop/test/unit/test_unit_spec_helper.rb +2 -2
  124. data/spec/spec/interop/test/unit/testcase_spec.rb +7 -2
  125. data/spec/spec/interop/test/unit/testsuite_adapter_spec.rb +1 -1
  126. data/spec/spec/matchers/be_close_spec.rb +1 -1
  127. data/spec/spec/matchers/be_instance_of_spec.rb +1 -1
  128. data/spec/spec/matchers/be_kind_of_spec.rb +1 -1
  129. data/spec/spec/matchers/be_spec.rb +13 -1
  130. data/spec/spec/matchers/change_spec.rb +1 -1
  131. data/spec/spec/matchers/compatibility_spec.rb +1 -1
  132. data/spec/spec/matchers/description_generation_spec.rb +1 -1
  133. data/spec/spec/matchers/dsl_spec.rb +1 -1
  134. data/spec/spec/matchers/eql_spec.rb +1 -1
  135. data/spec/spec/matchers/equal_spec.rb +1 -1
  136. data/spec/spec/matchers/exist_spec.rb +6 -2
  137. data/spec/spec/matchers/has_spec.rb +19 -1
  138. data/spec/spec/matchers/have_spec.rb +1 -1
  139. data/spec/spec/matchers/include_spec.rb +1 -1
  140. data/spec/spec/matchers/match_array_spec.rb +1 -1
  141. data/spec/spec/matchers/match_spec.rb +1 -1
  142. data/spec/spec/matchers/matcher_methods_spec.rb +1 -1
  143. data/spec/spec/matchers/matcher_spec.rb +55 -28
  144. data/spec/spec/matchers/matchers_spec.rb +1 -1
  145. data/spec/spec/matchers/operator_matcher_spec.rb +1 -1
  146. data/spec/spec/matchers/raise_error_spec.rb +1 -1
  147. data/spec/spec/matchers/respond_to_spec.rb +1 -1
  148. data/spec/spec/matchers/satisfy_spec.rb +1 -1
  149. data/spec/spec/matchers/simple_matcher_spec.rb +1 -1
  150. data/spec/spec/matchers/throw_symbol_spec.rb +1 -1
  151. data/spec/spec/mocks/any_number_of_times_spec.rb +1 -1
  152. data/spec/spec/mocks/argument_expectation_spec.rb +1 -1
  153. data/spec/spec/mocks/argument_matchers_spec.rb +19 -0
  154. data/spec/spec/mocks/at_least_spec.rb +1 -1
  155. data/spec/spec/mocks/at_most_spec.rb +1 -1
  156. data/spec/spec/mocks/bug_report_10260_spec.rb +1 -1
  157. data/spec/spec/mocks/bug_report_10263_spec.rb +1 -1
  158. data/spec/spec/mocks/bug_report_11545_spec.rb +1 -1
  159. data/spec/spec/mocks/bug_report_15719_spec.rb +3 -3
  160. data/spec/spec/mocks/bug_report_496_spec.rb +1 -1
  161. data/spec/spec/mocks/bug_report_600_spec.rb +1 -1
  162. data/spec/spec/mocks/bug_report_7611_spec.rb +1 -1
  163. data/spec/spec/mocks/bug_report_7805_spec.rb +1 -1
  164. data/spec/spec/mocks/bug_report_8165_spec.rb +1 -1
  165. data/spec/spec/mocks/bug_report_8302_spec.rb +1 -1
  166. data/spec/spec/mocks/bug_report_830_spec.rb +1 -1
  167. data/spec/spec/mocks/double_spec.rb +12 -0
  168. data/spec/spec/mocks/failing_argument_matchers_spec.rb +6 -6
  169. data/spec/spec/mocks/hash_including_matcher_spec.rb +1 -1
  170. data/spec/spec/mocks/hash_not_including_matcher_spec.rb +1 -1
  171. data/spec/spec/mocks/mock_ordering_spec.rb +4 -4
  172. data/spec/spec/mocks/mock_space_spec.rb +1 -1
  173. data/spec/spec/mocks/mock_spec.rb +20 -24
  174. data/spec/spec/mocks/multiple_return_value_spec.rb +8 -8
  175. data/spec/spec/mocks/nil_expectation_warning_spec.rb +1 -1
  176. data/spec/spec/mocks/null_object_mock_spec.rb +1 -1
  177. data/spec/spec/mocks/once_counts_spec.rb +1 -1
  178. data/spec/spec/mocks/options_hash_spec.rb +1 -1
  179. data/spec/spec/mocks/partial_mock_spec.rb +1 -1
  180. data/spec/spec/mocks/partial_mock_using_mocks_directly_spec.rb +1 -1
  181. data/spec/spec/mocks/passing_argument_matchers_spec.rb +1 -1
  182. data/spec/spec/mocks/precise_counts_spec.rb +1 -1
  183. data/spec/spec/mocks/record_messages_spec.rb +1 -1
  184. data/spec/spec/mocks/stub_chain_spec.rb +1 -1
  185. data/spec/spec/mocks/stub_implementation_spec.rb +1 -1
  186. data/spec/spec/mocks/stub_spec.rb +14 -9
  187. data/spec/spec/mocks/stubbed_message_expectations_spec.rb +2 -2
  188. data/spec/spec/mocks/twice_counts_spec.rb +1 -1
  189. data/spec/spec/mocks/unstub_spec.rb +1 -1
  190. data/spec/spec/package/bin_spec_spec.rb +4 -10
  191. data/spec/spec/rake/spectask_spec.rb +2 -2
  192. data/spec/spec/runner/class_and_argument_parser_spec.rb +1 -1
  193. data/spec/spec/runner/command_line_spec.rb +1 -1
  194. data/spec/spec/runner/configuration_spec.rb +15 -6
  195. data/spec/spec/runner/drb_command_line_spec.rb +1 -1
  196. data/spec/spec/runner/example_group_runner_spec.rb +1 -1
  197. data/spec/spec/runner/formatter/base_formatter_spec.rb +1 -1
  198. data/spec/spec/runner/formatter/base_text_formatter_spec.rb +10 -1
  199. data/spec/spec/runner/formatter/failing_example_groups_formatter_spec.rb +1 -1
  200. data/spec/spec/runner/formatter/failing_examples_formatter_spec.rb +1 -1
  201. data/spec/spec/runner/formatter/html_formatted-1.8.6-jruby.html +72 -76
  202. data/spec/spec/runner/formatter/html_formatted-1.8.6.html +50 -50
  203. data/spec/spec/runner/formatter/html_formatted-1.8.7.html +50 -50
  204. data/spec/spec/runner/formatter/html_formatted-1.9.1.html +61 -69
  205. data/spec/spec/runner/formatter/html_formatter_spec.rb +26 -26
  206. data/spec/spec/runner/formatter/nested_text_formatter_spec.rb +1 -1
  207. data/spec/spec/runner/formatter/profile_formatter_spec.rb +1 -1
  208. data/spec/spec/runner/formatter/progress_bar_formatter_spec.rb +13 -9
  209. data/spec/spec/runner/formatter/snippet_extractor_spec.rb +1 -1
  210. data/spec/spec/runner/formatter/specdoc_formatter_spec.rb +1 -1
  211. data/spec/spec/runner/formatter/{text_mate_formatted-1.8.4.html → text_mate_formatted-1.8.6-jruby.html} +64 -59
  212. data/spec/spec/runner/formatter/text_mate_formatted-1.8.6.html +46 -46
  213. data/spec/spec/runner/formatter/text_mate_formatted-1.8.7.html +46 -46
  214. data/spec/spec/runner/formatter/text_mate_formatted-1.9.1.html +55 -63
  215. data/spec/spec/runner/formatter/text_mate_formatter_spec.rb +3 -3
  216. data/spec/spec/runner/heckle_runner_spec.rb +1 -1
  217. data/spec/spec/runner/heckler_spec.rb +1 -1
  218. data/spec/spec/runner/line_number_query/line_number_query_fixture.rb +1 -1
  219. data/spec/spec/runner/line_number_query_spec.rb +10 -1
  220. data/spec/spec/runner/noisy_backtrace_tweaker_spec.rb +22 -16
  221. data/spec/spec/runner/option_parser_spec.rb +48 -14
  222. data/spec/spec/runner/options_spec.rb +16 -2
  223. data/spec/spec/runner/output_one_time_fixture.rb +1 -1
  224. data/spec/spec/runner/output_one_time_fixture_runner.rb +2 -3
  225. data/spec/spec/runner/output_one_time_spec.rb +6 -7
  226. data/spec/spec/runner/quiet_backtrace_tweaker_spec.rb +65 -22
  227. data/spec/spec/runner/reporter_spec.rb +1 -1
  228. data/spec/spec/runner_spec.rb +1 -1
  229. data/spec/spec_helper.rb +5 -7
  230. data/spec/{spec → support}/spec_classes.rb +0 -0
  231. metadata +58 -17
  232. data/examples/failing/spec_helper.rb +0 -3
  233. data/examples/passing/spec_helper.rb +0 -3
  234. data/features/heckle/heckle.feature +0 -56
  235. data/spec/rspec_suite.rb +0 -6
  236. data/spec/spec/runner/formatter/html_formatted-1.8.4.html +0 -366
  237. data/spec/spec/runner/formatter/html_formatted-1.8.5-jruby.html +0 -387
  238. data/spec/spec/runner/formatter/html_formatted-1.8.5.html +0 -372
data/spec/rspec_suite.rb DELETED
@@ -1,6 +0,0 @@
1
- if __FILE__ == $0
2
- dir = File.dirname(__FILE__)
3
- Dir["#{dir}/**/*_spec.rb"].reverse.each do |file|
4
- require file
5
- end
6
- end
@@ -1,366 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
- <head>
7
- <title>RSpec results</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
- <meta http-equiv="Expires" content="-1" />
10
- <meta http-equiv="Pragma" content="no-cache" />
11
- <style type="text/css">
12
- body {
13
- margin: 0;
14
- padding: 0;
15
- background: #fff;
16
- font-size: 80%;
17
- }
18
- </style>
19
- </head>
20
- <body>
21
- <div class="rspec-report">
22
- <script type="text/javascript">
23
- // <![CDATA[
24
- function moveProgressBar(percentDone) {
25
- document.getElementById("rspec-header").style.width = percentDone +"%";
26
- }
27
- function makeRed(element_id) {
28
- document.getElementById(element_id).style.background = '#C40D0D';
29
- document.getElementById(element_id).style.color = '#FFFFFF';
30
- }
31
-
32
- function makeYellow(element_id) {
33
- if (element_id == "rspec-header" && document.getElementById(element_id).style.background != '#C40D0D')
34
- {
35
- document.getElementById(element_id).style.background = '#FAF834';
36
- document.getElementById(element_id).style.color = '#000000';
37
- }
38
- else
39
- {
40
- document.getElementById(element_id).style.background = '#FAF834';
41
- document.getElementById(element_id).style.color = '#000000';
42
- }
43
- }
44
-
45
- // ]]>
46
- </script>
47
- <style type="text/css">
48
- #rspec-header {
49
- background: #65C400; color: #fff;
50
- }
51
-
52
- .rspec-report h1 {
53
- margin: 0px 10px 0px 10px;
54
- padding: 10px;
55
- font-family: "Lucida Grande", Helvetica, sans-serif;
56
- font-size: 1.8em;
57
- }
58
-
59
- #summary {
60
- margin: 0; padding: 5px 10px;
61
- font-family: "Lucida Grande", Helvetica, sans-serif;
62
- text-align: right;
63
- position: absolute;
64
- top: 0px;
65
- right: 0px;
66
- }
67
-
68
- #summary p {
69
- margin: 0 0 0 2px;
70
- }
71
-
72
- #summary #totals {
73
- font-size: 1.2em;
74
- }
75
-
76
- .example_group {
77
- margin: 0 10px 5px;
78
- background: #fff;
79
- }
80
-
81
- dl {
82
- margin: 0; padding: 0 0 5px;
83
- font: normal 11px "Lucida Grande", Helvetica, sans-serif;
84
- }
85
-
86
- dt {
87
- padding: 3px;
88
- background: #65C400;
89
- color: #fff;
90
- font-weight: bold;
91
- }
92
-
93
- dd {
94
- margin: 5px 0 5px 5px;
95
- padding: 3px 3px 3px 18px;
96
- }
97
-
98
- dd.spec.passed {
99
- border-left: 5px solid #65C400;
100
- border-bottom: 1px solid #65C400;
101
- background: #DBFFB4; color: #3D7700;
102
- }
103
-
104
- dd.spec.failed {
105
- border-left: 5px solid #C20000;
106
- border-bottom: 1px solid #C20000;
107
- color: #C20000; background: #FFFBD3;
108
- }
109
-
110
- dd.spec.not_implemented {
111
- border-left: 5px solid #FAF834;
112
- border-bottom: 1px solid #FAF834;
113
- background: #FCFB98; color: #131313;
114
- }
115
-
116
- dd.spec.pending_fixed {
117
- border-left: 5px solid #0000C2;
118
- border-bottom: 1px solid #0000C2;
119
- color: #0000C2; background: #D3FBFF;
120
- }
121
-
122
- .backtrace {
123
- color: #000;
124
- font-size: 12px;
125
- }
126
-
127
- a {
128
- color: #BE5C00;
129
- }
130
-
131
- /* Ruby code, style similar to vibrant ink */
132
- .ruby {
133
- font-size: 12px;
134
- font-family: monospace;
135
- color: white;
136
- background-color: black;
137
- padding: 0.1em 0 0.2em 0;
138
- }
139
-
140
- .ruby .keyword { color: #FF6600; }
141
- .ruby .constant { color: #339999; }
142
- .ruby .attribute { color: white; }
143
- .ruby .global { color: white; }
144
- .ruby .module { color: white; }
145
- .ruby .class { color: white; }
146
- .ruby .string { color: #66FF00; }
147
- .ruby .ident { color: white; }
148
- .ruby .method { color: #FFCC00; }
149
- .ruby .number { color: white; }
150
- .ruby .char { color: white; }
151
- .ruby .comment { color: #9933CC; }
152
- .ruby .symbol { color: white; }
153
- .ruby .regex { color: #44B4CC; }
154
- .ruby .punct { color: white; }
155
- .ruby .escape { color: white; }
156
- .ruby .interp { color: white; }
157
- .ruby .expr { color: white; }
158
-
159
- .ruby .offending { background-color: gray; }
160
- .ruby .linenum {
161
- width: 75px;
162
- padding: 0.1em 1em 0.2em 0;
163
- color: #000000;
164
- background-color: #FFFBD3;
165
- }
166
-
167
- </style>
168
-
169
- <div id="rspec-header">
170
- <h1>RSpec Code Examples</h1>
171
-
172
- <div id="summary">
173
- <p id="totals">&nbsp;</p>
174
- <p id="duration">&nbsp;</p>
175
- </div>
176
- </div>
177
-
178
- <div class="results">
179
- <div class="example_group">
180
- <dl>
181
- <dt id="example_group_1">Mocker</dt>
182
- <script type="text/javascript">moveProgressBar('5.8');</script>
183
- <dd class="spec passed"><span class="passed_spec_name">should be able to call mock()</span></dd>
184
- <script type="text/javascript">makeRed('rspec-header');</script>
185
- <script type="text/javascript">makeRed('example_group_1');</script>
186
- <script type="text/javascript">moveProgressBar('11.7');</script>
187
- <dd class="spec failed">
188
- <span class="failed_spec_name">should fail when expected message not received</span>
189
- <div class="failure" id="failure_1">
190
- <div class="message"><pre>Mock 'poke me' expected :poke with (any args) once, but received it 0 times</pre></div>
191
- <div class="backtrace"><pre>./examples/failing/mocking_example.rb:13:
192
- ./spec/spec/runner/formatter/html_formatter_spec.rb:24:
193
- ./spec/spec/runner/formatter/html_formatter_spec.rb:20:</pre></div>
194
- <pre class="ruby"><code><span class="linenum">11</span> <span class="ident">it</span> <span class="punct">&quot;</span><span class="string">should fail when expected message not received</span><span class="punct">&quot;</span> <span class="keyword">do</span>
195
- <span class="linenum">12</span> <span class="ident">mock</span> <span class="punct">=</span> <span class="ident">mock</span><span class="punct">(&quot;</span><span class="string">poke me</span><span class="punct">&quot;)</span>
196
- <span class="offending"><span class="linenum">13</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">should_receive</span><span class="punct">(</span><span class="symbol">:poke</span><span class="punct">)</span></span>
197
- <span class="linenum">14</span> <span class="keyword">end</span>
198
- <span class="linenum">15</span> </code></pre>
199
- </div>
200
- </dd>
201
- <script type="text/javascript">moveProgressBar('17.6');</script>
202
- <dd class="spec failed">
203
- <span class="failed_spec_name">should fail when messages are received out of order</span>
204
- <div class="failure" id="failure_2">
205
- <div class="message"><pre>Mock 'one two three' received :three out of order</pre></div>
206
- <div class="backtrace"><pre>./examples/failing/mocking_example.rb:22:
207
- ./spec/spec/runner/formatter/html_formatter_spec.rb:24:
208
- ./spec/spec/runner/formatter/html_formatter_spec.rb:20:</pre></div>
209
- <pre class="ruby"><code><span class="linenum">20</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">should_receive</span><span class="punct">(</span><span class="symbol">:three</span><span class="punct">).</span><span class="ident">ordered</span>
210
- <span class="linenum">21</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">one</span>
211
- <span class="offending"><span class="linenum">22</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">three</span></span>
212
- <span class="linenum">23</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">two</span>
213
- <span class="linenum">24</span> <span class="keyword">end</span></code></pre>
214
- </div>
215
- </dd>
216
- <script type="text/javascript">moveProgressBar('23.5');</script>
217
- <dd class="spec failed">
218
- <span class="failed_spec_name">should get yelled at when sending unexpected messages</span>
219
- <div class="failure" id="failure_3">
220
- <div class="message"><pre>Mock 'don't talk to me' expected :any_message_at_all with (any args) 0 times, but received it once</pre></div>
221
- <div class="backtrace"><pre>./examples/failing/mocking_example.rb:28:
222
- ./spec/spec/runner/formatter/html_formatter_spec.rb:24:
223
- ./spec/spec/runner/formatter/html_formatter_spec.rb:20:</pre></div>
224
- <pre class="ruby"><code><span class="linenum">26</span> <span class="ident">it</span> <span class="punct">&quot;</span><span class="string">should get yelled at when sending unexpected messages</span><span class="punct">&quot;</span> <span class="keyword">do</span>
225
- <span class="linenum">27</span> <span class="ident">mock</span> <span class="punct">=</span> <span class="ident">mock</span><span class="punct">(&quot;</span><span class="string">don't talk to me</span><span class="punct">&quot;)</span>
226
- <span class="offending"><span class="linenum">28</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">should_not_receive</span><span class="punct">(</span><span class="symbol">:any_message_at_all</span><span class="punct">)</span></span>
227
- <span class="linenum">29</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">any_message_at_all</span>
228
- <span class="linenum">30</span> <span class="keyword">end</span></code></pre>
229
- </div>
230
- </dd>
231
- <script type="text/javascript">moveProgressBar('29.4');</script>
232
- <dd class="spec pending_fixed">
233
- <span class="failed_spec_name">has a bug we need to fix</span>
234
- <div class="failure" id="failure_4">
235
- <div class="message"><pre>Expected pending 'here is the bug' to fail. No Error was raised.</pre></div>
236
- <div class="backtrace"><pre>./examples/failing/mocking_example.rb:33:
237
- ./spec/spec/runner/formatter/html_formatter_spec.rb:24:
238
- ./spec/spec/runner/formatter/html_formatter_spec.rb:20:</pre></div>
239
- <pre class="ruby"><code><span class="linenum">31</span>
240
- <span class="linenum">32</span> <span class="ident">it</span> <span class="punct">&quot;</span><span class="string">has a bug we need to fix</span><span class="punct">&quot;</span> <span class="keyword">do</span>
241
- <span class="offending"><span class="linenum">33</span> <span class="ident">pending</span> <span class="punct">&quot;</span><span class="string">here is the bug</span><span class="punct">&quot;</span> <span class="keyword">do</span></span>
242
- <span class="linenum">34</span> <span class="comment"># Actually, no. It's fixed. This will fail because it passes :-)</span>
243
- <span class="linenum">35</span> <span class="ident">mock</span> <span class="punct">=</span> <span class="ident">mock</span><span class="punct">(&quot;</span><span class="string">Bug</span><span class="punct">&quot;)</span></code></pre>
244
- </div>
245
- </dd>
246
- </dl>
247
- </div>
248
- <div class="example_group">
249
- <dl>
250
- <dt id="example_group_2">Running specs with --diff</dt>
251
- <script type="text/javascript">makeRed('example_group_2');</script>
252
- <script type="text/javascript">moveProgressBar('35.2');</script>
253
- <dd class="spec failed">
254
- <span class="failed_spec_name">should print diff of different strings</span>
255
- <div class="failure" id="failure_5">
256
- <div class="message"><pre>expected: &quot;RSpec is a\nbehaviour driven development\nframework for Ruby\n&quot;,
257
- got: &quot;RSpec is a\nbehavior driven development\nframework for Ruby\n&quot; (using ==)
258
-
259
- Diff:
260
- @@ -1,4 +1,4 @@
261
- RSpec is a
262
- -behavior driven development
263
- +behaviour driven development
264
- framework for Ruby
265
- </pre></div>
266
- <div class="backtrace"><pre>./examples/failing/diffing_spec.rb:13:
267
- ./spec/spec/runner/formatter/html_formatter_spec.rb:24:
268
- ./spec/spec/runner/formatter/html_formatter_spec.rb:20:</pre></div>
269
- <pre class="ruby"><code><span class="linenum">11</span><span class="ident">framework</span> <span class="keyword">for</span> <span class="constant">Ruby</span>
270
- <span class="linenum">12</span><span class="constant">EOF</span>
271
- <span class="offending"><span class="linenum">13</span> <span class="ident">usa</span><span class="punct">.</span><span class="ident">should</span> <span class="punct">==</span> <span class="ident">uk</span></span>
272
- <span class="linenum">14</span> <span class="keyword">end</span></code></pre>
273
- </div>
274
- </dd>
275
- <script type="text/javascript">moveProgressBar('41.1');</script>
276
- <dd class="spec failed">
277
- <span class="failed_spec_name">should print diff of different objects' pretty representation</span>
278
- <div class="failure" id="failure_6">
279
- <div class="message"><pre>expected &lt;Animal
280
- name=bob,
281
- species=tortoise
282
- &gt;
283
- , got &lt;Animal
284
- name=bob,
285
- species=giraffe
286
- &gt;
287
- (using .eql?)
288
- Diff:
289
- @@ -1,5 +1,5 @@
290
- &lt;Animal
291
- name=bob,
292
- -species=giraffe
293
- +species=tortoise
294
- &gt;
295
- </pre></div>
296
- <div class="backtrace"><pre>./examples/failing/diffing_spec.rb:34:
297
- ./spec/spec/runner/formatter/html_formatter_spec.rb:24:
298
- ./spec/spec/runner/formatter/html_formatter_spec.rb:20:</pre></div>
299
- <pre class="ruby"><code><span class="linenum">32</span> <span class="ident">expected</span> <span class="punct">=</span> <span class="constant">Animal</span><span class="punct">.</span><span class="ident">new</span> <span class="punct">&quot;</span><span class="string">bob</span><span class="punct">&quot;,</span> <span class="punct">&quot;</span><span class="string">giraffe</span><span class="punct">&quot;</span>
300
- <span class="linenum">33</span> <span class="ident">actual</span> <span class="punct">=</span> <span class="constant">Animal</span><span class="punct">.</span><span class="ident">new</span> <span class="punct">&quot;</span><span class="string">bob</span><span class="punct">&quot;,</span> <span class="punct">&quot;</span><span class="string">tortoise</span><span class="punct">&quot;</span>
301
- <span class="offending"><span class="linenum">34</span> <span class="ident">expected</span><span class="punct">.</span><span class="ident">should</span> <span class="ident">eql</span><span class="punct">(</span><span class="ident">actual</span><span class="punct">)</span></span>
302
- <span class="linenum">35</span> <span class="keyword">end</span>
303
- <span class="linenum">36</span><span class="keyword">end</span></code></pre>
304
- </div>
305
- </dd>
306
- </dl>
307
- </div>
308
- <div class="example_group">
309
- <dl>
310
- <dt id="example_group_3">A consumer of a stub</dt>
311
- <script type="text/javascript">moveProgressBar('47.0');</script>
312
- <dd class="spec passed"><span class="passed_spec_name">should be able to stub methods on any Object</span></dd>
313
- </dl>
314
- </div>
315
- <div class="example_group">
316
- <dl>
317
- <dt id="example_group_4">A stubbed method on a class</dt>
318
- <script type="text/javascript">moveProgressBar('52.9');</script>
319
- <dd class="spec passed"><span class="passed_spec_name">should return the stubbed value</span></dd>
320
- <script type="text/javascript">moveProgressBar('58.8');</script>
321
- <dd class="spec passed"><span class="passed_spec_name">should revert to the original method after each spec</span></dd>
322
- <script type="text/javascript">moveProgressBar('64.7');</script>
323
- <dd class="spec passed"><span class="passed_spec_name">can stub! and mock the same message</span></dd>
324
- </dl>
325
- </div>
326
- <div class="example_group">
327
- <dl>
328
- <dt id="example_group_5">A mock</dt>
329
- <script type="text/javascript">moveProgressBar('70.5');</script>
330
- <dd class="spec passed"><span class="passed_spec_name">can stub!</span></dd>
331
- <script type="text/javascript">moveProgressBar('76.4');</script>
332
- <dd class="spec passed"><span class="passed_spec_name">can stub! and mock</span></dd>
333
- <script type="text/javascript">moveProgressBar('82.3');</script>
334
- <dd class="spec passed"><span class="passed_spec_name">can stub! and mock the same message</span></dd>
335
- </dl>
336
- </div>
337
- <div class="example_group">
338
- <dl>
339
- <dt id="example_group_6">pending example (using pending method)</dt>
340
- <script type="text/javascript">makeYellow('example_group_6');</script>
341
- <script type="text/javascript">moveProgressBar('88.2');</script>
342
- <dd class="spec not_implemented"><span class="not_implemented_spec_name">should be reported as &quot;PENDING: for some reason&quot; (PENDING: for some reason)</span></dd>
343
- </dl>
344
- </div>
345
- <div class="example_group">
346
- <dl>
347
- <dt id="example_group_7">pending example (with no block)</dt>
348
- <script type="text/javascript">makeYellow('example_group_7');</script>
349
- <script type="text/javascript">moveProgressBar('94.1');</script>
350
- <dd class="spec not_implemented"><span class="not_implemented_spec_name">should be reported as &quot;PENDING: Not Yet Implemented&quot; (PENDING: Not Yet Implemented)</span></dd>
351
- </dl>
352
- </div>
353
- <div class="example_group">
354
- <dl>
355
- <dt id="example_group_8">pending example (with block for pending)</dt>
356
- <script type="text/javascript">makeYellow('example_group_8');</script>
357
- <script type="text/javascript">moveProgressBar('100.0');</script>
358
- <dd class="spec not_implemented"><span class="not_implemented_spec_name">should have a failing block, passed to pending, reported as &quot;PENDING: for some reason&quot; (PENDING: for some reason)</span></dd>
359
- </dl>
360
- </div>
361
- <script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>x seconds</strong>";</script>
362
- <script type="text/javascript">document.getElementById('totals').innerHTML = "17 examples, 6 failures, 3 pending";</script>
363
- </div>
364
- </div>
365
- </body>
366
- </html>
@@ -1,387 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
- <head>
7
- <title>RSpec results</title>
8
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
- <meta http-equiv="Expires" content="-1" />
10
- <meta http-equiv="Pragma" content="no-cache" />
11
- <style type="text/css">
12
- body {
13
- margin: 0;
14
- padding: 0;
15
- background: #fff;
16
- font-size: 80%;
17
- }
18
- </style>
19
- </head>
20
- <body>
21
- <div class="rspec-report">
22
- <script type="text/javascript">
23
- // <![CDATA[
24
- function moveProgressBar(percentDone) {
25
- document.getElementById("rspec-header").style.width = percentDone +"%";
26
- }
27
- function makeRed(element_id) {
28
- document.getElementById(element_id).style.background = '#C40D0D';
29
- document.getElementById(element_id).style.color = '#FFFFFF';
30
- }
31
-
32
- function makeYellow(element_id) {
33
- if (element_id == "rspec-header" && document.getElementById(element_id).style.background != '#C40D0D')
34
- {
35
- document.getElementById(element_id).style.background = '#FAF834';
36
- document.getElementById(element_id).style.color = '#000000';
37
- }
38
- else
39
- {
40
- document.getElementById(element_id).style.background = '#FAF834';
41
- document.getElementById(element_id).style.color = '#000000';
42
- }
43
- }
44
-
45
- // ]]>
46
- </script>
47
- <style type="text/css">
48
- #rspec-header {
49
- background: #65C400; color: #fff;
50
- }
51
-
52
- .rspec-report h1 {
53
- margin: 0px 10px 0px 10px;
54
- padding: 10px;
55
- font-family: "Lucida Grande", Helvetica, sans-serif;
56
- font-size: 1.8em;
57
- }
58
-
59
- #summary {
60
- margin: 0; padding: 5px 10px;
61
- font-family: "Lucida Grande", Helvetica, sans-serif;
62
- text-align: right;
63
- position: absolute;
64
- top: 0px;
65
- right: 0px;
66
- }
67
-
68
- #summary p {
69
- margin: 0 0 0 2px;
70
- }
71
-
72
- #summary #totals {
73
- font-size: 1.2em;
74
- }
75
-
76
- .example_group {
77
- margin: 0 10px 5px;
78
- background: #fff;
79
- }
80
-
81
- dl {
82
- margin: 0; padding: 0 0 5px;
83
- font: normal 11px "Lucida Grande", Helvetica, sans-serif;
84
- }
85
-
86
- dt {
87
- padding: 3px;
88
- background: #65C400;
89
- color: #fff;
90
- font-weight: bold;
91
- }
92
-
93
- dd {
94
- margin: 5px 0 5px 5px;
95
- padding: 3px 3px 3px 18px;
96
- }
97
-
98
- dd.spec.passed {
99
- border-left: 5px solid #65C400;
100
- border-bottom: 1px solid #65C400;
101
- background: #DBFFB4; color: #3D7700;
102
- }
103
-
104
- dd.spec.failed {
105
- border-left: 5px solid #C20000;
106
- border-bottom: 1px solid #C20000;
107
- color: #C20000; background: #FFFBD3;
108
- }
109
-
110
- dd.spec.not_implemented {
111
- border-left: 5px solid #FAF834;
112
- border-bottom: 1px solid #FAF834;
113
- background: #FCFB98; color: #131313;
114
- }
115
-
116
- dd.spec.pending_fixed {
117
- border-left: 5px solid #0000C2;
118
- border-bottom: 1px solid #0000C2;
119
- color: #0000C2; background: #D3FBFF;
120
- }
121
-
122
- .backtrace {
123
- color: #000;
124
- font-size: 12px;
125
- }
126
-
127
- a {
128
- color: #BE5C00;
129
- }
130
-
131
- /* Ruby code, style similar to vibrant ink */
132
- .ruby {
133
- font-size: 12px;
134
- font-family: monospace;
135
- color: white;
136
- background-color: black;
137
- padding: 0.1em 0 0.2em 0;
138
- }
139
-
140
- .ruby .keyword { color: #FF6600; }
141
- .ruby .constant { color: #339999; }
142
- .ruby .attribute { color: white; }
143
- .ruby .global { color: white; }
144
- .ruby .module { color: white; }
145
- .ruby .class { color: white; }
146
- .ruby .string { color: #66FF00; }
147
- .ruby .ident { color: white; }
148
- .ruby .method { color: #FFCC00; }
149
- .ruby .number { color: white; }
150
- .ruby .char { color: white; }
151
- .ruby .comment { color: #9933CC; }
152
- .ruby .symbol { color: white; }
153
- .ruby .regex { color: #44B4CC; }
154
- .ruby .punct { color: white; }
155
- .ruby .escape { color: white; }
156
- .ruby .interp { color: white; }
157
- .ruby .expr { color: white; }
158
-
159
- .ruby .offending { background-color: gray; }
160
- .ruby .linenum {
161
- width: 75px;
162
- padding: 0.1em 1em 0.2em 0;
163
- color: #000000;
164
- background-color: #FFFBD3;
165
- }
166
-
167
- </style>
168
-
169
- <div id="rspec-header">
170
- <h1>RSpec Code Examples</h1>
171
-
172
- <div id="summary">
173
- <p id="totals">&nbsp;</p>
174
- <p id="duration">&nbsp;</p>
175
- </div>
176
- </div>
177
-
178
- <div class="results">
179
- <div class="example_group">
180
- <dl>
181
- <dt id="example_group_1">Mocker</dt>
182
- <script type="text/javascript">moveProgressBar('5.8');</script>
183
- <dd class="spec passed"><span class="passed_spec_name">should be able to call mock()</span></dd>
184
- <script type="text/javascript">makeRed('rspec-header');</script>
185
- <script type="text/javascript">makeRed('example_group_1');</script>
186
- <script type="text/javascript">moveProgressBar('11.7');</script>
187
- <dd class="spec failed">
188
- <span class="failed_spec_name">should fail when expected message not received</span>
189
- <div class="failure" id="failure_1">
190
- <div class="message"><pre>Mock 'poke me' expected :poke with (any args) once, but received it 0 times</pre></div>
191
- <div class="backtrace"><pre>/Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/./examples/failing/mocking_example.rb:13:in `should_receive'
192
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:24:in `run'
193
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `chdir'
194
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `chdir'
195
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `instance_eval'</pre></div>
196
- <pre class="ruby"><code><span class="linenum">11</span> it "should fail when expected message not received" do
197
- <span class="linenum">12</span> mock = mock("poke me")
198
- <span class="offending"><span class="linenum">13</span> mock.should_receive(:poke)</span>
199
- <span class="linenum">14</span> end
200
- <span class="linenum">15</span>
201
- <span class="linenum">16</span><span class="comment"># gem install syntax to get syntax highlighting</span></code></pre>
202
- </div>
203
- </dd>
204
- <script type="text/javascript">moveProgressBar('17.6');</script>
205
- <dd class="spec failed">
206
- <span class="failed_spec_name">should fail when messages are received out of order</span>
207
- <div class="failure" id="failure_2">
208
- <div class="message"><pre>Mock 'one two three' received :three out of order</pre></div>
209
- <div class="backtrace"><pre>/Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/./examples/failing/mocking_example.rb:22:in `three'
210
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/./examples/failing/mocking_example.rb:16:in `instance_eval'
211
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:24:in `run'
212
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `chdir'
213
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `chdir'
214
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `instance_eval'</pre></div>
215
- <pre class="ruby"><code><span class="linenum">20</span> mock.should_receive(:three).ordered
216
- <span class="linenum">21</span> mock.one
217
- <span class="offending"><span class="linenum">22</span> mock.three</span>
218
- <span class="linenum">23</span> mock.two
219
- <span class="linenum">24</span> end
220
- <span class="linenum">25</span><span class="comment"># gem install syntax to get syntax highlighting</span></code></pre>
221
- </div>
222
- </dd>
223
- <script type="text/javascript">moveProgressBar('23.5');</script>
224
- <dd class="spec failed">
225
- <span class="failed_spec_name">should get yelled at when sending unexpected messages</span>
226
- <div class="failure" id="failure_3">
227
- <div class="message"><pre>Mock 'don't talk to me' expected :any_message_at_all with (any args) 0 times, but received it once</pre></div>
228
- <div class="backtrace"><pre>/Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/./examples/failing/mocking_example.rb:28:in `should_not_receive'
229
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:24:in `run'
230
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `chdir'
231
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `chdir'
232
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `instance_eval'</pre></div>
233
- <pre class="ruby"><code><span class="linenum">26</span> it "should get yelled at when sending unexpected messages" do
234
- <span class="linenum">27</span> mock = mock("don't talk to me")
235
- <span class="offending"><span class="linenum">28</span> mock.should_not_receive(:any_message_at_all)</span>
236
- <span class="linenum">29</span> mock.any_message_at_all
237
- <span class="linenum">30</span> end
238
- <span class="linenum">31</span><span class="comment"># gem install syntax to get syntax highlighting</span></code></pre>
239
- </div>
240
- </dd>
241
- <script type="text/javascript">moveProgressBar('29.4');</script>
242
- <dd class="spec pending_fixed">
243
- <span class="failed_spec_name">has a bug we need to fix</span>
244
- <div class="failure" id="failure_4">
245
- <div class="message"><pre>Expected pending 'here is the bug' to fail. No Error was raised.</pre></div>
246
- <div class="backtrace"><pre>/Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/./examples/failing/mocking_example.rb:33:in `pending'
247
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/./examples/failing/mocking_example.rb:33:in `instance_eval'
248
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:24:in `run'
249
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `chdir'
250
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `chdir'
251
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `instance_eval'</pre></div>
252
- <pre class="ruby"><code><span class="linenum">31</span>
253
- <span class="linenum">32</span> it "has a bug we need to fix" do
254
- <span class="offending"><span class="linenum">33</span> pending "here is the bug" do</span>
255
- <span class="linenum">34</span> # Actually, no. It's fixed. This will fail because it passes :-)
256
- <span class="linenum">35</span> mock = mock("Bug")
257
- <span class="linenum">36</span><span class="comment"># gem install syntax to get syntax highlighting</span></code></pre>
258
- </div>
259
- </dd>
260
- </dl>
261
- </div>
262
- <div class="example_group">
263
- <dl>
264
- <dt id="example_group_2">Running specs with --diff</dt>
265
- <script type="text/javascript">makeRed('example_group_2');</script>
266
- <script type="text/javascript">moveProgressBar('35.2');</script>
267
- <dd class="spec failed">
268
- <span class="failed_spec_name">should print diff of different strings</span>
269
- <div class="failure" id="failure_5">
270
- <div class="message"><pre>expected: &quot;RSpec is a\nbehaviour driven development\nframework for Ruby\n&quot;,
271
- got: &quot;RSpec is a\nbehavior driven development\nframework for Ruby\n&quot; (using ==)
272
- Diff:
273
- @@ -1,4 +1,4 @@
274
- RSpec is a
275
- -behavior driven development
276
- +behaviour driven development
277
- framework for Ruby
278
- </pre></div>
279
- <div class="backtrace"><pre>/Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/./examples/failing/diffing_spec.rb:13:in `=='
280
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:24:in `run'
281
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `chdir'
282
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `chdir'
283
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `instance_eval'</pre></div>
284
- <pre class="ruby"><code><span class="linenum">11</span>framework for Ruby
285
- <span class="linenum">12</span>EOF
286
- <span class="offending"><span class="linenum">13</span> usa.should == uk</span>
287
- <span class="linenum">14</span> end
288
- <span class="linenum">15</span>
289
- <span class="linenum">16</span><span class="comment"># gem install syntax to get syntax highlighting</span></code></pre>
290
- </div>
291
- </dd>
292
- <script type="text/javascript">moveProgressBar('41.1');</script>
293
- <dd class="spec failed">
294
- <span class="failed_spec_name">should print diff of different objects' pretty representation</span>
295
- <div class="failure" id="failure_6">
296
- <div class="message"><pre>expected &lt;Animal
297
- name=bob,
298
- species=tortoise
299
- &gt;
300
- , got &lt;Animal
301
- name=bob,
302
- species=giraffe
303
- &gt;
304
- (using .eql?)
305
- Diff:
306
- @@ -1,5 +1,5 @@
307
- &lt;Animal
308
- name=bob,
309
- -species=giraffe
310
- +species=tortoise
311
- &gt;
312
- </pre></div>
313
- <div class="backtrace"><pre>/Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/./examples/failing/diffing_spec.rb:34:in `should'
314
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/./examples/failing/diffing_spec.rb:31:in `instance_eval'
315
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:24:in `run'
316
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `chdir'
317
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `chdir'
318
- /Users/david/projects/ruby/jruby/testsuites/rspec/target/rspec/spec/spec/runner/formatter/html_formatter_spec.rb:20:in `instance_eval'</pre></div>
319
- <pre class="ruby"><code><span class="linenum">32</span> expected = Animal.new "bob", "giraffe"
320
- <span class="linenum">33</span> actual = Animal.new "bob", "tortoise"
321
- <span class="offending"><span class="linenum">34</span> expected.should eql(actual)</span>
322
- <span class="linenum">35</span> end
323
- <span class="linenum">36</span>end
324
- <span class="linenum">37</span><span class="comment"># gem install syntax to get syntax highlighting</span></code></pre>
325
- </div>
326
- </dd>
327
- </dl>
328
- </div>
329
- <div class="example_group">
330
- <dl>
331
- <dt id="example_group_3">A consumer of a stub</dt>
332
- <script type="text/javascript">moveProgressBar('47.0');</script>
333
- <dd class="spec passed"><span class="passed_spec_name">should be able to stub methods on any Object</span></dd>
334
- </dl>
335
- </div>
336
- <div class="example_group">
337
- <dl>
338
- <dt id="example_group_4">A stubbed method on a class</dt>
339
- <script type="text/javascript">moveProgressBar('52.9');</script>
340
- <dd class="spec passed"><span class="passed_spec_name">should return the stubbed value</span></dd>
341
- <script type="text/javascript">moveProgressBar('58.8');</script>
342
- <dd class="spec passed"><span class="passed_spec_name">should revert to the original method after each spec</span></dd>
343
- <script type="text/javascript">moveProgressBar('64.7');</script>
344
- <dd class="spec passed"><span class="passed_spec_name">can stub! and mock the same message</span></dd>
345
- </dl>
346
- </div>
347
- <div class="example_group">
348
- <dl>
349
- <dt id="example_group_5">A mock</dt>
350
- <script type="text/javascript">moveProgressBar('70.5');</script>
351
- <dd class="spec passed"><span class="passed_spec_name">can stub!</span></dd>
352
- <script type="text/javascript">moveProgressBar('76.4');</script>
353
- <dd class="spec passed"><span class="passed_spec_name">can stub! and mock</span></dd>
354
- <script type="text/javascript">moveProgressBar('82.3');</script>
355
- <dd class="spec passed"><span class="passed_spec_name">can stub! and mock the same message</span></dd>
356
- </dl>
357
- </div>
358
- <div class="example_group">
359
- <dl>
360
- <dt id="example_group_6">pending example (using pending method)</dt>
361
- <script type="text/javascript">makeYellow('example_group_6');</script>
362
- <script type="text/javascript">moveProgressBar('88.2');</script>
363
- <dd class="spec not_implemented"><span class="not_implemented_spec_name">should be reported as &quot;PENDING: for some reason&quot; (PENDING: for some reason)</span></dd>
364
- </dl>
365
- </div>
366
- <div class="example_group">
367
- <dl>
368
- <dt id="example_group_7">pending example (with no block)</dt>
369
- <script type="text/javascript">makeYellow('example_group_7');</script>
370
- <script type="text/javascript">moveProgressBar('94.1');</script>
371
- <dd class="spec not_implemented"><span class="not_implemented_spec_name">should be reported as &quot;PENDING: Not Yet Implemented&quot; (PENDING: Not Yet Implemented)</span></dd>
372
- </dl>
373
- </div>
374
- <div class="example_group">
375
- <dl>
376
- <dt id="example_group_8">pending example (with block for pending)</dt>
377
- <script type="text/javascript">makeYellow('example_group_8');</script>
378
- <script type="text/javascript">moveProgressBar('100.0');</script>
379
- <dd class="spec not_implemented"><span class="not_implemented_spec_name">should have a failing block, passed to pending, reported as &quot;PENDING: for some reason&quot; (PENDING: for some reason)</span></dd>
380
- </dl>
381
- </div>
382
- <script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>x seconds</strong>";</script>
383
- <script type="text/javascript">document.getElementById('totals').innerHTML = "17 examples, 6 failures, 3 pending";</script>
384
- </div>
385
- </div>
386
- </body>
387
- </html>