rspec-core 3.0.0.beta1 → 3.0.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. data.tar.gz.sig +0 -0
  2. data/Changelog.md +137 -0
  3. data/README.md +2 -2
  4. data/exe/rspec +2 -23
  5. data/features/README.md +1 -5
  6. data/features/command_line/README.md +7 -10
  7. data/features/command_line/exit_status.feature +1 -1
  8. data/features/command_line/format_option.feature +1 -1
  9. data/features/command_line/init.feature +40 -1
  10. data/features/command_line/line_number_option.feature +2 -2
  11. data/features/command_line/ruby.feature +5 -4
  12. data/features/configuration/enable_global_dsl.feature +54 -0
  13. data/features/example_groups/aliasing.feature +48 -0
  14. data/features/example_groups/basic_structure.feature +1 -1
  15. data/features/expectation_framework_integration/configure_expectation_framework.feature +1 -1
  16. data/features/filtering/if_and_unless.feature +0 -30
  17. data/features/formatters/custom_formatter.feature +32 -0
  18. data/features/formatters/regression_tests.feature +95 -0
  19. data/features/hooks/around_hooks.feature +1 -0
  20. data/features/hooks/before_and_after_hooks.feature +2 -2
  21. data/features/mock_framework_integration/use_flexmock.feature +11 -13
  22. data/features/mock_framework_integration/use_mocha.feature +11 -13
  23. data/features/mock_framework_integration/use_rr.feature +11 -13
  24. data/features/mock_framework_integration/use_rspec.feature +11 -13
  25. data/features/pending_and_skipped_examples/README.md +3 -0
  26. data/features/pending_and_skipped_examples/pending_examples.feature +118 -0
  27. data/features/pending_and_skipped_examples/skipped_examples.feature +106 -0
  28. data/features/step_definitions/additional_cli_steps.rb +34 -0
  29. data/features/subject/explicit_subject.feature +1 -1
  30. data/features/subject/one_liner_syntax.feature +71 -0
  31. data/lib/rspec/core.rb +6 -14
  32. data/lib/rspec/core/backtrace_formatter.rb +16 -4
  33. data/lib/rspec/core/command_line.rb +2 -3
  34. data/lib/rspec/core/configuration.rb +114 -125
  35. data/lib/rspec/core/configuration_options.rb +32 -18
  36. data/lib/rspec/core/dsl.rb +80 -18
  37. data/lib/rspec/core/example.rb +84 -33
  38. data/lib/rspec/core/example_group.rb +95 -43
  39. data/lib/rspec/core/filter_manager.rb +31 -40
  40. data/lib/rspec/core/formatters.rb +137 -0
  41. data/lib/rspec/core/formatters/base_formatter.rb +28 -41
  42. data/lib/rspec/core/formatters/base_text_formatter.rb +26 -37
  43. data/lib/rspec/core/formatters/deprecation_formatter.rb +48 -27
  44. data/lib/rspec/core/formatters/documentation_formatter.rb +27 -22
  45. data/lib/rspec/core/formatters/html_formatter.rb +48 -56
  46. data/lib/rspec/core/formatters/html_printer.rb +11 -18
  47. data/lib/rspec/core/formatters/json_formatter.rb +18 -22
  48. data/lib/rspec/core/formatters/legacy_formatter.rb +227 -0
  49. data/lib/rspec/core/formatters/progress_formatter.rb +7 -10
  50. data/lib/rspec/core/hooks.rb +250 -217
  51. data/lib/rspec/core/memoized_helpers.rb +43 -9
  52. data/lib/rspec/core/mocking_adapters/flexmock.rb +29 -0
  53. data/lib/rspec/core/{mocking/with_mocha.rb → mocking_adapters/mocha.rb} +19 -16
  54. data/lib/rspec/core/mocking_adapters/null.rb +12 -0
  55. data/lib/rspec/core/mocking_adapters/rr.rb +28 -0
  56. data/lib/rspec/core/mocking_adapters/rspec.rb +30 -0
  57. data/lib/rspec/core/notifications.rb +100 -0
  58. data/lib/rspec/core/option_parser.rb +11 -18
  59. data/lib/rspec/core/pending.rb +78 -47
  60. data/lib/rspec/core/project_initializer.rb +2 -49
  61. data/lib/rspec/core/project_initializer/dot_rspec +3 -0
  62. data/lib/rspec/core/project_initializer/spec_helper.rb +82 -0
  63. data/lib/rspec/core/rake_task.rb +5 -14
  64. data/lib/rspec/core/reporter.rb +24 -32
  65. data/lib/rspec/core/ruby_project.rb +1 -1
  66. data/lib/rspec/core/runner.rb +14 -4
  67. data/lib/rspec/core/shared_example_group.rb +40 -13
  68. data/lib/rspec/core/version.rb +1 -1
  69. data/spec/command_line/order_spec.rb +15 -15
  70. data/spec/rspec/core/backtrace_formatter_spec.rb +15 -1
  71. data/spec/rspec/core/command_line_spec.rb +18 -17
  72. data/spec/rspec/core/configuration_options_spec.rb +57 -34
  73. data/spec/rspec/core/configuration_spec.rb +162 -184
  74. data/spec/rspec/core/drb_command_line_spec.rb +5 -7
  75. data/spec/rspec/core/drb_options_spec.rb +2 -2
  76. data/spec/rspec/core/dsl_spec.rb +79 -15
  77. data/spec/rspec/core/example_group_spec.rb +253 -39
  78. data/spec/rspec/core/example_spec.rb +149 -33
  79. data/spec/rspec/core/filter_manager_spec.rb +9 -26
  80. data/spec/rspec/core/formatters/base_formatter_spec.rb +2 -5
  81. data/spec/rspec/core/formatters/base_text_formatter_spec.rb +42 -145
  82. data/spec/rspec/core/formatters/deprecation_formatter_spec.rb +64 -34
  83. data/spec/rspec/core/formatters/documentation_formatter_spec.rb +15 -28
  84. data/spec/rspec/core/formatters/helpers_spec.rb +2 -2
  85. data/spec/rspec/core/formatters/{html_formatted-1.8.7.html → html_formatted-2.1.0.html} +22 -44
  86. data/spec/rspec/core/formatters/{html_formatted-1.8.7-jruby.html → html_formatted.html} +30 -49
  87. data/spec/rspec/core/formatters/html_formatter_spec.rb +35 -19
  88. data/spec/rspec/core/formatters/json_formatter_spec.rb +42 -40
  89. data/spec/rspec/core/formatters/legacy_formatter_spec.rb +137 -0
  90. data/spec/rspec/core/formatters/progress_formatter_spec.rb +38 -25
  91. data/spec/rspec/core/formatters/snippet_extractor_spec.rb +1 -1
  92. data/spec/rspec/core/formatters_spec.rb +120 -0
  93. data/spec/rspec/core/hooks_filtering_spec.rb +1 -1
  94. data/spec/rspec/core/hooks_spec.rb +13 -2
  95. data/spec/rspec/core/memoized_helpers_spec.rb +17 -8
  96. data/spec/rspec/core/metadata_spec.rb +3 -3
  97. data/spec/rspec/core/option_parser_spec.rb +53 -46
  98. data/spec/rspec/core/ordering_spec.rb +4 -4
  99. data/spec/rspec/core/pending_example_spec.rb +23 -126
  100. data/spec/rspec/core/pending_spec.rb +8 -0
  101. data/spec/rspec/core/project_initializer_spec.rb +8 -41
  102. data/spec/rspec/core/rake_task_spec.rb +15 -4
  103. data/spec/rspec/core/random_spec.rb +1 -1
  104. data/spec/rspec/core/reporter_spec.rb +50 -37
  105. data/spec/rspec/core/resources/formatter_specs.rb +9 -11
  106. data/spec/rspec/core/rspec_matchers_spec.rb +1 -1
  107. data/spec/rspec/core/ruby_project_spec.rb +3 -3
  108. data/spec/rspec/core/runner_spec.rb +65 -23
  109. data/spec/rspec/core/shared_context_spec.rb +4 -4
  110. data/spec/rspec/core/shared_example_group/collection_spec.rb +1 -1
  111. data/spec/rspec/core/shared_example_group_spec.rb +20 -11
  112. data/spec/rspec/core/warnings_spec.rb +1 -1
  113. data/spec/rspec/core/world_spec.rb +10 -10
  114. data/spec/rspec/core_spec.rb +2 -2
  115. data/spec/spec_helper.rb +12 -24
  116. data/spec/support/config_options_helper.rb +1 -3
  117. data/spec/support/formatter_support.rb +83 -0
  118. data/spec/support/isolate_load_path_mutation.rb +1 -2
  119. data/spec/support/isolated_directory.rb +1 -1
  120. data/spec/support/isolated_home_directory.rb +1 -1
  121. data/spec/support/legacy_formatter_using_sub_classing_example.rb +87 -0
  122. data/spec/support/matchers.rb +20 -0
  123. data/spec/support/mathn_integration_support.rb +2 -2
  124. data/spec/support/old_style_formatter_example.rb +69 -0
  125. data/spec/support/shared_example_groups.rb +1 -1
  126. data/spec/support/spec_files.rb +3 -3
  127. metadata +192 -69
  128. metadata.gz.sig +3 -1
  129. checksums.yaml +0 -15
  130. checksums.yaml.gz.sig +0 -2
  131. data/features/configuration/show_failures_in_pending_blocks.feature +0 -61
  132. data/features/pending/pending_examples.feature +0 -229
  133. data/features/subject/implicit_receiver.feature +0 -29
  134. data/lib/rspec/core/mocking/with_absolutely_nothing.rb +0 -11
  135. data/lib/rspec/core/mocking/with_flexmock.rb +0 -27
  136. data/lib/rspec/core/mocking/with_rr.rb +0 -27
  137. data/lib/rspec/core/mocking/with_rspec.rb +0 -27
  138. data/spec/rspec/core/formatters/html_formatted-1.8.7-rbx.html +0 -477
  139. data/spec/rspec/core/formatters/html_formatted-1.9.2.html +0 -425
  140. data/spec/rspec/core/formatters/html_formatted-1.9.3-jruby.html +0 -416
  141. data/spec/rspec/core/formatters/html_formatted-1.9.3-rbx.html +0 -477
  142. data/spec/rspec/core/formatters/html_formatted-1.9.3.html +0 -419
  143. data/spec/rspec/core/formatters/html_formatted-2.0.0.html +0 -425
  144. data/spec/support/in_sub_process.rb +0 -37
  145. data/spec/support/sandboxed_mock_space.rb +0 -100
