rspec-core 3.0.0.beta2 → 3.0.0.rc1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.yardopts +1 -0
- data/Changelog.md +297 -57
- data/README.md +16 -13
- data/lib/rspec/core.rb +55 -84
- data/lib/rspec/core/backport_random.rb +35 -3
- data/lib/rspec/core/backtrace_formatter.rb +4 -13
- data/lib/rspec/core/configuration.rb +330 -114
- data/lib/rspec/core/configuration_options.rb +38 -22
- data/lib/rspec/core/drb.rb +111 -0
- data/lib/rspec/core/dsl.rb +8 -2
- data/lib/rspec/core/example.rb +203 -94
- data/lib/rspec/core/example_group.rb +344 -316
- data/lib/rspec/core/filter_manager.rb +135 -90
- data/lib/rspec/core/flat_map.rb +1 -0
- data/lib/rspec/core/formatters.rb +50 -14
- data/lib/rspec/core/formatters/base_formatter.rb +32 -138
- data/lib/rspec/core/formatters/base_text_formatter.rb +32 -253
- data/lib/rspec/core/formatters/console_codes.rb +65 -0
- data/lib/rspec/core/formatters/deprecation_formatter.rb +24 -15
- data/lib/rspec/core/formatters/documentation_formatter.rb +7 -10
- data/lib/rspec/core/formatters/helpers.rb +15 -9
- data/lib/rspec/core/formatters/html_formatter.rb +17 -16
- data/lib/rspec/core/formatters/html_printer.rb +1 -0
- data/lib/rspec/core/formatters/json_formatter.rb +18 -20
- data/lib/rspec/core/formatters/profile_formatter.rb +67 -0
- data/lib/rspec/core/formatters/progress_formatter.rb +6 -7
- data/lib/rspec/core/formatters/snippet_extractor.rb +8 -6
- data/lib/rspec/core/hooks.rb +131 -125
- data/lib/rspec/core/memoized_helpers.rb +31 -26
- data/lib/rspec/core/metadata.rb +277 -184
- data/lib/rspec/core/metadata_filter.rb +86 -0
- data/lib/rspec/core/minitest_assertions_adapter.rb +28 -0
- data/lib/rspec/core/mocking_adapters/flexmock.rb +1 -1
- data/lib/rspec/core/mocking_adapters/mocha.rb +1 -1
- data/lib/rspec/core/mocking_adapters/null.rb +1 -1
- data/lib/rspec/core/mocking_adapters/rr.rb +2 -1
- data/lib/rspec/core/mocking_adapters/rspec.rb +1 -1
- data/lib/rspec/core/notifications.rb +435 -24
- data/lib/rspec/core/option_parser.rb +16 -25
- data/lib/rspec/core/ordering.rb +3 -1
- data/lib/rspec/core/pending.rb +57 -33
- data/lib/rspec/core/project_initializer.rb +2 -0
- data/lib/rspec/core/project_initializer/spec_helper.rb +5 -4
- data/lib/rspec/core/rake_task.rb +45 -20
- data/lib/rspec/core/reporter.rb +50 -22
- data/lib/rspec/core/ruby_project.rb +1 -0
- data/lib/rspec/core/runner.rb +93 -39
- data/lib/rspec/core/shared_context.rb +7 -5
- data/lib/rspec/core/shared_example_group.rb +85 -77
- data/lib/rspec/core/test_unit_assertions_adapter.rb +30 -0
- data/lib/rspec/core/version.rb +3 -1
- data/lib/rspec/core/warnings.rb +35 -17
- data/lib/rspec/core/world.rb +57 -5
- metadata +56 -369
- metadata.gz.sig +3 -3
- data/features/README.md +0 -13
- data/features/Upgrade.md +0 -352
- data/features/command_line/README.md +0 -25
- data/features/command_line/dry_run.feature +0 -29
- data/features/command_line/example_name_option.feature +0 -97
- data/features/command_line/exit_status.feature +0 -82
- data/features/command_line/fail_fast.feature +0 -26
- data/features/command_line/format_option.feature +0 -75
- data/features/command_line/init.feature +0 -57
- data/features/command_line/line_number_appended_to_path.feature +0 -140
- data/features/command_line/line_number_option.feature +0 -58
- data/features/command_line/order.feature +0 -25
- data/features/command_line/pattern_option.feature +0 -49
- data/features/command_line/rake_task.feature +0 -122
- data/features/command_line/randomization.feature +0 -63
- data/features/command_line/require_option.feature +0 -43
- data/features/command_line/ruby.feature +0 -23
- data/features/command_line/tag.feature +0 -98
- data/features/command_line/warnings_option.feature +0 -29
- data/features/configuration/alias_example_to.feature +0 -39
- data/features/configuration/backtrace_exclusion_patterns.feature +0 -105
- data/features/configuration/custom_settings.feature +0 -84
- data/features/configuration/default_path.feature +0 -38
- data/features/configuration/deprecation_stream.feature +0 -58
- data/features/configuration/enable_global_dsl.feature +0 -54
- data/features/configuration/fail_fast.feature +0 -77
- data/features/configuration/failure_exit_code.feature +0 -36
- data/features/configuration/order_and_seed.feature +0 -3
- data/features/configuration/output_stream.feature +0 -24
- data/features/configuration/overriding_global_ordering.feature +0 -93
- data/features/configuration/pattern.feature +0 -38
- data/features/configuration/profile.feature +0 -220
- data/features/configuration/read_options_from_file.feature +0 -90
- data/features/configuration/run_all_when_everything_filtered.feature +0 -76
- data/features/example_groups/aliasing.feature +0 -48
- data/features/example_groups/basic_structure.feature +0 -55
- data/features/example_groups/shared_context.feature +0 -74
- data/features/example_groups/shared_examples.feature +0 -286
- data/features/expectation_framework_integration/configure_expectation_framework.feature +0 -102
- data/features/filtering/exclusion_filters.feature +0 -135
- data/features/filtering/if_and_unless.feature +0 -138
- data/features/filtering/inclusion_filters.feature +0 -101
- data/features/formatters/configurable_colors.feature +0 -31
- data/features/formatters/custom_formatter.feature +0 -68
- data/features/formatters/json_formatter.feature +0 -30
- data/features/formatters/regression_tests.feature +0 -95
- data/features/formatters/text_formatter.feature +0 -46
- data/features/helper_methods/arbitrary_methods.feature +0 -40
- data/features/helper_methods/let.feature +0 -50
- data/features/helper_methods/modules.feature +0 -146
- data/features/hooks/around_hooks.feature +0 -344
- data/features/hooks/before_and_after_hooks.feature +0 -427
- data/features/hooks/filtering.feature +0 -232
- data/features/metadata/current_example.feature +0 -56
- data/features/metadata/described_class.feature +0 -17
- data/features/metadata/user_defined.feature +0 -100
- data/features/mock_framework_integration/use_any_framework.feature +0 -106
- data/features/mock_framework_integration/use_flexmock.feature +0 -94
- data/features/mock_framework_integration/use_mocha.feature +0 -95
- data/features/mock_framework_integration/use_rr.feature +0 -96
- data/features/mock_framework_integration/use_rspec.feature +0 -95
- data/features/pending_and_skipped_examples/README.md +0 -3
- data/features/pending_and_skipped_examples/pending_examples.feature +0 -118
- data/features/pending_and_skipped_examples/skipped_examples.feature +0 -106
- data/features/spec_files/arbitrary_file_suffix.feature +0 -13
- data/features/step_definitions/additional_cli_steps.rb +0 -83
- data/features/subject/explicit_subject.feature +0 -101
- data/features/subject/implicit_subject.feature +0 -63
- data/features/subject/one_liner_syntax.feature +0 -71
- data/features/support/env.rb +0 -21
- data/features/support/require_expect_syntax_in_aruba_specs.rb +0 -16
- data/features/support/rubinius.rb +0 -6
- data/lib/rspec/core/command_line.rb +0 -35
- data/lib/rspec/core/drb_command_line.rb +0 -26
- data/lib/rspec/core/drb_options.rb +0 -87
- data/lib/rspec/core/formatters/legacy_formatter.rb +0 -227
- data/lib/rspec/core/shared_example_group/collection.rb +0 -27
- data/spec/command_line/order_spec.rb +0 -211
- data/spec/rspec/core/backtrace_formatter_spec.rb +0 -230
- data/spec/rspec/core/command_line_spec.rb +0 -112
- data/spec/rspec/core/command_line_spec_output.txt +0 -0
- data/spec/rspec/core/configuration_options_spec.rb +0 -409
- data/spec/rspec/core/configuration_spec.rb +0 -1479
- data/spec/rspec/core/drb_command_line_spec.rb +0 -102
- data/spec/rspec/core/drb_options_spec.rb +0 -193
- data/spec/rspec/core/dsl_spec.rb +0 -88
- data/spec/rspec/core/example_group_spec.rb +0 -1533
- data/spec/rspec/core/example_spec.rb +0 -642
- data/spec/rspec/core/filter_manager_spec.rb +0 -229
- data/spec/rspec/core/formatters/base_formatter_spec.rb +0 -64
- data/spec/rspec/core/formatters/base_text_formatter_spec.rb +0 -303
- data/spec/rspec/core/formatters/deprecation_formatter_spec.rb +0 -208
- data/spec/rspec/core/formatters/documentation_formatter_spec.rb +0 -75
- data/spec/rspec/core/formatters/helpers_spec.rb +0 -104
- data/spec/rspec/core/formatters/html_formatted-2.1.0.html +0 -392
- data/spec/rspec/core/formatters/html_formatted.html +0 -397
- data/spec/rspec/core/formatters/html_formatter_spec.rb +0 -122
- data/spec/rspec/core/formatters/json_formatter_spec.rb +0 -206
- data/spec/rspec/core/formatters/legacy_formatter_spec.rb +0 -137
- data/spec/rspec/core/formatters/progress_formatter_spec.rb +0 -43
- data/spec/rspec/core/formatters/snippet_extractor_spec.rb +0 -26
- data/spec/rspec/core/formatters_spec.rb +0 -120
- data/spec/rspec/core/hooks_filtering_spec.rb +0 -227
- data/spec/rspec/core/hooks_spec.rb +0 -294
- data/spec/rspec/core/memoized_helpers_spec.rb +0 -495
- data/spec/rspec/core/metadata_spec.rb +0 -491
- data/spec/rspec/core/option_parser_spec.rb +0 -262
- data/spec/rspec/core/ordering_spec.rb +0 -102
- data/spec/rspec/core/pending_example_spec.rb +0 -117
- data/spec/rspec/core/pending_spec.rb +0 -8
- data/spec/rspec/core/project_initializer_spec.rb +0 -73
- data/spec/rspec/core/rake_task_spec.rb +0 -146
- data/spec/rspec/core/random_spec.rb +0 -47
- data/spec/rspec/core/reporter_spec.rb +0 -155
- data/spec/rspec/core/resources/a_bar.rb +0 -0
- data/spec/rspec/core/resources/a_foo.rb +0 -0
- data/spec/rspec/core/resources/a_spec.rb +0 -1
- data/spec/rspec/core/resources/custom_example_group_runner.rb +0 -14
- data/spec/rspec/core/resources/formatter_specs.rb +0 -58
- data/spec/rspec/core/resources/utf8_encoded.rb +0 -8
- data/spec/rspec/core/rspec_matchers_spec.rb +0 -45
- data/spec/rspec/core/ruby_project_spec.rb +0 -26
- data/spec/rspec/core/runner_spec.rb +0 -151
- data/spec/rspec/core/shared_context_spec.rb +0 -102
- data/spec/rspec/core/shared_example_group/collection_spec.rb +0 -57
- data/spec/rspec/core/shared_example_group_spec.rb +0 -114
- data/spec/rspec/core/warnings_spec.rb +0 -29
- data/spec/rspec/core/world_spec.rb +0 -142
- data/spec/rspec/core_spec.rb +0 -91
- data/spec/spec_helper.rb +0 -160
- data/spec/support/config_options_helper.rb +0 -13
- data/spec/support/formatter_support.rb +0 -83
- data/spec/support/helper_methods.rb +0 -26
- data/spec/support/isolate_load_path_mutation.rb +0 -5
- data/spec/support/isolated_directory.rb +0 -10
- data/spec/support/isolated_home_directory.rb +0 -16
- data/spec/support/legacy_formatter_using_sub_classing_example.rb +0 -87
- data/spec/support/matchers.rb +0 -85
- data/spec/support/mathn_integration_support.rb +0 -12
- data/spec/support/old_style_formatter_example.rb +0 -69
- data/spec/support/shared_example_groups.rb +0 -13
- data/spec/support/spec_files.rb +0 -44
- data/spec/support/stderr_splitter.rb +0 -36
@@ -1,397 +0,0 @@
|
|
1
|
-
<html lang="en">
|
2
|
-
<head>
|
3
|
-
<title>RSpec results</title>
|
4
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
5
|
-
<meta http-equiv="Expires" content="-1">
|
6
|
-
<meta http-equiv="Pragma" content="no-cache">
|
7
|
-
<style type="text/css">
|
8
|
-
body {
|
9
|
-
margin: 0;
|
10
|
-
padding: 0;
|
11
|
-
background: #fff;
|
12
|
-
font-size: 80%;
|
13
|
-
}
|
14
|
-
</style>
|
15
|
-
<script type="text/javascript">
|
16
|
-
// <![CDATA[
|
17
|
-
|
18
|
-
function addClass(element_id, classname) {
|
19
|
-
document.getElementById(element_id).className += (" " + classname);
|
20
|
-
}
|
21
|
-
|
22
|
-
function removeClass(element_id, classname) {
|
23
|
-
var elem = document.getElementById(element_id);
|
24
|
-
var classlist = elem.className.replace(classname,'');
|
25
|
-
elem.className = classlist;
|
26
|
-
}
|
27
|
-
|
28
|
-
function moveProgressBar(percentDone) {
|
29
|
-
document.getElementById("rspec-header").style.width = percentDone +"%";
|
30
|
-
}
|
31
|
-
|
32
|
-
function makeRed(element_id) {
|
33
|
-
removeClass(element_id, 'passed');
|
34
|
-
removeClass(element_id, 'not_implemented');
|
35
|
-
addClass(element_id,'failed');
|
36
|
-
}
|
37
|
-
|
38
|
-
function makeYellow(element_id) {
|
39
|
-
var elem = document.getElementById(element_id);
|
40
|
-
if (elem.className.indexOf("failed") == -1) { // class doesn't includes failed
|
41
|
-
if (elem.className.indexOf("not_implemented") == -1) { // class doesn't include not_implemented
|
42
|
-
removeClass(element_id, 'passed');
|
43
|
-
addClass(element_id,'not_implemented');
|
44
|
-
}
|
45
|
-
}
|
46
|
-
}
|
47
|
-
|
48
|
-
function apply_filters() {
|
49
|
-
var passed_filter = document.getElementById('passed_checkbox').checked;
|
50
|
-
var failed_filter = document.getElementById('failed_checkbox').checked;
|
51
|
-
var pending_filter = document.getElementById('pending_checkbox').checked;
|
52
|
-
|
53
|
-
assign_display_style("example passed", passed_filter);
|
54
|
-
assign_display_style("example failed", failed_filter);
|
55
|
-
assign_display_style("example not_implemented", pending_filter);
|
56
|
-
|
57
|
-
assign_display_style_for_group("example_group passed", passed_filter);
|
58
|
-
assign_display_style_for_group("example_group not_implemented", pending_filter, pending_filter || passed_filter);
|
59
|
-
assign_display_style_for_group("example_group failed", failed_filter, failed_filter || pending_filter || passed_filter);
|
60
|
-
}
|
61
|
-
|
62
|
-
function get_display_style(display_flag) {
|
63
|
-
var style_mode = 'none';
|
64
|
-
if (display_flag == true) {
|
65
|
-
style_mode = 'block';
|
66
|
-
}
|
67
|
-
return style_mode;
|
68
|
-
}
|
69
|
-
|
70
|
-
function assign_display_style(classname, display_flag) {
|
71
|
-
var style_mode = get_display_style(display_flag);
|
72
|
-
var elems = document.getElementsByClassName(classname)
|
73
|
-
for (var i=0; i<elems.length;i++) {
|
74
|
-
elems[i].style.display = style_mode;
|
75
|
-
}
|
76
|
-
}
|
77
|
-
|
78
|
-
function assign_display_style_for_group(classname, display_flag, subgroup_flag) {
|
79
|
-
var display_style_mode = get_display_style(display_flag);
|
80
|
-
var subgroup_style_mode = get_display_style(subgroup_flag);
|
81
|
-
var elems = document.getElementsByClassName(classname)
|
82
|
-
for (var i=0; i<elems.length;i++) {
|
83
|
-
var style_mode = display_style_mode;
|
84
|
-
if ((display_flag != subgroup_flag) && (elems[i].getElementsByTagName('dt')[0].innerHTML.indexOf(", ") != -1)) {
|
85
|
-
elems[i].style.display = subgroup_style_mode;
|
86
|
-
} else {
|
87
|
-
elems[i].style.display = display_style_mode;
|
88
|
-
}
|
89
|
-
}
|
90
|
-
}
|
91
|
-
|
92
|
-
// ]]>
|
93
|
-
</script>
|
94
|
-
<style type="text/css">
|
95
|
-
#rspec-header {
|
96
|
-
background: #65C400; color: #fff; height: 4em;
|
97
|
-
}
|
98
|
-
|
99
|
-
.rspec-report h1 {
|
100
|
-
margin: 0px 10px 0px 10px;
|
101
|
-
padding: 10px;
|
102
|
-
font-family: "Lucida Grande", Helvetica, sans-serif;
|
103
|
-
font-size: 1.8em;
|
104
|
-
position: absolute;
|
105
|
-
}
|
106
|
-
|
107
|
-
#label {
|
108
|
-
float:left;
|
109
|
-
}
|
110
|
-
|
111
|
-
#display-filters {
|
112
|
-
float:left;
|
113
|
-
padding: 28px 0 0 40%;
|
114
|
-
font-family: "Lucida Grande", Helvetica, sans-serif;
|
115
|
-
}
|
116
|
-
|
117
|
-
#summary {
|
118
|
-
float:right;
|
119
|
-
padding: 5px 10px;
|
120
|
-
font-family: "Lucida Grande", Helvetica, sans-serif;
|
121
|
-
text-align: right;
|
122
|
-
}
|
123
|
-
|
124
|
-
#summary p {
|
125
|
-
margin: 0 0 0 2px;
|
126
|
-
}
|
127
|
-
|
128
|
-
#summary #totals {
|
129
|
-
font-size: 1.2em;
|
130
|
-
}
|
131
|
-
|
132
|
-
.example_group {
|
133
|
-
margin: 0 10px 5px;
|
134
|
-
background: #fff;
|
135
|
-
}
|
136
|
-
|
137
|
-
dl {
|
138
|
-
margin: 0; padding: 0 0 5px;
|
139
|
-
font: normal 11px "Lucida Grande", Helvetica, sans-serif;
|
140
|
-
}
|
141
|
-
|
142
|
-
dt {
|
143
|
-
padding: 3px;
|
144
|
-
background: #65C400;
|
145
|
-
color: #fff;
|
146
|
-
font-weight: bold;
|
147
|
-
}
|
148
|
-
|
149
|
-
dd {
|
150
|
-
margin: 5px 0 5px 5px;
|
151
|
-
padding: 3px 3px 3px 18px;
|
152
|
-
}
|
153
|
-
|
154
|
-
dd .duration {
|
155
|
-
padding-left: 5px;
|
156
|
-
text-align: right;
|
157
|
-
right: 0px;
|
158
|
-
float:right;
|
159
|
-
}
|
160
|
-
|
161
|
-
dd.example.passed {
|
162
|
-
border-left: 5px solid #65C400;
|
163
|
-
border-bottom: 1px solid #65C400;
|
164
|
-
background: #DBFFB4; color: #3D7700;
|
165
|
-
}
|
166
|
-
|
167
|
-
dd.example.not_implemented {
|
168
|
-
border-left: 5px solid #FAF834;
|
169
|
-
border-bottom: 1px solid #FAF834;
|
170
|
-
background: #FCFB98; color: #131313;
|
171
|
-
}
|
172
|
-
|
173
|
-
dd.example.pending_fixed {
|
174
|
-
border-left: 5px solid #0000C2;
|
175
|
-
border-bottom: 1px solid #0000C2;
|
176
|
-
color: #0000C2; background: #D3FBFF;
|
177
|
-
}
|
178
|
-
|
179
|
-
dd.example.failed {
|
180
|
-
border-left: 5px solid #C20000;
|
181
|
-
border-bottom: 1px solid #C20000;
|
182
|
-
color: #C20000; background: #FFFBD3;
|
183
|
-
}
|
184
|
-
|
185
|
-
|
186
|
-
dt.not_implemented {
|
187
|
-
color: #000000; background: #FAF834;
|
188
|
-
}
|
189
|
-
|
190
|
-
dt.pending_fixed {
|
191
|
-
color: #FFFFFF; background: #C40D0D;
|
192
|
-
}
|
193
|
-
|
194
|
-
dt.failed {
|
195
|
-
color: #FFFFFF; background: #C40D0D;
|
196
|
-
}
|
197
|
-
|
198
|
-
|
199
|
-
#rspec-header.not_implemented {
|
200
|
-
color: #000000; background: #FAF834;
|
201
|
-
}
|
202
|
-
|
203
|
-
#rspec-header.pending_fixed {
|
204
|
-
color: #FFFFFF; background: #C40D0D;
|
205
|
-
}
|
206
|
-
|
207
|
-
#rspec-header.failed {
|
208
|
-
color: #FFFFFF; background: #C40D0D;
|
209
|
-
}
|
210
|
-
|
211
|
-
|
212
|
-
.backtrace {
|
213
|
-
color: #000;
|
214
|
-
font-size: 12px;
|
215
|
-
}
|
216
|
-
|
217
|
-
a {
|
218
|
-
color: #BE5C00;
|
219
|
-
}
|
220
|
-
|
221
|
-
/* Ruby code, style similar to vibrant ink */
|
222
|
-
.ruby {
|
223
|
-
font-size: 12px;
|
224
|
-
font-family: monospace;
|
225
|
-
color: white;
|
226
|
-
background-color: black;
|
227
|
-
padding: 0.1em 0 0.2em 0;
|
228
|
-
}
|
229
|
-
|
230
|
-
.ruby .keyword { color: #FF6600; }
|
231
|
-
.ruby .constant { color: #339999; }
|
232
|
-
.ruby .attribute { color: white; }
|
233
|
-
.ruby .global { color: white; }
|
234
|
-
.ruby .module { color: white; }
|
235
|
-
.ruby .class { color: white; }
|
236
|
-
.ruby .string { color: #66FF00; }
|
237
|
-
.ruby .ident { color: white; }
|
238
|
-
.ruby .method { color: #FFCC00; }
|
239
|
-
.ruby .number { color: white; }
|
240
|
-
.ruby .char { color: white; }
|
241
|
-
.ruby .comment { color: #9933CC; }
|
242
|
-
.ruby .symbol { color: white; }
|
243
|
-
.ruby .regex { color: #44B4CC; }
|
244
|
-
.ruby .punct { color: white; }
|
245
|
-
.ruby .escape { color: white; }
|
246
|
-
.ruby .interp { color: white; }
|
247
|
-
.ruby .expr { color: white; }
|
248
|
-
|
249
|
-
.ruby .offending { background-color: gray; }
|
250
|
-
.ruby .linenum {
|
251
|
-
width: 75px;
|
252
|
-
padding: 0.1em 1em 0.2em 0;
|
253
|
-
color: #000000;
|
254
|
-
background-color: #FFFBD3;
|
255
|
-
}
|
256
|
-
|
257
|
-
</style>
|
258
|
-
</head>
|
259
|
-
<body>
|
260
|
-
<div class="rspec-report">
|
261
|
-
|
262
|
-
<div id="rspec-header">
|
263
|
-
<div id="label">
|
264
|
-
<h1>RSpec Code Examples</h1>
|
265
|
-
</div>
|
266
|
-
|
267
|
-
<div id="display-filters">
|
268
|
-
<input id="passed_checkbox" name="passed_checkbox" type="checkbox" checked onchange="apply_filters()" value="1"> <label for="passed_checkbox">Passed</label>
|
269
|
-
<input id="failed_checkbox" name="failed_checkbox" type="checkbox" checked onchange="apply_filters()" value="2"> <label for="failed_checkbox">Failed</label>
|
270
|
-
<input id="pending_checkbox" name="pending_checkbox" type="checkbox" checked onchange="apply_filters()" value="3"> <label for="pending_checkbox">Pending</label>
|
271
|
-
</div>
|
272
|
-
|
273
|
-
<div id="summary">
|
274
|
-
<p id="totals"> </p>
|
275
|
-
<p id="duration"> </p>
|
276
|
-
</div>
|
277
|
-
</div>
|
278
|
-
|
279
|
-
|
280
|
-
<div class="results">
|
281
|
-
<div id="div_group_1" class="example_group passed">
|
282
|
-
<dl style="margin-left: 0px;">
|
283
|
-
<dt id="example_group_1" class="passed">pending spec with no implementation</dt>
|
284
|
-
<script type="text/javascript">makeYellow('rspec-header');</script>
|
285
|
-
<script type="text/javascript">makeYellow('div_group_1');</script>
|
286
|
-
<script type="text/javascript">makeYellow('example_group_1');</script>
|
287
|
-
<script type="text/javascript">moveProgressBar('14.2');</script>
|
288
|
-
<dd class="example not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: Not yet implemented)</span></dd>
|
289
|
-
</dl>
|
290
|
-
</div>
|
291
|
-
<div id="div_group_2" class="example_group passed">
|
292
|
-
<dl style="margin-left: 0px;">
|
293
|
-
<dt id="example_group_2" class="passed">pending command with block format</dt>
|
294
|
-
</dl>
|
295
|
-
</div>
|
296
|
-
<div id="div_group_3" class="example_group passed">
|
297
|
-
<dl style="margin-left: 15px;">
|
298
|
-
<dt id="example_group_3" class="passed">with content that would fail</dt>
|
299
|
-
<script type="text/javascript">makeYellow('rspec-header');</script>
|
300
|
-
<script type="text/javascript">makeYellow('div_group_3');</script>
|
301
|
-
<script type="text/javascript">makeYellow('example_group_3');</script>
|
302
|
-
<script type="text/javascript">moveProgressBar('28.5');</script>
|
303
|
-
<dd class="example not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: No reason given)</span></dd>
|
304
|
-
</dl>
|
305
|
-
</div>
|
306
|
-
<div id="div_group_4" class="example_group passed">
|
307
|
-
<dl style="margin-left: 15px;">
|
308
|
-
<dt id="example_group_4" class="passed">with content that would pass</dt>
|
309
|
-
<script type="text/javascript">makeRed('rspec-header');</script>
|
310
|
-
<script type="text/javascript">makeRed('div_group_4');</script>
|
311
|
-
<script type="text/javascript">makeRed('example_group_4');</script>
|
312
|
-
<script type="text/javascript">moveProgressBar('42.8');</script>
|
313
|
-
<dd class="example pending_fixed">
|
314
|
-
<span class="failed_spec_name">fails</span>
|
315
|
-
<span class="duration">n.nnnns</span>
|
316
|
-
<div class="failure" id="failure_1">
|
317
|
-
<div class="message"><pre>Expected example to fail since it is pending, but it passed.</pre></div>
|
318
|
-
<div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:16
|
319
|
-
./spec/rspec/core/resources/formatter_specs.rb:15
|
320
|
-
./spec/rspec/core/resources/formatter_specs.rb:7</pre></div>
|
321
|
-
<pre class="ruby"><code><span class="linenum">14</span>
|
322
|
-
<span class="linenum">15</span> context <span class="string"><span class="delimiter">"</span><span class="content">with content that would pass</span><span class="delimiter">"</span></span> <span class="keyword">do</span>
|
323
|
-
<span class="offending"><span class="linenum">16</span> it <span class="string"><span class="delimiter">"</span><span class="content">fails</span><span class="delimiter">"</span></span> <span class="keyword">do</span></span>
|
324
|
-
<span class="linenum">17</span> pending
|
325
|
-
<span class="linenum">18</span> expect(<span class="integer">1</span>).to eq(<span class="integer">1</span>)</code></pre>
|
326
|
-
</div>
|
327
|
-
</dd>
|
328
|
-
</dl>
|
329
|
-
</div>
|
330
|
-
<div id="div_group_5" class="example_group passed">
|
331
|
-
<dl style="margin-left: 0px;">
|
332
|
-
<dt id="example_group_5" class="passed">passing spec</dt>
|
333
|
-
<script type="text/javascript">moveProgressBar('57.1');</script>
|
334
|
-
<dd class="example passed">
|
335
|
-
<span class="passed_spec_name">passes</span><span class="duration">n.nnnns</span>
|
336
|
-
</dd>
|
337
|
-
</dl>
|
338
|
-
</div>
|
339
|
-
<div id="div_group_6" class="example_group passed">
|
340
|
-
<dl style="margin-left: 0px;">
|
341
|
-
<dt id="example_group_6" class="passed">failing spec</dt>
|
342
|
-
<script type="text/javascript">makeRed('div_group_6');</script>
|
343
|
-
<script type="text/javascript">makeRed('example_group_6');</script>
|
344
|
-
<script type="text/javascript">moveProgressBar('71.4');</script>
|
345
|
-
<dd class="example failed">
|
346
|
-
<span class="failed_spec_name">fails</span>
|
347
|
-
<span class="duration">n.nnnns</span>
|
348
|
-
<div class="failure" id="failure_2">
|
349
|
-
<div class="message"><pre>
|
350
|
-
expected: 2
|
351
|
-
got: 1
|
352
|
-
|
353
|
-
(compared using ==)
|
354
|
-
</pre></div>
|
355
|
-
<div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:31</pre></div>
|
356
|
-
<pre class="ruby"><code><span class="linenum">29</span><span class="constant">RSpec</span>.describe <span class="string"><span class="delimiter">"</span><span class="content">failing spec</span><span class="delimiter">"</span></span> <span class="keyword">do</span>
|
357
|
-
<span class="linenum">30</span> it <span class="string"><span class="delimiter">"</span><span class="content">fails</span><span class="delimiter">"</span></span> <span class="keyword">do</span>
|
358
|
-
<span class="offending"><span class="linenum">31</span> expect(<span class="integer">1</span>).to eq(<span class="integer">2</span>)</span>
|
359
|
-
<span class="linenum">32</span> <span class="keyword">end</span>
|
360
|
-
<span class="linenum">33</span><span class="keyword">end</span></code></pre>
|
361
|
-
</div>
|
362
|
-
</dd>
|
363
|
-
</dl>
|
364
|
-
</div>
|
365
|
-
<div id="div_group_7" class="example_group passed">
|
366
|
-
<dl style="margin-left: 0px;">
|
367
|
-
<dt id="example_group_7" class="passed">a failing spec with odd backtraces</dt>
|
368
|
-
<script type="text/javascript">makeRed('div_group_7');</script>
|
369
|
-
<script type="text/javascript">makeRed('example_group_7');</script>
|
370
|
-
<script type="text/javascript">moveProgressBar('85.7');</script>
|
371
|
-
<dd class="example failed">
|
372
|
-
<span class="failed_spec_name">fails with a backtrace that has no file</span>
|
373
|
-
<span class="duration">n.nnnns</span>
|
374
|
-
<div class="failure" id="failure_3">
|
375
|
-
<div class="message"><pre>foo</pre></div>
|
376
|
-
<div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:39</pre></div>
|
377
|
-
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for (erb)</span></code></pre>
|
378
|
-
</div>
|
379
|
-
</dd>
|
380
|
-
<script type="text/javascript">moveProgressBar('100.0');</script>
|
381
|
-
<dd class="example failed">
|
382
|
-
<span class="failed_spec_name">fails with a backtrace containing an erb file</span>
|
383
|
-
<span class="duration">n.nnnns</span>
|
384
|
-
<div class="failure" id="failure_4">
|
385
|
-
<div class="message"><pre>Exception</pre></div>
|
386
|
-
<div class="backtrace"><pre></pre></div>
|
387
|
-
<pre class="ruby"><code><span class="linenum">-1</span><span class="comment"># Couldn't get snippet for /foo.html.erb</span></code></pre>
|
388
|
-
</div>
|
389
|
-
</dd>
|
390
|
-
</dl>
|
391
|
-
</div>
|
392
|
-
<script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>n.nnnn seconds</strong>";</script>
|
393
|
-
<script type="text/javascript">document.getElementById('totals').innerHTML = "7 examples, 4 failures, 2 pending";</script>
|
394
|
-
</div>
|
395
|
-
</div>
|
396
|
-
</body>
|
397
|
-
</html>
|
@@ -1,122 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
require 'spec_helper'
|
3
|
-
require 'rspec/core/formatters/html_formatter'
|
4
|
-
require 'nokogiri'
|
5
|
-
|
6
|
-
module RSpec
|
7
|
-
module Core
|
8
|
-
module Formatters
|
9
|
-
RSpec.describe HtmlFormatter do
|
10
|
-
|
11
|
-
let(:root) { File.expand_path("#{File.dirname(__FILE__)}/../../../..") }
|
12
|
-
let(:expected_file) do
|
13
|
-
"#{File.dirname(__FILE__)}/html_formatted.html"
|
14
|
-
end
|
15
|
-
|
16
|
-
let(:generated_html) do
|
17
|
-
options = %w[spec/rspec/core/resources/formatter_specs.rb --format html --order defined]
|
18
|
-
|
19
|
-
err, out = StringIO.new, StringIO.new
|
20
|
-
err.set_encoding("utf-8") if err.respond_to?(:set_encoding)
|
21
|
-
|
22
|
-
command_line = RSpec::Core::CommandLine.new(options)
|
23
|
-
command_line.instance_variable_get("@configuration").backtrace_formatter.inclusion_patterns = []
|
24
|
-
command_line.run(err, out)
|
25
|
-
html = out.string.gsub(/\d+\.\d+(s| seconds)/, "n.nnnn\\1")
|
26
|
-
|
27
|
-
actual_doc = Nokogiri::HTML(html)
|
28
|
-
actual_doc.css("div.backtrace pre").each do |elem|
|
29
|
-
# This is to minimize churn on backtrace lines that we do not
|
30
|
-
# assert on anyway.
|
31
|
-
backtrace = elem.inner_html.lines.
|
32
|
-
select {|e| e =~ /formatter_specs\.rb/ }.
|
33
|
-
map {|x| x.chomp.split(":")[0..1].join(':') }.
|
34
|
-
join("\n")
|
35
|
-
|
36
|
-
elem.inner_html = backtrace
|
37
|
-
end
|
38
|
-
actual_doc.inner_html
|
39
|
-
end
|
40
|
-
|
41
|
-
let(:expected_html) do
|
42
|
-
if File.file?(expected_file)
|
43
|
-
File.read(expected_file)
|
44
|
-
else
|
45
|
-
pending "There is no HTML file with expected content for this platform: #{expected_file}"
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
before do
|
50
|
-
allow(RSpec.configuration).to receive(:load_spec_files) do
|
51
|
-
RSpec.configuration.files_to_run.map {|f| load File.expand_path(f) }
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
# Uncomment this group temporarily in order to overwrite the expected
|
56
|
-
# with actual. Use with care!!!
|
57
|
-
describe "file generator", :if => ENV['GENERATE'] do
|
58
|
-
it "generates a new comparison file" do
|
59
|
-
Dir.chdir(root) do
|
60
|
-
File.open(expected_file, 'w') {|io| io.write(generated_html)}
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
def extract_backtrace_from(doc)
|
66
|
-
doc.search("div.backtrace").
|
67
|
-
collect {|e| e.at("pre").inner_html}.
|
68
|
-
collect {|e| e.split("\n")}.flatten.
|
69
|
-
select {|e| e =~ /formatter_specs\.rb/}
|
70
|
-
end
|
71
|
-
|
72
|
-
describe 'produced HTML', :if => RUBY_VERSION <= '2.0.0' do
|
73
|
-
# Rubies before 2 are a wild west of different outputs, and it's not
|
74
|
-
# worth the effort to maintain accurate fixtures for all of them.
|
75
|
-
# Since we are verifying fixtures on other rubies, if this code at
|
76
|
-
# least runs we can be reasonably confident the output is right since
|
77
|
-
# behaviour variances that we care about across versions is neglible.
|
78
|
-
it 'is present' do
|
79
|
-
expect(generated_html).to be
|
80
|
-
end
|
81
|
-
end
|
82
|
-
|
83
|
-
describe 'produced HTML', :slow, :if => RUBY_VERSION >= '2.0.0' do
|
84
|
-
def build_and_verify_formatter_output
|
85
|
-
Dir.chdir(root) do
|
86
|
-
actual_doc = Nokogiri::HTML(generated_html)
|
87
|
-
actual_backtraces = extract_backtrace_from(actual_doc)
|
88
|
-
actual_doc.css("div.backtrace").remove
|
89
|
-
|
90
|
-
expected_doc = Nokogiri::HTML(expected_html)
|
91
|
-
expected_backtraces = extract_backtrace_from(expected_doc)
|
92
|
-
expected_doc.search("div.backtrace").remove
|
93
|
-
|
94
|
-
expect(actual_doc.inner_html).to eq(expected_doc.inner_html)
|
95
|
-
|
96
|
-
expected_backtraces.each_with_index do |expected_line, i|
|
97
|
-
expected_path, expected_line_number, expected_suffix = expected_line.split(':')
|
98
|
-
actual_path, actual_line_number, actual_suffix = actual_backtraces[i].split(':')
|
99
|
-
|
100
|
-
expect(File.expand_path(actual_path)).to eq(File.expand_path(expected_path))
|
101
|
-
expect(actual_line_number).to eq(expected_line_number)
|
102
|
-
expect(actual_suffix).to eq(expected_suffix)
|
103
|
-
end
|
104
|
-
end
|
105
|
-
end
|
106
|
-
|
107
|
-
it "is identical to the one we designed manually" do
|
108
|
-
build_and_verify_formatter_output
|
109
|
-
end
|
110
|
-
|
111
|
-
context 'with mathn loaded' do
|
112
|
-
include MathnIntegrationSupport
|
113
|
-
|
114
|
-
it "is identical to the one we designed manually", :slow do
|
115
|
-
with_mathn_loaded { build_and_verify_formatter_output }
|
116
|
-
end
|
117
|
-
end
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|
121
|
-
end
|
122
|
-
end
|