rspec-core 2.0.0.beta.19 → 2.0.0.beta.20
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Upgrade.markdown +6 -0
- data/VERSION +1 -1
- data/features/example_groups/shared_example_group.feature +44 -7
- data/features/filtering/exclusion_filters.feature +79 -0
- data/features/filtering/inclusion_filters.feature +1 -1
- data/features/hooks/around_hooks.feature +28 -1
- data/features/pending/pending_examples.feature +2 -4
- data/features/spec_files/arbitrary_file_suffix.feature +13 -0
- data/lib/autotest/rspec2.rb +17 -17
- data/lib/rspec/core.rb +2 -2
- data/lib/rspec/core/command_line.rb +2 -1
- data/lib/rspec/core/configuration.rb +23 -9
- data/lib/rspec/core/deprecation.rb +1 -1
- data/lib/rspec/core/example_group.rb +11 -28
- data/lib/rspec/core/extensions.rb +4 -0
- data/lib/rspec/core/extensions/instance_eval_with_args.rb +39 -0
- data/lib/rspec/core/{kernel_extensions.rb → extensions/kernel.rb} +0 -0
- data/lib/rspec/core/extensions/module_eval_with_args.rb +54 -0
- data/lib/rspec/core/{object_extensions.rb → extensions/object.rb} +3 -1
- data/lib/rspec/core/formatters/base_formatter.rb +20 -43
- data/lib/rspec/core/formatters/base_text_formatter.rb +13 -10
- data/lib/rspec/core/formatters/documentation_formatter.rb +4 -4
- data/lib/rspec/core/formatters/html_formatter.rb +4 -4
- data/lib/rspec/core/formatters/progress_formatter.rb +4 -4
- data/lib/rspec/core/rake_task.rb +1 -1
- data/lib/rspec/core/reporter.rb +65 -0
- data/lib/rspec/core/subject.rb +1 -1
- data/lib/rspec/core/world.rb +11 -3
- data/rspec-core.gemspec +26 -14
- data/spec/autotest/failed_results_re_spec.rb +14 -23
- data/spec/autotest/rspec_spec.rb +1 -1
- data/spec/rspec/core/configuration_spec.rb +74 -9
- data/spec/rspec/core/drb_command_line_spec.rb +2 -2
- data/spec/rspec/core/example_group_spec.rb +13 -7
- data/spec/rspec/core/example_spec.rb +4 -4
- data/spec/rspec/core/formatters/html_formatted-1.8.6.html +280 -0
- data/spec/rspec/core/formatters/html_formatter_spec.rb +5 -3
- data/spec/rspec/core/formatters/progress_formatter_spec.rb +3 -3
- data/spec/rspec/core/formatters/snippet_extractor_spec.rb +2 -2
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.6.html +280 -0
- data/spec/rspec/core/formatters/text_mate_formatter_spec.rb +5 -3
- data/spec/rspec/core/hooks_filtering_spec.rb +104 -0
- data/spec/rspec/core/reporter_spec.rb +34 -0
- data/spec/rspec/core/shared_example_group_spec.rb +22 -2
- data/spec/rspec/core/world_spec.rb +10 -8
- data/spec/rspec/{core/core_spec.rb → core_spec.rb} +0 -0
- data/spec/ruby_forker.rb +1 -1
- data/spec/spec_helper.rb +2 -2
- metadata +39 -33
@@ -23,18 +23,18 @@ describe RSpec::Core::Example, :parent_metadata => 'sample' do
|
|
23
23
|
end
|
24
24
|
|
25
25
|
describe "accessing metadata within a running example" do
|
26
|
-
it "
|
27
|
-
example.description.should == "
|
26
|
+
it "has a reference to itself when running" do
|
27
|
+
example.description.should == "has a reference to itself when running"
|
28
28
|
end
|
29
29
|
|
30
|
-
it "
|
30
|
+
it "can access the example group's top level metadata as if it were its own" do
|
31
31
|
example.example_group.metadata.should include(:parent_metadata => 'sample')
|
32
32
|
example.metadata.should include(:parent_metadata => 'sample')
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
describe "accessing options within a running example" do
|
37
|
-
it "
|
37
|
+
it "can look up option values by key", :demo => :data do
|
38
38
|
example.options[:demo].should == :data
|
39
39
|
end
|
40
40
|
end
|
@@ -0,0 +1,280 @@
|
|
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
|
+
<script type="text/javascript">
|
20
|
+
// <![CDATA[
|
21
|
+
function moveProgressBar(percentDone) {
|
22
|
+
document.getElementById("rspec-header").style.width = percentDone +"%";
|
23
|
+
}
|
24
|
+
function makeRed(element_id) {
|
25
|
+
document.getElementById(element_id).style.background = '#C40D0D';
|
26
|
+
document.getElementById(element_id).style.color = '#FFFFFF';
|
27
|
+
}
|
28
|
+
|
29
|
+
function makeYellow(element_id) {
|
30
|
+
if (element_id == "rspec-header" && document.getElementById(element_id).style.background != '#C40D0D')
|
31
|
+
{
|
32
|
+
document.getElementById(element_id).style.background = '#FAF834';
|
33
|
+
document.getElementById(element_id).style.color = '#000000';
|
34
|
+
}
|
35
|
+
else
|
36
|
+
{
|
37
|
+
document.getElementById(element_id).style.background = '#FAF834';
|
38
|
+
document.getElementById(element_id).style.color = '#000000';
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
// ]]>
|
43
|
+
</script>
|
44
|
+
<style type="text/css">
|
45
|
+
#rspec-header {
|
46
|
+
background: #65C400; color: #fff; height: 4em;
|
47
|
+
}
|
48
|
+
|
49
|
+
.rspec-report h1 {
|
50
|
+
margin: 0px 10px 0px 10px;
|
51
|
+
padding: 10px;
|
52
|
+
font-family: "Lucida Grande", Helvetica, sans-serif;
|
53
|
+
font-size: 1.8em;
|
54
|
+
position: absolute;
|
55
|
+
}
|
56
|
+
|
57
|
+
#summary {
|
58
|
+
margin: 0; padding: 5px 10px;
|
59
|
+
font-family: "Lucida Grande", Helvetica, sans-serif;
|
60
|
+
text-align: right;
|
61
|
+
top: 0px;
|
62
|
+
right: 0px;
|
63
|
+
float:right;
|
64
|
+
}
|
65
|
+
|
66
|
+
#summary p {
|
67
|
+
margin: 0 0 0 2px;
|
68
|
+
}
|
69
|
+
|
70
|
+
#summary #totals {
|
71
|
+
font-size: 1.2em;
|
72
|
+
}
|
73
|
+
|
74
|
+
.example_group {
|
75
|
+
margin: 0 10px 5px;
|
76
|
+
background: #fff;
|
77
|
+
}
|
78
|
+
|
79
|
+
dl {
|
80
|
+
margin: 0; padding: 0 0 5px;
|
81
|
+
font: normal 11px "Lucida Grande", Helvetica, sans-serif;
|
82
|
+
}
|
83
|
+
|
84
|
+
dt {
|
85
|
+
padding: 3px;
|
86
|
+
background: #65C400;
|
87
|
+
color: #fff;
|
88
|
+
font-weight: bold;
|
89
|
+
}
|
90
|
+
|
91
|
+
dd {
|
92
|
+
margin: 5px 0 5px 5px;
|
93
|
+
padding: 3px 3px 3px 18px;
|
94
|
+
}
|
95
|
+
|
96
|
+
dd.spec.passed {
|
97
|
+
border-left: 5px solid #65C400;
|
98
|
+
border-bottom: 1px solid #65C400;
|
99
|
+
background: #DBFFB4; color: #3D7700;
|
100
|
+
}
|
101
|
+
|
102
|
+
dd.spec.failed {
|
103
|
+
border-left: 5px solid #C20000;
|
104
|
+
border-bottom: 1px solid #C20000;
|
105
|
+
color: #C20000; background: #FFFBD3;
|
106
|
+
}
|
107
|
+
|
108
|
+
dd.spec.not_implemented {
|
109
|
+
border-left: 5px solid #FAF834;
|
110
|
+
border-bottom: 1px solid #FAF834;
|
111
|
+
background: #FCFB98; color: #131313;
|
112
|
+
}
|
113
|
+
|
114
|
+
dd.spec.pending_fixed {
|
115
|
+
border-left: 5px solid #0000C2;
|
116
|
+
border-bottom: 1px solid #0000C2;
|
117
|
+
color: #0000C2; background: #D3FBFF;
|
118
|
+
}
|
119
|
+
|
120
|
+
.backtrace {
|
121
|
+
color: #000;
|
122
|
+
font-size: 12px;
|
123
|
+
}
|
124
|
+
|
125
|
+
a {
|
126
|
+
color: #BE5C00;
|
127
|
+
}
|
128
|
+
|
129
|
+
/* Ruby code, style similar to vibrant ink */
|
130
|
+
.ruby {
|
131
|
+
font-size: 12px;
|
132
|
+
font-family: monospace;
|
133
|
+
color: white;
|
134
|
+
background-color: black;
|
135
|
+
padding: 0.1em 0 0.2em 0;
|
136
|
+
}
|
137
|
+
|
138
|
+
.ruby .keyword { color: #FF6600; }
|
139
|
+
.ruby .constant { color: #339999; }
|
140
|
+
.ruby .attribute { color: white; }
|
141
|
+
.ruby .global { color: white; }
|
142
|
+
.ruby .module { color: white; }
|
143
|
+
.ruby .class { color: white; }
|
144
|
+
.ruby .string { color: #66FF00; }
|
145
|
+
.ruby .ident { color: white; }
|
146
|
+
.ruby .method { color: #FFCC00; }
|
147
|
+
.ruby .number { color: white; }
|
148
|
+
.ruby .char { color: white; }
|
149
|
+
.ruby .comment { color: #9933CC; }
|
150
|
+
.ruby .symbol { color: white; }
|
151
|
+
.ruby .regex { color: #44B4CC; }
|
152
|
+
.ruby .punct { color: white; }
|
153
|
+
.ruby .escape { color: white; }
|
154
|
+
.ruby .interp { color: white; }
|
155
|
+
.ruby .expr { color: white; }
|
156
|
+
|
157
|
+
.ruby .offending { background-color: gray; }
|
158
|
+
.ruby .linenum {
|
159
|
+
width: 75px;
|
160
|
+
padding: 0.1em 1em 0.2em 0;
|
161
|
+
color: #000000;
|
162
|
+
background-color: #FFFBD3;
|
163
|
+
}
|
164
|
+
|
165
|
+
</style>
|
166
|
+
</head>
|
167
|
+
<body>
|
168
|
+
<div class="rspec-report">
|
169
|
+
|
170
|
+
<div id="rspec-header">
|
171
|
+
<div id="label">
|
172
|
+
<h1>RSpec Code Examples</h1>
|
173
|
+
</div>
|
174
|
+
|
175
|
+
<div id="summary">
|
176
|
+
<p id="totals"> </p>
|
177
|
+
<p id="duration"> </p>
|
178
|
+
</div>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
<div class="results">
|
182
|
+
<div class="example_group">
|
183
|
+
<dl>
|
184
|
+
<dt id="example_group_1">pending spec with no implementation</dt>
|
185
|
+
<script type="text/javascript">makeYellow('rspec-header');</script>
|
186
|
+
<script type="text/javascript">makeYellow('example_group_1');</script>
|
187
|
+
<script type="text/javascript">moveProgressBar('20.0');</script>
|
188
|
+
<dd class="spec not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: Not Yet Implemented)</span></dd>
|
189
|
+
</dl>
|
190
|
+
</div>
|
191
|
+
<div class="example_group">
|
192
|
+
<dl>
|
193
|
+
<dt id="example_group_2">pending command with block format</dt>
|
194
|
+
</dl>
|
195
|
+
</div>
|
196
|
+
<div class="example_group">
|
197
|
+
<dl>
|
198
|
+
<dt id="example_group_3">with content that would fail</dt>
|
199
|
+
<script type="text/javascript">makeYellow('rspec-header');</script>
|
200
|
+
<script type="text/javascript">makeYellow('example_group_3');</script>
|
201
|
+
<script type="text/javascript">moveProgressBar('40.0');</script>
|
202
|
+
<dd class="spec not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: No reason given)</span></dd>
|
203
|
+
</dl>
|
204
|
+
</div>
|
205
|
+
<div class="example_group">
|
206
|
+
<dl>
|
207
|
+
<dt id="example_group_4">with content that would pass</dt>
|
208
|
+
<script type="text/javascript">makeRed('rspec-header');</script>
|
209
|
+
<script type="text/javascript">makeRed('example_group_4');</script>
|
210
|
+
<script type="text/javascript">moveProgressBar('60.0');</script>
|
211
|
+
<dd class="spec pending_fixed">
|
212
|
+
<span class="failed_spec_name">fails</span>
|
213
|
+
<div class="failure" id="failure_0">
|
214
|
+
<div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div>
|
215
|
+
<div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:19
|
216
|
+
./spec/rspec/core/formatters/html_formatter_spec.rb:23
|
217
|
+
./spec/rspec/core/formatters/html_formatter_spec.rb:43
|
218
|
+
./spec/rspec/core/formatters/html_formatter_spec.rb:43:in `open'
|
219
|
+
./spec/rspec/core/formatters/html_formatter_spec.rb:43
|
220
|
+
./spec/rspec/core/formatters/html_formatter_spec.rb:42:in `chdir'
|
221
|
+
./spec/rspec/core/formatters/html_formatter_spec.rb:42
|
222
|
+
./spec/spec_helper.rb:70:in `__instance_exec0'
|
223
|
+
./spec/spec_helper.rb:46:in `instance_eval'
|
224
|
+
./spec/spec_helper.rb:46:in `sandboxed'
|
225
|
+
./spec/spec_helper.rb:70:in `__instance_exec0'</pre></div>
|
226
|
+
<pre class="ruby"><code><span class="linenum">11</span> <span class="keyword">rescue</span> <span class="constant">Exception</span> <span class="punct">=></span> <span class="ident">e</span>
|
227
|
+
<span class="linenum">12</span> <span class="keyword">end</span>
|
228
|
+
<span class="offending"><span class="linenum">13</span> <span class="keyword">raise</span> <span class="constant">RSpec</span><span class="punct">::</span><span class="constant">Core</span><span class="punct">::</span><span class="constant">PendingExampleFixedError</span><span class="punct">.</span><span class="ident">new</span> <span class="keyword">if</span> <span class="ident">result</span></span>
|
229
|
+
<span class="linenum">14</span> <span class="keyword">end</span>
|
230
|
+
<span class="linenum">15</span> <span class="ident">throw</span> <span class="symbol">:pending_declared_in_example</span><span class="punct">,</span> <span class="ident">message</span></code></pre>
|
231
|
+
</div>
|
232
|
+
</dd>
|
233
|
+
</dl>
|
234
|
+
</div>
|
235
|
+
<div class="example_group">
|
236
|
+
<dl>
|
237
|
+
<dt id="example_group_5">passing spec</dt>
|
238
|
+
<script type="text/javascript">moveProgressBar('80.0');</script>
|
239
|
+
<dd class="spec passed"><span class="passed_spec_name">passes</span></dd>
|
240
|
+
</dl>
|
241
|
+
</div>
|
242
|
+
<div class="example_group">
|
243
|
+
<dl>
|
244
|
+
<dt id="example_group_6">failing spec</dt>
|
245
|
+
<script type="text/javascript">makeRed('example_group_6');</script>
|
246
|
+
<script type="text/javascript">moveProgressBar('100.0');</script>
|
247
|
+
<dd class="spec failed">
|
248
|
+
<span class="failed_spec_name">fails</span>
|
249
|
+
<div class="failure" id="failure_0">
|
250
|
+
<div class="message"><pre>
|
251
|
+
expected 2
|
252
|
+
got 1
|
253
|
+
|
254
|
+
(compared using ==)
|
255
|
+
</pre></div>
|
256
|
+
<div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:34
|
257
|
+
./spec/rspec/core/formatters/html_formatter_spec.rb:23
|
258
|
+
./spec/rspec/core/formatters/html_formatter_spec.rb:43
|
259
|
+
./spec/rspec/core/formatters/html_formatter_spec.rb:43:in `open'
|
260
|
+
./spec/rspec/core/formatters/html_formatter_spec.rb:43
|
261
|
+
./spec/rspec/core/formatters/html_formatter_spec.rb:42:in `chdir'
|
262
|
+
./spec/rspec/core/formatters/html_formatter_spec.rb:42
|
263
|
+
./spec/spec_helper.rb:70:in `__instance_exec0'
|
264
|
+
./spec/spec_helper.rb:46:in `instance_eval'
|
265
|
+
./spec/spec_helper.rb:46:in `sandboxed'
|
266
|
+
./spec/spec_helper.rb:70:in `__instance_exec0'</pre></div>
|
267
|
+
<pre class="ruby"><code><span class="linenum">27</span> <span class="keyword">end</span>
|
268
|
+
<span class="linenum">28</span>
|
269
|
+
<span class="offending"><span class="linenum">29</span> <span class="keyword">raise</span><span class="punct">(</span><span class="constant">RSpec</span><span class="punct">::</span><span class="constant">Expectations</span><span class="punct">::</span><span class="constant">ExpectationNotMetError</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span><span class="ident">message</span><span class="punct">))</span></span>
|
270
|
+
<span class="linenum">30</span> <span class="keyword">end</span></code></pre>
|
271
|
+
</div>
|
272
|
+
</dd>
|
273
|
+
</dl>
|
274
|
+
</div>
|
275
|
+
<script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>x seconds</strong>";</script>
|
276
|
+
<script type="text/javascript">document.getElementById('totals').innerHTML = "5 examples, 2 failures, 2 pending";</script>
|
277
|
+
</div>
|
278
|
+
</div>
|
279
|
+
</body>
|
280
|
+
</html>
|
@@ -25,12 +25,14 @@ module RSpec
|
|
25
25
|
end
|
26
26
|
|
27
27
|
let(:expected_html) do
|
28
|
-
|
28
|
+
unless File.file?(expected_file)
|
29
|
+
raise "There is no HTML file with expected content for this platform: #{expected_file}"
|
30
|
+
end
|
29
31
|
File.read(expected_file)
|
30
32
|
end
|
31
33
|
|
32
34
|
before do
|
33
|
-
RSpec.configuration.stub(:
|
35
|
+
RSpec.configuration.stub(:load_spec_files) do
|
34
36
|
RSpec.configuration.files_to_run.map {|f| load File.expand_path(f) }
|
35
37
|
end
|
36
38
|
end
|
@@ -45,7 +47,7 @@ module RSpec
|
|
45
47
|
# end
|
46
48
|
# end
|
47
49
|
|
48
|
-
it "
|
50
|
+
it "produces HTML identical to the one we designed manually" do
|
49
51
|
Dir.chdir(root) do
|
50
52
|
actual_doc = Nokogiri::HTML(generated_html)
|
51
53
|
actual_backtraces = actual_doc.search("div.backtrace").collect {|e| e.at("pre").inner_html}
|
@@ -10,19 +10,19 @@ describe RSpec::Core::Formatters::ProgressFormatter do
|
|
10
10
|
@formatter.stub!(:color_enabled?).and_return(false)
|
11
11
|
end
|
12
12
|
|
13
|
-
it "
|
13
|
+
it "produces line break on start dump" do
|
14
14
|
@formatter.start_dump
|
15
15
|
@output.string.should == "\n"
|
16
16
|
end
|
17
17
|
|
18
|
-
it "
|
18
|
+
it "produces standard summary without pending when pending has a 0 count" do
|
19
19
|
@formatter.start_dump
|
20
20
|
@formatter.dump_summary(0.00001, 2, 0, 0)
|
21
21
|
@output.string.should =~ /2 examples, 0 failures/i
|
22
22
|
@output.string.should_not =~ /0 pending/i
|
23
23
|
end
|
24
24
|
|
25
|
-
it "
|
25
|
+
it "pushes nothing on start" do
|
26
26
|
@formatter.start(4)
|
27
27
|
@output.string.should == ""
|
28
28
|
end
|
@@ -5,11 +5,11 @@ module RSpec
|
|
5
5
|
module Core
|
6
6
|
module Formatters
|
7
7
|
describe SnippetExtractor do
|
8
|
-
it "
|
8
|
+
it "falls back on a default message when it doesn't understand a line" do
|
9
9
|
RSpec::Core::Formatters::SnippetExtractor.new.snippet_for("blech").should == ["# Couldn't get snippet for blech", 1]
|
10
10
|
end
|
11
11
|
|
12
|
-
it "
|
12
|
+
it "falls back on a default message when it doesn't find the file" do
|
13
13
|
RSpec::Core::Formatters::SnippetExtractor.new.lines_around("blech", 8).should == "# Couldn't get snippet for blech"
|
14
14
|
end
|
15
15
|
end
|
@@ -0,0 +1,280 @@
|
|
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
|
+
<script type="text/javascript">
|
20
|
+
// <![CDATA[
|
21
|
+
function moveProgressBar(percentDone) {
|
22
|
+
document.getElementById("rspec-header").style.width = percentDone +"%";
|
23
|
+
}
|
24
|
+
function makeRed(element_id) {
|
25
|
+
document.getElementById(element_id).style.background = '#C40D0D';
|
26
|
+
document.getElementById(element_id).style.color = '#FFFFFF';
|
27
|
+
}
|
28
|
+
|
29
|
+
function makeYellow(element_id) {
|
30
|
+
if (element_id == "rspec-header" && document.getElementById(element_id).style.background != '#C40D0D')
|
31
|
+
{
|
32
|
+
document.getElementById(element_id).style.background = '#FAF834';
|
33
|
+
document.getElementById(element_id).style.color = '#000000';
|
34
|
+
}
|
35
|
+
else
|
36
|
+
{
|
37
|
+
document.getElementById(element_id).style.background = '#FAF834';
|
38
|
+
document.getElementById(element_id).style.color = '#000000';
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
// ]]>
|
43
|
+
</script>
|
44
|
+
<style type="text/css">
|
45
|
+
#rspec-header {
|
46
|
+
background: #65C400; color: #fff; height: 4em;
|
47
|
+
}
|
48
|
+
|
49
|
+
.rspec-report h1 {
|
50
|
+
margin: 0px 10px 0px 10px;
|
51
|
+
padding: 10px;
|
52
|
+
font-family: "Lucida Grande", Helvetica, sans-serif;
|
53
|
+
font-size: 1.8em;
|
54
|
+
position: absolute;
|
55
|
+
}
|
56
|
+
|
57
|
+
#summary {
|
58
|
+
margin: 0; padding: 5px 10px;
|
59
|
+
font-family: "Lucida Grande", Helvetica, sans-serif;
|
60
|
+
text-align: right;
|
61
|
+
top: 0px;
|
62
|
+
right: 0px;
|
63
|
+
float:right;
|
64
|
+
}
|
65
|
+
|
66
|
+
#summary p {
|
67
|
+
margin: 0 0 0 2px;
|
68
|
+
}
|
69
|
+
|
70
|
+
#summary #totals {
|
71
|
+
font-size: 1.2em;
|
72
|
+
}
|
73
|
+
|
74
|
+
.example_group {
|
75
|
+
margin: 0 10px 5px;
|
76
|
+
background: #fff;
|
77
|
+
}
|
78
|
+
|
79
|
+
dl {
|
80
|
+
margin: 0; padding: 0 0 5px;
|
81
|
+
font: normal 11px "Lucida Grande", Helvetica, sans-serif;
|
82
|
+
}
|
83
|
+
|
84
|
+
dt {
|
85
|
+
padding: 3px;
|
86
|
+
background: #65C400;
|
87
|
+
color: #fff;
|
88
|
+
font-weight: bold;
|
89
|
+
}
|
90
|
+
|
91
|
+
dd {
|
92
|
+
margin: 5px 0 5px 5px;
|
93
|
+
padding: 3px 3px 3px 18px;
|
94
|
+
}
|
95
|
+
|
96
|
+
dd.spec.passed {
|
97
|
+
border-left: 5px solid #65C400;
|
98
|
+
border-bottom: 1px solid #65C400;
|
99
|
+
background: #DBFFB4; color: #3D7700;
|
100
|
+
}
|
101
|
+
|
102
|
+
dd.spec.failed {
|
103
|
+
border-left: 5px solid #C20000;
|
104
|
+
border-bottom: 1px solid #C20000;
|
105
|
+
color: #C20000; background: #FFFBD3;
|
106
|
+
}
|
107
|
+
|
108
|
+
dd.spec.not_implemented {
|
109
|
+
border-left: 5px solid #FAF834;
|
110
|
+
border-bottom: 1px solid #FAF834;
|
111
|
+
background: #FCFB98; color: #131313;
|
112
|
+
}
|
113
|
+
|
114
|
+
dd.spec.pending_fixed {
|
115
|
+
border-left: 5px solid #0000C2;
|
116
|
+
border-bottom: 1px solid #0000C2;
|
117
|
+
color: #0000C2; background: #D3FBFF;
|
118
|
+
}
|
119
|
+
|
120
|
+
.backtrace {
|
121
|
+
color: #000;
|
122
|
+
font-size: 12px;
|
123
|
+
}
|
124
|
+
|
125
|
+
a {
|
126
|
+
color: #BE5C00;
|
127
|
+
}
|
128
|
+
|
129
|
+
/* Ruby code, style similar to vibrant ink */
|
130
|
+
.ruby {
|
131
|
+
font-size: 12px;
|
132
|
+
font-family: monospace;
|
133
|
+
color: white;
|
134
|
+
background-color: black;
|
135
|
+
padding: 0.1em 0 0.2em 0;
|
136
|
+
}
|
137
|
+
|
138
|
+
.ruby .keyword { color: #FF6600; }
|
139
|
+
.ruby .constant { color: #339999; }
|
140
|
+
.ruby .attribute { color: white; }
|
141
|
+
.ruby .global { color: white; }
|
142
|
+
.ruby .module { color: white; }
|
143
|
+
.ruby .class { color: white; }
|
144
|
+
.ruby .string { color: #66FF00; }
|
145
|
+
.ruby .ident { color: white; }
|
146
|
+
.ruby .method { color: #FFCC00; }
|
147
|
+
.ruby .number { color: white; }
|
148
|
+
.ruby .char { color: white; }
|
149
|
+
.ruby .comment { color: #9933CC; }
|
150
|
+
.ruby .symbol { color: white; }
|
151
|
+
.ruby .regex { color: #44B4CC; }
|
152
|
+
.ruby .punct { color: white; }
|
153
|
+
.ruby .escape { color: white; }
|
154
|
+
.ruby .interp { color: white; }
|
155
|
+
.ruby .expr { color: white; }
|
156
|
+
|
157
|
+
.ruby .offending { background-color: gray; }
|
158
|
+
.ruby .linenum {
|
159
|
+
width: 75px;
|
160
|
+
padding: 0.1em 1em 0.2em 0;
|
161
|
+
color: #000000;
|
162
|
+
background-color: #FFFBD3;
|
163
|
+
}
|
164
|
+
|
165
|
+
</style>
|
166
|
+
</head>
|
167
|
+
<body>
|
168
|
+
<div class="rspec-report">
|
169
|
+
|
170
|
+
<div id="rspec-header">
|
171
|
+
<div id="label">
|
172
|
+
<h1>RSpec Code Examples</h1>
|
173
|
+
</div>
|
174
|
+
|
175
|
+
<div id="summary">
|
176
|
+
<p id="totals"> </p>
|
177
|
+
<p id="duration"> </p>
|
178
|
+
</div>
|
179
|
+
</div>
|
180
|
+
|
181
|
+
<div class="results">
|
182
|
+
<div class="example_group">
|
183
|
+
<dl>
|
184
|
+
<dt id="example_group_1">pending spec with no implementation</dt>
|
185
|
+
<script type="text/javascript">makeYellow('rspec-header');</script>
|
186
|
+
<script type="text/javascript">makeYellow('example_group_1');</script>
|
187
|
+
<script type="text/javascript">moveProgressBar('20.0');</script>
|
188
|
+
<dd class="spec not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: Not Yet Implemented)</span></dd>
|
189
|
+
</dl>
|
190
|
+
</div>
|
191
|
+
<div class="example_group">
|
192
|
+
<dl>
|
193
|
+
<dt id="example_group_2">pending command with block format</dt>
|
194
|
+
</dl>
|
195
|
+
</div>
|
196
|
+
<div class="example_group">
|
197
|
+
<dl>
|
198
|
+
<dt id="example_group_3">with content that would fail</dt>
|
199
|
+
<script type="text/javascript">makeYellow('rspec-header');</script>
|
200
|
+
<script type="text/javascript">makeYellow('example_group_3');</script>
|
201
|
+
<script type="text/javascript">moveProgressBar('40.0');</script>
|
202
|
+
<dd class="spec not_implemented"><span class="not_implemented_spec_name">is pending (PENDING: No reason given)</span></dd>
|
203
|
+
</dl>
|
204
|
+
</div>
|
205
|
+
<div class="example_group">
|
206
|
+
<dl>
|
207
|
+
<dt id="example_group_4">with content that would pass</dt>
|
208
|
+
<script type="text/javascript">makeRed('rspec-header');</script>
|
209
|
+
<script type="text/javascript">makeRed('example_group_4');</script>
|
210
|
+
<script type="text/javascript">moveProgressBar('60.0');</script>
|
211
|
+
<dd class="spec pending_fixed">
|
212
|
+
<span class="failed_spec_name">fails</span>
|
213
|
+
<div class="failure" id="failure_0">
|
214
|
+
<div class="message"><pre>RSpec::Core::PendingExampleFixedError</pre></div>
|
215
|
+
<div class="backtrace"><pre><a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/resources/formatter_specs.rb&line=19">./spec/rspec/core/resources/formatter_specs.rb:19</a>
|
216
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=23">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:23</a>
|
217
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=43">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:43</a>
|
218
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=43">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:43</a> :in `open'
|
219
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=43">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:43</a>
|
220
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=42">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:42</a> :in `chdir'
|
221
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=42">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:42</a>
|
222
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/spec_helper.rb&line=70">./spec/spec_helper.rb:70</a> :in `__instance_exec0'
|
223
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/spec_helper.rb&line=46">./spec/spec_helper.rb:46</a> :in `instance_eval'
|
224
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/spec_helper.rb&line=46">./spec/spec_helper.rb:46</a> :in `sandboxed'
|
225
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/spec_helper.rb&line=70">./spec/spec_helper.rb:70</a> :in `__instance_exec0'</pre></div>
|
226
|
+
<pre class="ruby"><code><span class="linenum">11</span> <span class="keyword">rescue</span> <span class="constant">Exception</span> <span class="punct">=></span> <span class="ident">e</span>
|
227
|
+
<span class="linenum">12</span> <span class="keyword">end</span>
|
228
|
+
<span class="offending"><span class="linenum">13</span> <span class="keyword">raise</span> <span class="constant">RSpec</span><span class="punct">::</span><span class="constant">Core</span><span class="punct">::</span><span class="constant">PendingExampleFixedError</span><span class="punct">.</span><span class="ident">new</span> <span class="keyword">if</span> <span class="ident">result</span></span>
|
229
|
+
<span class="linenum">14</span> <span class="keyword">end</span>
|
230
|
+
<span class="linenum">15</span> <span class="ident">throw</span> <span class="symbol">:pending_declared_in_example</span><span class="punct">,</span> <span class="ident">message</span></code></pre>
|
231
|
+
</div>
|
232
|
+
</dd>
|
233
|
+
</dl>
|
234
|
+
</div>
|
235
|
+
<div class="example_group">
|
236
|
+
<dl>
|
237
|
+
<dt id="example_group_5">passing spec</dt>
|
238
|
+
<script type="text/javascript">moveProgressBar('80.0');</script>
|
239
|
+
<dd class="spec passed"><span class="passed_spec_name">passes</span></dd>
|
240
|
+
</dl>
|
241
|
+
</div>
|
242
|
+
<div class="example_group">
|
243
|
+
<dl>
|
244
|
+
<dt id="example_group_6">failing spec</dt>
|
245
|
+
<script type="text/javascript">makeRed('example_group_6');</script>
|
246
|
+
<script type="text/javascript">moveProgressBar('100.0');</script>
|
247
|
+
<dd class="spec failed">
|
248
|
+
<span class="failed_spec_name">fails</span>
|
249
|
+
<div class="failure" id="failure_0">
|
250
|
+
<div class="message"><pre>
|
251
|
+
expected 2
|
252
|
+
got 1
|
253
|
+
|
254
|
+
(compared using ==)
|
255
|
+
</pre></div>
|
256
|
+
<div class="backtrace"><pre><a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/resources/formatter_specs.rb&line=34">./spec/rspec/core/resources/formatter_specs.rb:34</a>
|
257
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=23">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:23</a>
|
258
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=43">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:43</a>
|
259
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=43">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:43</a> :in `open'
|
260
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=43">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:43</a>
|
261
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=42">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:42</a> :in `chdir'
|
262
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/rspec/core/formatters/text_mate_formatter_spec.rb&line=42">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:42</a>
|
263
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/spec_helper.rb&line=70">./spec/spec_helper.rb:70</a> :in `__instance_exec0'
|
264
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/spec_helper.rb&line=46">./spec/spec_helper.rb:46</a> :in `instance_eval'
|
265
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/spec_helper.rb&line=46">./spec/spec_helper.rb:46</a> :in `sandboxed'
|
266
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/spec_helper.rb&line=70">./spec/spec_helper.rb:70</a> :in `__instance_exec0'</pre></div>
|
267
|
+
<pre class="ruby"><code><span class="linenum">27</span> <span class="keyword">end</span>
|
268
|
+
<span class="linenum">28</span>
|
269
|
+
<span class="offending"><span class="linenum">29</span> <span class="keyword">raise</span><span class="punct">(</span><span class="constant">RSpec</span><span class="punct">::</span><span class="constant">Expectations</span><span class="punct">::</span><span class="constant">ExpectationNotMetError</span><span class="punct">.</span><span class="ident">new</span><span class="punct">(</span><span class="ident">message</span><span class="punct">))</span></span>
|
270
|
+
<span class="linenum">30</span> <span class="keyword">end</span></code></pre>
|
271
|
+
</div>
|
272
|
+
</dd>
|
273
|
+
</dl>
|
274
|
+
</div>
|
275
|
+
<script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>x seconds</strong>";</script>
|
276
|
+
<script type="text/javascript">document.getElementById('totals').innerHTML = "5 examples, 2 failures, 2 pending";</script>
|
277
|
+
</div>
|
278
|
+
</div>
|
279
|
+
</body>
|
280
|
+
</html>
|