metadata.gz.sig CHANGED
@@ -1 +1,3 @@
1
- ut�>X??�!�ԯ���h?u�n�� s������%a��sc��j(x��9b:9a�}��]�L�#mO>2��Z�lHs�AOi�dE�P��;K����� |6�h9/ ���2�5>fD�{��$�Zx߿�B~��j��g�|"ʙ��Z�!���������D=�'��F"�=r���ϋ�lK(�t�E0k�k_��P��.����Ѫ��.��W\l��9��wsP��RB�VN�ׯi�JW��j��9h�u�4R�8��5�-J�
1
+ >V���];
2
+ bk'�5&���.�>�i��3������P+,�3@�����w(3�4Pw*�2'[�%�L؝�h��%�����km��=S9�d�1JN;]��#1q�g_Հk�������j+�g�s�o�<*ԉ�l��,Wߚm <��h| ��/����n�<���XM�Y�Ss�<���0,~��P3s�m�G��;�
3
+ `*4�ĵ_����$$�m ���gC#f���?Dl��D-/6>T ��-$c1��u��
checksums.yaml DELETED
@@ -1,15 +0,0 @@
1
- ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NjNkNmYyYTgyYTA3YTc2ODQ4ZmU2MWYxMDc1NzA1NDdhOTQzNDNlYw==
5
- data.tar.gz: !binary |-
6
- YWU3YzVjN2YwOTM3MzMzODNhYTU3NGQ1Y2IwMTM4YzFjZDA0M2JjOQ==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- ODdjYThjN2ZhMTc5MWFhYzJhZjBlOTMwYmRjMzYxNTNjNWNjMWM1MDA0Njlm
10
- OTUwMWI2Yjg5YzAwMzAwZDQ3NmM1ZGM2OThiY2M0ZjMwYjI0YTA5YjJhOTBj
11
- MjMyNGI0ZDhmNjhiYzkwOTQ0Mzc5NTE5Mjg4NzkyZWY0NDUxZWU=
12
- data.tar.gz: !binary |-
13
- YjIzMWNkOGVmOTJhMzMyODAwZmY2YmVkMjczMDIyMmNmNjViNWE4ZGE3ZWIy
14
- ZWI4NDk0MTdjZDM1ZjVjOWExYmE5NTYxZTViYjA3MmNkNDE5NzhkYWQxMDBk
15
- Mzk4NmRjY2JjOTY4MDFjZTI2YjE1YWExNjM3MTA3MTEwNjgzMGE=
@@ -1,2 +0,0 @@
1
- qx�
2
- ��sˉs��.�:+���)�M5�'�y^H ~�j4iKE�t���d�0��z�n@��ؤy�~PP����@5��}<緰F$0�����g"A�+���xt˕I��Hy1��q`X'�]�g�t��9�%�n�Q0Ɯ�9ݕ�^�D#�%V�� �^�z�)u������9���69M�����ޖ��E��;K�z*�gl,ԁ����N^��Ƥ�����q�[߆��l�N��"�ec���H���@
@@ -1,61 +0,0 @@
1
- Feature: show_failures_in_pending_blocks
2
-
3
- Use the show_failures_in_pending_blocks option to run the code in pending blocks while keeping the tests pending.
4
-
5
- RSpec.configure { |c| c.show_failures_in_pending_blocks = true }
6
-
7
- Background:
8
- Given a file named "spec/spec_helper.rb" with:
9
- """ruby
10
- RSpec.configure {|c| c.show_failures_in_pending_blocks = true}
11
- """
12
-
13
- Scenario: by default, code in pending examples is not exercised
14
- Given a file named "spec/example_spec.rb" with:
15
- """ruby
16
- describe "fails" do
17
- pending "code will not be exercised" do
18
- fail
19
- end
20
- end
21
- """
22
- When I run `rspec spec/example_spec.rb`
23
- Then the output should not contain "Failure/Error: pending { fail }"
24
-
25
- Scenario: by default, code in pending blocks inside examples is not exercised
26
- Given a file named "spec/example_spec.rb" with:
27
- """ruby
28
- describe "fails" do
29
- it "code will not be exercised" do
30
- pending { fail }
31
- end
32
- end
33
- """
34
- When I run `rspec spec/example_spec.rb`
35
- Then the output should not contain "Failure/Error: pending { fail }"
36
-
37
- Scenario: when turned on, pending code blocks inside examples are exercised
38
- Given a file named "spec/example_spec.rb" with:
39
- """ruby
40
- require "spec_helper"
41
- describe "fails" do
42
- it "code will be exercised" do
43
- pending { fail }
44
- end
45
- end
46
- """
47
- When I run `rspec spec/example_spec.rb`
48
- Then the output should contain "Failure/Error: pending { fail }"
49
-
50
- Scenario: when turned on, code inside pending examples is not exercised
51
- Given a file named "spec/example_spec.rb" with:
52
- """ruby
53
- require "spec_helper"
54
- describe "fails" do
55
- pending "code will not be exercised" do
56
- fail
57
- end
58
- end
59
- """
60
- When I run `rspec spec/example_spec.rb`
61
- Then the output should not contain "Failure/Error: pending { fail }"
@@ -1,229 +0,0 @@
1
- Feature: pending examples
2
-
3
- RSpec offers four ways to indicate that an example is disabled pending
4
- some action.
5
-
6
- Scenario: pending implementation
7
- Given a file named "example_without_block_spec.rb" with:
8
- """ruby
9
- describe "an example" do
10
- it "is a pending example"
11
- end
12
- """
13
- When I run `rspec example_without_block_spec.rb`
14
- Then the exit status should be 0
15
- And the output should contain "1 example, 0 failures, 1 pending"
16
- And the output should contain "Not yet implemented"
17
- And the output should contain "example_without_block_spec.rb:2"
18
-
19
- Scenario: pending any arbitrary reason, with no block
20
- Given a file named "pending_without_block_spec.rb" with:
21
- """ruby
22
- describe "an example" do
23
- it "is implemented but waiting" do
24
- pending("something else getting finished")
25
- this_should_not_get_executed
26
- end
27
- end
28
- """
29
- When I run `rspec pending_without_block_spec.rb`
30
- Then the exit status should be 0
31
- And the output should contain "1 example, 0 failures, 1 pending"
32
- And the output should contain:
33
- """
34
- Pending:
35
- an example is implemented but waiting
36
- # something else getting finished
37
- # ./pending_without_block_spec.rb:2
38
- """
39
-
40
- Scenario: pending any arbitrary reason, with a block that fails
41
- Given a file named "pending_with_failing_block_spec.rb" with:
42
- """ruby
43
- describe "an example" do
44
- it "is implemented but waiting" do
45
- pending("something else getting finished") do
46
- raise "this is the failure"
47
- end
48
- end
49
- end
50
- """
51
- When I run `rspec pending_with_failing_block_spec.rb`
52
- Then the exit status should be 0
53
- And the output should contain "1 example, 0 failures, 1 pending"
54
- And the output should contain:
55
- """
56
- Pending:
57
- an example is implemented but waiting
58
- # something else getting finished
59
- # ./pending_with_failing_block_spec.rb:2
60
- """
61
-
62
- Scenario: pending any arbitrary reason, with a block that passes
63
- Given a file named "pending_with_passing_block_spec.rb" with:
64
- """ruby
65
- describe "an example" do
66
- it "is implemented but waiting" do
67
- pending("something else getting finished") do
68
- expect(true).to be(true)
69
- end
70
- end
71
- end
72
- """
73
- When I run `rspec pending_with_passing_block_spec.rb`
74
- Then the exit status should not be 0
75
- And the output should contain "1 example, 1 failure"
76
- And the output should contain "FIXED"
77
- And the output should contain "Expected pending 'something else getting finished' to fail. No Error was raised."
78
- And the output should contain "pending_with_passing_block_spec.rb:3"
79
-
80
- Scenario: temporarily pending by prefixing `it`, `specify`, or `example` with an x
81
- Given a file named "temporarily_pending_spec.rb" with:
82
- """ruby
83
- describe "an example" do
84
- xit "is pending using xit" do
85
- end
86
-
87
- xspecify "is pending using xspecify" do
88
- end
89
-
90
- xexample "is pending using xexample" do
91
- end
92
- end
93
- """
94
- When I run `rspec temporarily_pending_spec.rb`
95
- Then the exit status should be 0
96
- And the output should contain "3 examples, 0 failures, 3 pending"
97
- And the output should contain:
98
- """
99
- Pending:
100
- an example is pending using xit
101
- # Temporarily disabled with xit
102
- # ./temporarily_pending_spec.rb:2
103
- an example is pending using xspecify
104
- # Temporarily disabled with xspecify
105
- # ./temporarily_pending_spec.rb:5
106
- an example is pending using xexample
107
- # Temporarily disabled with xexample
108
- # ./temporarily_pending_spec.rb:8
109
- """
110
-
111
- Scenario: example with no docstring and pending method using documentation formatter
112
- Given a file named "pending_with_no_docstring_spec.rb" with:
113
- """ruby
114
- describe "an example" do
115
- it "checks something" do
116
- expect(3+4).to eq(7)
117
- end
118
- specify do
119
- pending
120
- end
121
- end
122
- """
123
- When I run `rspec pending_with_no_docstring_spec.rb --format documentation`
124
- Then the exit status should be 0
125
- And the output should contain "2 examples, 0 failures, 1 pending"
126
- And the output should contain:
127
- """
128
- an example
129
- checks something
130
- example at ./pending_with_no_docstring_spec.rb:5 (PENDING: No reason given)
131
- """
132
-
133
- Scenario: pending with no docstring using documentation formatter
134
- Given a file named "pending_with_no_docstring_spec.rb" with:
135
- """ruby
136
- describe "an example" do
137
- it "checks something" do
138
- expect(3+4).to eq(7)
139
- end
140
- pending do
141
- expect("string".reverse).to eq("gnirts")
142
- end
143
- end
144
- """
145
- When I run `rspec pending_with_no_docstring_spec.rb --format documentation`
146
- Then the exit status should be 0
147
- And the output should contain "2 examples, 0 failures, 1 pending"
148
- And the output should contain:
149
- """
150
- an example
151
- checks something
152
- example at ./pending_with_no_docstring_spec.rb:5 (PENDING: No reason given)
153
- """
154
-
155
- Scenario: conditionally pending examples
156
- Given a file named "conditionally_pending_spec.rb" with:
157
- """ruby
158
- describe "a failing spec" do
159
- def run_test; raise "failure"; end
160
-
161
- it "is pending when pending with a true :if condition" do
162
- pending("true :if", :if => true) { run_test }
163
- end
164
-
165
- it "fails when pending with a false :if condition" do
166
- pending("false :if", :if => false) { run_test }
167
- end
168
-
169
- it "is pending when pending with a false :unless condition" do
170
- pending("false :unless", :unless => false) { run_test }
171
- end
172
-
173
- it "fails when pending with a true :unless condition" do
174
- pending("true :unless", :unless => true) { run_test }
175
- end
176
- end
177
-
178
- describe "a passing spec" do
179
- def run_test; expect(true).to be(true); end
180
-
181
- it "fails when pending with a true :if condition" do
182
- pending("true :if", :if => true) { run_test }
183
- end
184
-
185
- it "passes when pending with a false :if condition" do
186
- pending("false :if", :if => false) { run_test }
187
- end
188
-
189
- it "fails when pending with a false :unless condition" do
190
- pending("false :unless", :unless => false) { run_test }
191
- end
192
-
193
- it "passes when pending with a true :unless condition" do
194
- pending("true :unless", :unless => true) { run_test }
195
- end
196
- end
197
- """
198
- When I run `rspec ./conditionally_pending_spec.rb`
199
- Then the output should contain "8 examples, 4 failures, 2 pending"
200
- And the output should contain:
201
- """
202
- Pending:
203
- a failing spec is pending when pending with a true :if condition
204
- # true :if
205
- # ./conditionally_pending_spec.rb:4
206
- a failing spec is pending when pending with a false :unless condition
207
- # false :unless
208
- # ./conditionally_pending_spec.rb:12
209
- """
210
- And the output should contain:
211
- """
212
- 1) a failing spec fails when pending with a false :if condition
213
- Failure/Error: def run_test; raise "failure"; end
214
- """
215
- And the output should contain:
216
- """
217
- 2) a failing spec fails when pending with a true :unless condition
218
- Failure/Error: def run_test; raise "failure"; end
219
- """
220
- And the output should contain:
221
- """
222
- 3) a passing spec fails when pending with a true :if condition FIXED
223
- Expected pending 'true :if' to fail. No Error was raised.
224
- """
225
- And the output should contain:
226
- """
227
- 4) a passing spec fails when pending with a false :unless condition FIXED
228
- Expected pending 'false :unless' to fail. No Error was raised.
229
- """
@@ -1,29 +0,0 @@
1
- Feature: implicit receiver
2
-
3
- When `should` is called in an example without an explicit receiver, it is
4
- invoked against the subject (explicit or implicit).
5
-
6
- Scenario: implicit subject
7
- Given a file named "example_spec.rb" with:
8
- """ruby
9
- describe Array do
10
- describe "when first created" do
11
- it { should be_empty }
12
- end
13
- end
14
- """
15
- When I run `rspec example_spec.rb`
16
- Then the examples should all pass
17
-
18
- Scenario: explicit subject
19
- Given a file named "example_spec.rb" with:
20
- """ruby
21
- describe Array do
22
- describe "with 3 items" do
23
- subject { [1,2,3] }
24
- it { should_not be_empty }
25
- end
26
- end
27
- """
28
- When I run `rspec example_spec.rb`
29
- Then the examples should all pass
@@ -1,11 +0,0 @@
1
- module RSpec
2
- module Core
3
- module MockFrameworkAdapter
4
-
5
- def setup_mocks_for_rspec; end
6
- def verify_mocks_for_rspec; end
7
- def teardown_mocks_for_rspec; end
8
-
9
- end
10
- end
11
- end
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # Created by Jim Weirich on 2007-04-10.
4
- # Copyright (c) 2007. All rights reserved.
5
-
6
- require 'flexmock/rspec'
7
-
8
- module RSpec
9
- module Core
10
- module MockFrameworkAdapter
11
-
12
- def self.framework_name; :flexmock end
13
-
14
- include FlexMock::MockContainer
15
- def setup_mocks_for_rspec
16
- # No setup required
17
- end
18
- def verify_mocks_for_rspec
19
- flexmock_verify
20
- end
21
- def teardown_mocks_for_rspec
22
- flexmock_close
23
- end
24
-
25
- end
26
- end
27
- end
@@ -1,27 +0,0 @@
1
- require 'rr'
2
-
3
- RSpec.configuration.backtrace_exclusion_patterns.push(RR::Errors::BACKTRACE_IDENTIFIER)
4
-
5
- module RSpec
6
- module Core
7
- module MockFrameworkAdapter
8
-
9
- def self.framework_name; :rr end
10
-
11
- include RR::Extensions::InstanceMethods
12
-
13
- def setup_mocks_for_rspec
14
- RR::Space.instance.reset
15
- end
16
-
17
- def verify_mocks_for_rspec
18
- RR::Space.instance.verify_doubles
19
- end
20
-
21
- def teardown_mocks_for_rspec
22
- RR::Space.instance.reset
23
- end
24
-
25
- end
26
- end
27
- end
@@ -1,27 +0,0 @@
1
- require 'rspec/mocks'
2
-
3
- module RSpec
4
- module Core
5
- module MockFrameworkAdapter
6
-
7
- def self.framework_name; :rspec end
8
-
9
- def self.configuration
10
- RSpec::Mocks.configuration
11
- end
12
-
13
- def setup_mocks_for_rspec
14
- RSpec::Mocks::setup(self)
15
- end
16
-
17
- def verify_mocks_for_rspec
18
- RSpec::Mocks::verify
19
- end
20
-
21
- def teardown_mocks_for_rspec
22
- RSpec::Mocks::teardown
23
- end
24
-
25
- end
26
- end
27
- end
@@ -1,477 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang='en'>
3
- <head>
4
- <title>RSpec results</title>
5
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
- <meta http-equiv="Expires" content="-1" />
7
- <meta http-equiv="Pragma" content="no-cache" />
8
- <style type="text/css">
9
- body {
10
- margin: 0;
11
- padding: 0;
12
- background: #fff;
13
- font-size: 80%;
14
- }
15
- </style>
16
- <script type="text/javascript">
17
- // <![CDATA[
18
-
19
- function addClass(element_id, classname) {
20
- document.getElementById(element_id).className += (" " + classname);
21
- }
22
-
23
- function removeClass(element_id, classname) {
24
- var elem = document.getElementById(element_id);
25
- var classlist = elem.className.replace(classname,'');
26
- elem.className = classlist;
27
- }
28
-
29
- function moveProgressBar(percentDone) {
30
- document.getElementById("rspec-header").style.width = percentDone +"%";
31
- }
32
-
33
- function makeRed(element_id) {
34
- removeClass(element_id, 'passed');
35
- removeClass(element_id, 'not_implemented');
36
- addClass(element_id,'failed');
37
- }
38
-
39
- function makeYellow(element_id) {
40
- var elem = document.getElementById(element_id);
41
- if (elem.className.indexOf("failed") == -1) { // class doesn't includes failed
42
- if (elem.className.indexOf("not_implemented") == -1) { // class doesn't include not_implemented
43
- removeClass(element_id, 'passed');
44
- addClass(element_id,'not_implemented');
45
- }
46
- }
47
- }
48
-
49
- function apply_filters() {
50
- var passed_filter = document.getElementById('passed_checkbox').checked;
51
- var failed_filter = document.getElementById('failed_checkbox').checked;
52
- var pending_filter = document.getElementById('pending_checkbox').checked;
53
-
54
- assign_display_style("example passed", passed_filter);
55
- assign_display_style("example failed", failed_filter);
56
- assign_display_style("example not_implemented", pending_filter);
57
-
58
- assign_display_style_for_group("example_group passed", passed_filter);
59
- assign_display_style_for_group("example_group not_implemented", pending_filter, pending_filter || passed_filter);
60
- assign_display_style_for_group("example_group failed", failed_filter, failed_filter || pending_filter || passed_filter);
61
- }
62
-
63
- function get_display_style(display_flag) {
64
- var style_mode = 'none';
65
- if (display_flag == true) {
66
- style_mode = 'block';
67
- }
68
- return style_mode;
69
- }
70
-
71
- function assign_display_style(classname, display_flag) {
72
- var style_mode = get_display_style(display_flag);
73
- var elems = document.getElementsByClassName(classname)
74
- for (var i=0; i<elems.length;i++) {
75
- elems[i].style.display = style_mode;
76
- }
77
- }
78
-
79
- function assign_display_style_for_group(classname, display_flag, subgroup_flag) {
80
- var display_style_mode = get_display_style(display_flag);
81
- var subgroup_style_mode = get_display_style(subgroup_flag);
82
- var elems = document.getElementsByClassName(classname)
83
- for (var i=0; i<elems.length;i++) {
84
- var style_mode = display_style_mode;
85
- if ((display_flag != subgroup_flag) && (elems[i].getElementsByTagName('dt')[0].innerHTML.indexOf(", ") != -1)) {
86
- elems[i].style.display = subgroup_style_mode;
87
- } else {
88
- elems[i].style.display = display_style_mode;
89
- }
90
- }
91
- }
92
-
93
- // ]]>
94
- </script>
95
- <style type="text/css">
96
- #rspec-header {
97
- background: #65C400; color: #fff; height: 4em;
98
- }
99
-
100
- .rspec-report h1 {
101
- margin: 0px 10px 0px 10px;
102
- padding: 10px;
103
- font-family: "Lucida Grande", Helvetica, sans-serif;
104
- font-size: 1.8em;
105
- position: absolute;
106
- }
107
-
108
- #label {
109
- float:left;
110
- }
111
-
112
- #display-filters {
113
- float:left;
114
- padding: 28px 0 0 40%;
115
- font-family: "Lucida Grande", Helvetica, sans-serif;
116
- }
117
-
118
- #summary {
119
- float:right;
120
- padding: 5px 10px;
121
- font-family: "Lucida Grande", Helvetica, sans-serif;
122
- text-align: right;
123
- }
124
-
125
- #summary p {
126
- margin: 0 0 0 2px;
127
- }
128
-
129
- #summary #totals {
130
- font-size: 1.2em;
131
- }
132
-
133
- .example_group {
134
- margin: 0 10px 5px;
135
- background: #fff;
136
- }
137
-
138
- dl {
139
- margin: 0; padding: 0 0 5px;
140
- font: normal 11px "Lucida Grande", Helvetica, sans-serif;
141
- }
142
-
143
- dt {
144
- padding: 3px;
145
- background: #65C400;
146
- color: #fff;
147
- font-weight: bold;
148
- }
149
-
150
- dd {
151
- margin: 5px 0 5px 5px;
152
- padding: 3px 3px 3px 18px;
153
- }
154
-
155
- dd .duration {
156
- padding-left: 5px;
157
- text-align: right;
158
- right: 0px;
159
- float:right;
160
- }
161
-
162
- dd.example.passed {
163
- border-left: 5px solid #65C400;
164
- border-bottom: 1px solid #65C400;
165
- background: #DBFFB4; color: #3D7700;
166
- }
167
-
168
- dd.example.not_implemented {
169
- border-left: 5px solid #FAF834;
170
- border-bottom: 1px solid #FAF834;
171
- background: #FCFB98; color: #131313;
172
- }
173
-
174
- dd.example.pending_fixed {
175
- border-left: 5px solid #0000C2;
176
- border-bottom: 1px solid #0000C2;
177
- color: #0000C2; background: #D3FBFF;
178
- }
179
-
180
- dd.example.failed {
181
- border-left: 5px solid #C20000;
182
- border-bottom: 1px solid #C20000;
183
- color: #C20000; background: #FFFBD3;
184
- }
185
-
186
-
187
- dt.not_implemented {
188
- color: #000000; background: #FAF834;
189
- }
190
-
191
- dt.pending_fixed {
192
- color: #FFFFFF; background: #C40D0D;
193
- }
194
-
195
- dt.failed {
196
- color: #FFFFFF; background: #C40D0D;
197
- }
198
-
199
-
200
- #rspec-header.not_implemented {
201
- color: #000000; background: #FAF834;
202
- }
203
-
204
- #rspec-header.pending_fixed {
205
- color: #FFFFFF; background: #C40D0D;
206
- }
207
-
208
- #rspec-header.failed {
209
- color: #FFFFFF; background: #C40D0D;
210
- }
211
-
212
-
213
- .backtrace {
214
- color: #000;
215
- font-size: 12px;
216
- }
217
-
218
- a {
219
- color: #BE5C00;
220
- }
221
-
222
- /* Ruby code, style similar to vibrant ink */
223
- .ruby {
224
- font-size: 12px;
225
- font-family: monospace;
226
- color: white;
227
- background-color: black;
228
- padding: 0.1em 0 0.2em 0;
229
- }
230
-
231
- .ruby .keyword { color: #FF6600; }
232
- .ruby .constant { color: #339999; }
233
- .ruby .attribute { color: white; }
234
- .ruby .global { color: white; }
235
- .ruby .module { color: white; }
236
- .ruby .class { color: white; }
237
- .ruby .string { color: #66FF00; }
238
- .ruby .ident { color: white; }
239
- .ruby .method { color: #FFCC00; }
240
- .ruby .number { color: white; }
241
- .ruby .char { color: white; }
242
- .ruby .comment { color: #9933CC; }
243
- .ruby .symbol { color: white; }
244
- .ruby .regex { color: #44B4CC; }
245
- .ruby .punct { color: white; }
246
- .ruby .escape { color: white; }
247
- .ruby .interp { color: white; }
248
- .ruby .expr { color: white; }
249
-
250
- .ruby .offending { background-color: gray; }
251
- .ruby .linenum {
252
- width: 75px;
253
- padding: 0.1em 1em 0.2em 0;
254
- color: #000000;
255
- background-color: #FFFBD3;
256
- }
257
-
258
- </style>
259
- </head>
260
- <body>
261
- <div class="rspec-report">
262
-
263
- <div id="rspec-header">
264
- <div id="label">
265
- <h1>RSpec Code Examples</h1>
266
- </div>
267
-
268
- <div id="display-filters">
269
- <input id="passed_checkbox" name="passed_checkbox" type="checkbox" checked="checked" onchange="apply_filters()" value="1" /> <label for="passed_checkbox">Passed</label>
270
- <input id="failed_checkbox" name="failed_checkbox" type="checkbox" checked="checked" onchange="apply_filters()" value="2" /> <label for="failed_checkbox">Failed</label>
271
- <input id="pending_checkbox" name="pending_checkbox" type="checkbox" checked="checked" onchange="apply_filters()" value="3" /> <label for="pending_checkbox">Pending</label>
272
- </div>
273
-
274
- <div id="summary">
275
- <p id="totals">&#160;</p>
276
- <p id="duration">&#160;</p>
277
- </div>
278
- </div>
279
-
280
-
281
- <div class="results">
282
- <div id="div_group_1" class="example_group passed">
283
- <dl style="margin-left: 0px;">
284
- <dt id="example_group_1" class="passed">pending spec with no implementation</dt>
285
- <script type="text/javascript">makeYellow('rspec-header');</script>
286
- <script type="text/javascript">makeYellow('div_group_1');</script>
287
- <script type="text/javascript">makeYellow('example_group_1');</script>
288
- <script type="text/javascript">moveProgressBar('14.2');</script>
289
- <dd class="example not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: Not yet implemented)</span></dd>
290
- </dl>
291
- </div>
292
- <div id="div_group_2" class="example_group passed">
293
- <dl style="margin-left: 0px;">
294
- <dt id="example_group_2" class="passed">pending command with block format</dt>
295
- </dl>
296
- </div>
297
- <div id="div_group_3" class="example_group passed">
298
- <dl style="margin-left: 15px;">
299
- <dt id="example_group_3" class="passed">with content that would fail</dt>
300
- <script type="text/javascript">makeYellow('rspec-header');</script>
301
- <script type="text/javascript">makeYellow('div_group_3');</script>
302
- <script type="text/javascript">makeYellow('example_group_3');</script>
303
- <script type="text/javascript">moveProgressBar('28.5');</script>
304
- <dd class="example not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: No reason given)</span></dd>
305
- </dl>
306
- </div>
307
- <div id="div_group_4" class="example_group passed">
308
- <dl style="margin-left: 15px;">
309
- <dt id="example_group_4" class="passed">with content that would pass</dt>
310
- <script type="text/javascript">makeRed('rspec-header');</script>
311
- <script type="text/javascript">makeRed('div_group_4');</script>
312
- <script type="text/javascript">makeRed('example_group_4');</script>
313
- <script type="text/javascript">moveProgressBar('42.8');</script>
314
- <dd class="example pending_fixed">
315
- <span class="failed_spec_name">fails</span>
316
- <span class="duration">n.nnnns</span>
317
- <div class="failure" id="failure_1">
318
- <div class="message"><pre>RSpec::Core::Pending::PendingExampleFixedError</pre></div>
319
- <div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:18:in `__script__'
320
- kernel/common/eval18.rb:45:in `instance_eval'
321
- ./spec/support/sandboxed_mock_space.rb:33:in `run'
322
- ./spec/support/sandboxed_mock_space.rb:72:in `sandboxed'
323
- ./spec/support/sandboxed_mock_space.rb:32:in `run'
324
- kernel/bootstrap/array18.rb:18:in `map'
325
- kernel/bootstrap/array18.rb:18:in `map'
326
- kernel/bootstrap/array18.rb:18:in `map'
327
- ./spec/rspec/core/formatters/html_formatter_spec.rb:37:in `__script__'
328
- kernel/common/hash18.rb:195:in `fetch'
329
- ./spec/rspec/core/formatters/html_formatter_spec.rb:59:in `__script__'
330
- kernel/common/io.rb:217:in `open'
331
- ./spec/rspec/core/formatters/html_formatter_spec.rb:59:in `__script__'
332
- kernel/common/dir.rb:92:in `chdir'
333
- ./spec/rspec/core/formatters/html_formatter_spec.rb:58:in `__script__'
334
- kernel/common/eval18.rb:45:in `instance_eval'
335
- kernel/bootstrap/proc.rb:22:in `call'
336
- kernel/common/eval18.rb:45:in `instance_eval'
337
- ./spec/support/sandboxed_mock_space.rb:38:in `sandboxed'
338
- kernel/common/eval18.rb:104:in `instance_exec'
339
- kernel/bootstrap/proc.rb:22:in `call'
340
- kernel/bootstrap/array18.rb:18:in `map'
341
- kernel/bootstrap/array18.rb:18:in `map'
342
- kernel/bootstrap/array18.rb:18:in `map'
343
- kernel/bootstrap/proc.rb:22:in `call'
344
- kernel/loader.rb:702:in `run_at_exits'
345
- kernel/loader.rb:722:in `epilogue'
346
- kernel/loader.rb:855:in `main'</pre></div>
347
- <pre class="ruby"><code><span class="linenum">16</span> context <span class="string"><span class="delimiter">&quot;</span><span class="content">with content that would pass</span><span class="delimiter">&quot;</span></span> <span class="keyword">do</span>
348
- <span class="linenum">17</span> it <span class="string"><span class="delimiter">&quot;</span><span class="content">fails</span><span class="delimiter">&quot;</span></span> <span class="keyword">do</span>
349
- <span class="offending"><span class="linenum">18</span> pending <span class="keyword">do</span></span>
350
- <span class="linenum">19</span> expect(<span class="integer">1</span>).to eq(<span class="integer">1</span>)
351
- <span class="linenum">20</span> <span class="keyword">end</span></code></pre>
352
- </div>
353
- </dd>
354
- </dl>
355
- </div>
356
- <div id="div_group_5" class="example_group passed">
357
- <dl style="margin-left: 0px;">
358
- <dt id="example_group_5" class="passed">passing spec</dt>
359
- <script type="text/javascript">moveProgressBar('57.1');</script>
360
- <dd class="example passed"><span class="passed_spec_name">passes</span><span class='duration'>n.nnnns</span></dd>
361
- </dl>
362
- </div>
363
- <div id="div_group_6" class="example_group passed">
364
- <dl style="margin-left: 0px;">
365
- <dt id="example_group_6" class="passed">failing spec</dt>
366
- <script type="text/javascript">makeRed('div_group_6');</script>
367
- <script type="text/javascript">makeRed('example_group_6');</script>
368
- <script type="text/javascript">moveProgressBar('71.4');</script>
369
- <dd class="example failed">
370
- <span class="failed_spec_name">fails</span>
371
- <span class="duration">n.nnnns</span>
372
- <div class="failure" id="failure_2">
373
- <div class="message"><pre>
374
- expected: 2
375
- got: 1
376
-
377
- (compared using ==)
378
- </pre></div>
379
- <div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:33:in `__script__'
380
- kernel/common/eval18.rb:45:in `instance_eval'
381
- ./spec/support/sandboxed_mock_space.rb:33:in `run'
382
- ./spec/support/sandboxed_mock_space.rb:72:in `sandboxed'
383
- ./spec/support/sandboxed_mock_space.rb:32:in `run'
384
- kernel/bootstrap/array18.rb:18:in `map'
385
- kernel/bootstrap/array18.rb:18:in `map'
386
- ./spec/rspec/core/formatters/html_formatter_spec.rb:37:in `__script__'
387
- kernel/common/hash18.rb:195:in `fetch'
388
- ./spec/rspec/core/formatters/html_formatter_spec.rb:59:in `__script__'
389
- kernel/common/io.rb:217:in `open'
390
- ./spec/rspec/core/formatters/html_formatter_spec.rb:59:in `__script__'
391
- kernel/common/dir.rb:92:in `chdir'
392
- ./spec/rspec/core/formatters/html_formatter_spec.rb:58:in `__script__'
393
- kernel/common/eval18.rb:45:in `instance_eval'
394
- kernel/bootstrap/proc.rb:22:in `call'
395
- kernel/common/eval18.rb:45:in `instance_eval'
396
- ./spec/support/sandboxed_mock_space.rb:38:in `sandboxed'
397
- kernel/common/eval18.rb:104:in `instance_exec'
398
- kernel/bootstrap/proc.rb:22:in `call'
399
- kernel/bootstrap/array18.rb:18:in `map'
400
- kernel/bootstrap/array18.rb:18:in `map'
401
- kernel/bootstrap/array18.rb:18:in `map'
402
- kernel/bootstrap/proc.rb:22:in `call'
403
- kernel/loader.rb:702:in `run_at_exits'
404
- kernel/loader.rb:722:in `epilogue'
405
- kernel/loader.rb:855:in `main'</pre></div>
406
- <pre class="ruby"><code><span class="linenum">31</span>describe <span class="string"><span class="delimiter">&quot;</span><span class="content">failing spec</span><span class="delimiter">&quot;</span></span> <span class="keyword">do</span>
407
- <span class="linenum">32</span> it <span class="string"><span class="delimiter">&quot;</span><span class="content">fails</span><span class="delimiter">&quot;</span></span> <span class="keyword">do</span>
408
- <span class="offending"><span class="linenum">33</span> expect(<span class="integer">1</span>).to eq(<span class="integer">2</span>)</span>
409
- <span class="linenum">34</span> <span class="keyword">end</span>
410
- <span class="linenum">35</span><span class="keyword">end</span></code></pre>
411
- </div>
412
- </dd>
413
- </dl>
414
- </div>
415
- <div id="div_group_7" class="example_group passed">
416
- <dl style="margin-left: 0px;">
417
- <dt id="example_group_7" class="passed">a failing spec with odd backtraces</dt>
418
- <script type="text/javascript">makeRed('div_group_7');</script>
419
- <script type="text/javascript">makeRed('example_group_7');</script>
420
- <script type="text/javascript">moveProgressBar('85.7');</script>
421
- <dd class="example failed">
422
- <span class="failed_spec_name">fails with a backtrace that has no file</span>
423
- <span class="duration">n.nnnns</span>
424
- <div class="failure" id="failure_3">
425
- <div class="message"><pre>foo</pre></div>
426
- <div class="backtrace"><pre>(erb):1:in `__script__'
427
- kernel/common/block_environment.rb:57:in `call_on_instance'
428
- kernel/common/eval.rb:73:in `eval'
429
- /Users/bradley/.rvm/rubies/rbx-head-18mode/lib/18/erb.rb:719:in `result'
430
- ./spec/rspec/core/resources/formatter_specs.rb:41:in `__script__'
431
- kernel/common/eval18.rb:45:in `instance_eval'
432
- ./spec/support/sandboxed_mock_space.rb:33:in `run'
433
- ./spec/support/sandboxed_mock_space.rb:72:in `sandboxed'
434
- ./spec/support/sandboxed_mock_space.rb:32:in `run'
435
- kernel/bootstrap/array18.rb:18:in `map'
436
- kernel/bootstrap/array18.rb:18:in `map'
437
- ./spec/rspec/core/formatters/html_formatter_spec.rb:37:in `__script__'
438
- kernel/common/hash18.rb:195:in `fetch'
439
- ./spec/rspec/core/formatters/html_formatter_spec.rb:59:in `__script__'
440
- kernel/common/io.rb:217:in `open'
441
- ./spec/rspec/core/formatters/html_formatter_spec.rb:59:in `__script__'
442
- kernel/common/dir.rb:92:in `chdir'
443
- ./spec/rspec/core/formatters/html_formatter_spec.rb:58:in `__script__'
444
- kernel/common/eval18.rb:45:in `instance_eval'
445
- kernel/bootstrap/proc.rb:22:in `call'
446
- kernel/common/eval18.rb:45:in `instance_eval'
447
- ./spec/support/sandboxed_mock_space.rb:38:in `sandboxed'
448
- kernel/common/eval18.rb:104:in `instance_exec'
449
- kernel/bootstrap/proc.rb:22:in `call'
450
- kernel/bootstrap/array18.rb:18:in `map'
451
- kernel/bootstrap/array18.rb:18:in `map'
452
- kernel/bootstrap/array18.rb:18:in `map'
453
- kernel/bootstrap/proc.rb:22:in `call'
454
- kernel/loader.rb:702:in `run_at_exits'
455
- kernel/loader.rb:722:in `epilogue'
456
- kernel/loader.rb:855:in `main'</pre></div>
457
- <pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for (erb)</span></code></pre>
458
- </div>
459
- </dd>
460
- <script type="text/javascript">moveProgressBar('100.0');</script>
461
- <dd class="example failed">
462
- <span class="failed_spec_name">fails with a backtrace containing an erb file</span>
463
- <span class="duration">n.nnnns</span>
464
- <div class="failure" id="failure_4">
465
- <div class="message"><pre>Exception</pre></div>
466
- <div class="backtrace"><pre>/foo.html.erb:1:in `&lt;main&gt;': foo (RuntimeError)</pre></div>
467
- <pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
468
- </div>
469
- </dd>
470
- </dl>
471
- </div>
472
- <script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>n.nnnn seconds</strong>";</script>
473
- <script type="text/javascript">document.getElementById('totals').innerHTML = "7 examples, 4 failures, 2 pending";</script>
474
- </div>
475
- </div>
476
- </body>
477
- </html>