rspec-core 2.0.0.beta.15 → 2.0.0.beta.16
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +2 -0
- data/VERSION +1 -1
- data/features/README.markdown +12 -0
- data/features/command_line/example_name_option.feature +9 -9
- data/features/command_line/line_number_appended_to_path.feature +44 -44
- data/features/command_line/line_number_option.feature +4 -4
- data/features/configuration/custom_settings.feature +3 -3
- data/features/configuration/options_file.feature +3 -3
- data/features/example_groups/describe_aliases.feature +1 -1
- data/features/example_groups/nested_groups.feature +7 -7
- data/features/filtering/inclusion_filters.feature +10 -10
- data/features/formatters/custom_formatter.feature +1 -1
- data/features/hooks/around_hooks.feature +13 -13
- data/features/hooks/before_and_after_hooks.feature +38 -16
- data/features/hooks/described_class.feature +1 -1
- data/features/hooks/halt.feature +1 -1
- data/features/mock_framework_integration/use_flexmock.feature +1 -1
- data/features/mock_framework_integration/use_mocha.feature +1 -1
- data/features/mock_framework_integration/use_rr.feature +1 -1
- data/features/mock_framework_integration/use_rspec.feature +1 -1
- data/features/pending/pending_examples.feature +13 -13
- data/features/subject/explicit_subject.feature +4 -4
- data/features/subject/implicit_subject.feature +2 -2
- data/lib/rspec/core/backward_compatibility.rb +0 -6
- data/lib/rspec/core/command_line.rb +16 -27
- data/lib/rspec/core/configuration.rb +13 -4
- data/lib/rspec/core/example.rb +3 -2
- data/lib/rspec/core/formatters.rb +2 -11
- data/lib/rspec/core/formatters/base_formatter.rb +7 -3
- data/lib/rspec/core/formatters/base_text_formatter.rb +4 -0
- data/lib/rspec/core/formatters/html_formatter.rb +350 -0
- data/lib/rspec/core/formatters/snippet_extractor.rb +52 -0
- data/lib/rspec/core/formatters/text_mate_formatter.rb +18 -0
- data/lib/rspec/core/mocking/with_rspec.rb +6 -6
- data/lib/rspec/core/option_parser.rb +2 -0
- data/lib/rspec/core/runner.rb +11 -11
- data/lib/rspec/core/world.rb +10 -13
- data/rspec-core.gemspec +26 -10
- data/spec/rspec/core/command_line_spec.rb +1 -9
- data/spec/rspec/core/configuration_spec.rb +31 -15
- data/spec/rspec/core/drb_command_line_spec.rb +42 -34
- data/spec/rspec/core/formatters/html_formatted-1.8.7.html +280 -0
- data/spec/rspec/core/formatters/html_formatted-1.9.1.html +260 -0
- data/spec/rspec/core/formatters/html_formatted-1.9.2.html +260 -0
- data/spec/rspec/core/formatters/html_formatter_spec.rb +71 -0
- data/spec/rspec/core/formatters/snippet_extractor_spec.rb +18 -0
- data/spec/rspec/core/formatters/text_mate_formatted-1.8.7.html +280 -0
- data/spec/rspec/core/formatters/text_mate_formatter_spec.rb +67 -0
- data/spec/rspec/core/resources/formatter_specs.rb +36 -0
- data/spec/rspec/core/shared_example_group_spec.rb +12 -12
- data/spec/spec_helper.rb +26 -21
- metadata +28 -12
@@ -0,0 +1,260 @@
|
|
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:in `block (3 levels) in <top (required)>'</pre></div>
|
216
|
+
<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>
|
217
|
+
<span class="linenum">12</span> <span class="keyword">end</span>
|
218
|
+
<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>
|
219
|
+
<span class="linenum">14</span> <span class="keyword">end</span>
|
220
|
+
<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>
|
221
|
+
</div>
|
222
|
+
</dd>
|
223
|
+
</dl>
|
224
|
+
</div>
|
225
|
+
<div class="example_group">
|
226
|
+
<dl>
|
227
|
+
<dt id="example_group_5">passing spec</dt>
|
228
|
+
<script type="text/javascript">moveProgressBar('80.0');</script>
|
229
|
+
<dd class="spec passed"><span class="passed_spec_name">passes</span></dd>
|
230
|
+
</dl>
|
231
|
+
</div>
|
232
|
+
<div class="example_group">
|
233
|
+
<dl>
|
234
|
+
<dt id="example_group_6">failing spec</dt>
|
235
|
+
<script type="text/javascript">makeRed('example_group_6');</script>
|
236
|
+
<script type="text/javascript">moveProgressBar('100.0');</script>
|
237
|
+
<dd class="spec failed">
|
238
|
+
<span class="failed_spec_name">fails</span>
|
239
|
+
<div class="failure" id="failure_0">
|
240
|
+
<div class="message"><pre>
|
241
|
+
expected 2
|
242
|
+
got 1
|
243
|
+
|
244
|
+
(compared using ==)
|
245
|
+
</pre></div>
|
246
|
+
<div class="backtrace"><pre>./spec/rspec/core/resources/formatter_specs.rb:34:in `block (2 levels) in <top (required)>'</pre></div>
|
247
|
+
<pre class="ruby"><code><span class="linenum">27</span> <span class="keyword">end</span>
|
248
|
+
<span class="linenum">28</span>
|
249
|
+
<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>
|
250
|
+
<span class="linenum">30</span> <span class="keyword">end</span></code></pre>
|
251
|
+
</div>
|
252
|
+
</dd>
|
253
|
+
</dl>
|
254
|
+
</div>
|
255
|
+
<script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>x seconds</strong>";</script>
|
256
|
+
<script type="text/javascript">document.getElementById('totals').innerHTML = "5 examples, 2 failures, 2 pending";</script>
|
257
|
+
</div>
|
258
|
+
</div>
|
259
|
+
</body>
|
260
|
+
</html>
|
@@ -0,0 +1,71 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'nokogiri'
|
3
|
+
|
4
|
+
module RSpec
|
5
|
+
module Core
|
6
|
+
module Formatters
|
7
|
+
describe HtmlFormatter do
|
8
|
+
let(:jruby?) { ::RUBY_PLATFORM == 'java' }
|
9
|
+
let(:root) { File.expand_path("#{File.dirname(__FILE__)}/../../../..") }
|
10
|
+
let(:suffix) { jruby? ? '-jruby' : '' }
|
11
|
+
|
12
|
+
let(:expected_file) do
|
13
|
+
"#{File.dirname(__FILE__)}/html_formatted-#{::RUBY_VERSION}#{suffix}.html"
|
14
|
+
end
|
15
|
+
|
16
|
+
let(:generated_html) do
|
17
|
+
options = RSpec::Core::ConfigurationOptions.new(
|
18
|
+
%w[spec/rspec/core/resources/formatter_specs.rb --format html]
|
19
|
+
)
|
20
|
+
options.parse_options
|
21
|
+
err, out = StringIO.new, StringIO.new
|
22
|
+
command_line = RSpec::Core::CommandLine.new(options)
|
23
|
+
command_line.run(err, out)
|
24
|
+
out.string.gsub /\d+\.\d+ seconds/, 'x seconds'
|
25
|
+
end
|
26
|
+
|
27
|
+
let(:expected_html) do
|
28
|
+
raise "There is no HTML file with expected content for this platform: #{expected_file}" unless File.file?(expected_file)
|
29
|
+
File.read(expected_file)
|
30
|
+
end
|
31
|
+
|
32
|
+
before do
|
33
|
+
RSpec.configuration.stub(:require_files_to_run) do
|
34
|
+
RSpec.configuration.files_to_run.map {|f| load File.expand_path(f) }
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
# Uncomment this group temporarily in order to overwrite the expected
|
39
|
+
# with actual. Use with care!!!
|
40
|
+
# describe "file generator" do
|
41
|
+
# it "generates a new comparison file" do
|
42
|
+
# Dir.chdir(root) do
|
43
|
+
# File.open(expected_file, 'w') {|io| io.write(generated_html)}
|
44
|
+
# end
|
45
|
+
# end
|
46
|
+
# end
|
47
|
+
|
48
|
+
it "should produce HTML identical to the one we designed manually" do
|
49
|
+
Dir.chdir(root) do
|
50
|
+
actual_doc = Nokogiri::HTML(generated_html)
|
51
|
+
actual_backtraces = actual_doc.search("div.backtrace").collect {|e| e.at("pre").inner_html}
|
52
|
+
actual_doc.css("div.backtrace").remove
|
53
|
+
|
54
|
+
expected_doc = Nokogiri::HTML(expected_html)
|
55
|
+
expected_backtraces = expected_doc.search("div.backtrace").collect {|e| e.at("pre").inner_html}
|
56
|
+
expected_doc.search("div.backtrace").remove
|
57
|
+
|
58
|
+
actual_doc.inner_html.should == expected_doc.inner_html
|
59
|
+
|
60
|
+
expected_backtraces.each_with_index do |expected_line, i|
|
61
|
+
expected_path, expected_line_number, expected_suffix = expected_line.split(':')
|
62
|
+
actual_path, actual_line_number, actual_suffix = actual_backtraces[i].split(':')
|
63
|
+
File.expand_path(actual_path).should == File.expand_path(expected_path)
|
64
|
+
actual_line_number.should == expected_line_number
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'rspec/core/formatters/snippet_extractor'
|
3
|
+
|
4
|
+
module RSpec
|
5
|
+
module Core
|
6
|
+
module Formatters
|
7
|
+
describe SnippetExtractor do
|
8
|
+
it "should fall back on a default message when it doesn't understand a line" do
|
9
|
+
RSpec::Core::Formatters::SnippetExtractor.new.snippet_for("blech").should == ["# Couldn't get snippet for blech", 1]
|
10
|
+
end
|
11
|
+
|
12
|
+
it "should fall back on a default message when it doesn't find the file" do
|
13
|
+
RSpec::Core::Formatters::SnippetExtractor.new.lines_around("blech", 8).should == "# Couldn't get snippet for blech"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
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=38">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:38</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=38">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:38</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=38">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:38</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=37">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:37</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=37">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:37</a>
|
222
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/spec_helper.rb&line=73">./spec/spec_helper.rb:73</a>
|
223
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/spec_helper.rb&line=49">./spec/spec_helper.rb:49</a> :in `instance_eval'
|
224
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/spec_helper.rb&line=49">./spec/spec_helper.rb:49</a> :in `sandboxed'
|
225
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/spec_helper.rb&line=73">./spec/spec_helper.rb:73</a> </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=38">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:38</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=38">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:38</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=38">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:38</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=37">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:37</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=37">./spec/rspec/core/formatters/text_mate_formatter_spec.rb:37</a>
|
263
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/spec_helper.rb&line=73">./spec/spec_helper.rb:73</a>
|
264
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/spec_helper.rb&line=49">./spec/spec_helper.rb:49</a> :in `instance_eval'
|
265
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/spec_helper.rb&line=49">./spec/spec_helper.rb:49</a> :in `sandboxed'
|
266
|
+
<a href="txmt://open?url=file:///Users/dchelimsky/projects/ruby/rspec2/repos/rspec-core/spec/spec_helper.rb&line=73">./spec/spec_helper.rb:73</a> </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>
|