rspec 1.3.1 → 1.3.2

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.
@@ -17,12 +17,17 @@ if Spec::Ruby.version.to_f < 1.9
17
17
  # Runs all the example groups held by +rspec_options+ once for each of the
18
18
  # methods in the matched classes.
19
19
  def heckle_with
20
- if @filter =~ /(.*)[#\.](.*)/
21
- heckle_method($1, $2)
20
+ case @filter
21
+ when /(.*)#(.*)/ then heckle_method($1, $2)
22
+ when /(.*)\.(.*)/ then heckle_class_method($1, $2)
22
23
  else
23
24
  heckle_class_or_module(@filter)
24
25
  end
25
26
  end
27
+
28
+ def heckle_class_method(class_name, method_name)
29
+ heckle_method(class_name, "self.#{method_name}")
30
+ end
26
31
 
27
32
  def heckle_method(class_name, method_name)
28
33
  verify_constant(class_name)
@@ -3,7 +3,7 @@ module Spec # :nodoc:
3
3
  unless defined? MAJOR
4
4
  MAJOR = 1
5
5
  MINOR = 3
6
- TINY = 1
6
+ TINY = 2
7
7
  PRE = nil
8
8
 
9
9
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
@@ -0,0 +1,26 @@
1
+ # -*- encoding: utf-8 -*-
2
+ $:.push File.expand_path("../lib", __FILE__)
3
+ require "spec/version"
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "rspec"
7
+ s.version = Spec::VERSION::STRING
8
+ s.platform = Gem::Platform::RUBY
9
+ s.authors = ["The RSpec Development Team"]
10
+ s.email = ["rspec-devel@rubyforge.org"]
11
+ s.homepage = ""
12
+ s.summary = Spec::VERSION::SUMMARY
13
+ s.description = "Behaviour Driven Development for Ruby."
14
+
15
+ s.rubyforge_project = "rspec"
16
+
17
+ s.files = `git ls-files`.split("\n")
18
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
20
+ s.require_paths = ["lib"]
21
+
22
+ s.add_development_dependency("cucumber",">=0.3")
23
+ s.add_development_dependency("fakefs",">=0.2.1")
24
+ s.add_development_dependency("syntax",">=1.0")
25
+ s.add_development_dependency("diff-lcs",">=1.1.2")
26
+ end
@@ -0,0 +1,22 @@
1
+ require "spec_helper"
2
+
3
+ describe Spec::Matchers::Pretty do
4
+ let(:helper) do
5
+ Class.new do
6
+ include Spec::Matchers::Pretty
7
+ end.new
8
+ end
9
+ describe "to_sentence" do
10
+ context "given an empty array" do
11
+ it "returns empty string" do
12
+ helper.to_sentence([]).should == ""
13
+ end
14
+ end
15
+
16
+ context "given nil" do
17
+ it "returns empty string" do
18
+ helper.to_sentence.should == ""
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+
3
+ class Bug1049Class
4
+
5
+ def self.singleton
6
+ @singleton ||= new
7
+ end
8
+
9
+ # Redirect all missing class methods to the singleton instance for backwards compatible API
10
+ def self.method_missing(name,*args,&block)
11
+ self.singleton.send(name,*args,&block)
12
+ end
13
+
14
+ def bar
15
+ "abc"
16
+ end
17
+ end
18
+
19
+ describe Bug1049Class do
20
+
21
+ it "should mock correctly" do
22
+ Bug1049Class.should_receive(:bar).and_return(123)
23
+ Bug1049Class.bar.should == 123
24
+ end
25
+
26
+ it "should call successfully after a mock" do
27
+ Bug1049Class.bar.should == "abc"
28
+ end
29
+
30
+ end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ module Spec
4
+ module Mocks
5
+ describe "stubbing a base class class method" do
6
+ before do
7
+ @base_class = Class.new
8
+ @concrete_class = Class.new(@base_class)
9
+
10
+ @base_class.stub!(:find).and_return "stubbed_value"
11
+ end
12
+
13
+ it "should return the value for the stub on the base class" do
14
+ @base_class.find.should == "stubbed_value"
15
+ end
16
+
17
+ it "should return the value for the descendent class" do
18
+ @concrete_class.find.should == "stubbed_value"
19
+ end
20
+ end
21
+ end
22
+ end
@@ -464,6 +464,13 @@ module Spec
464
464
  @mock.rspec_verify
465
465
  end
466
466
 
467
+ it "should return the stubbed value when stubbed with args and no new value specified" do
468
+ @mock.stub!(:msg).with(:arg).and_return(:stub_value)
469
+ @mock.should_receive(:msg).with(:arg)
470
+ @mock.msg(:arg).should equal(:stub_value)
471
+ @mock.rspec_verify
472
+ end
473
+
467
474
  it "should not mess with the stub's yielded values when also mocked" do
468
475
  @mock.stub!(:yield_back).and_yield(:stub_value)
469
476
  @mock.should_receive(:yield_back).and_yield(:mock_value)
@@ -165,13 +165,13 @@ module Spec
165
165
  it "should complain if called with no arg" do
166
166
  lambda do
167
167
  @stub.foo
168
- end.should raise_error
168
+ end.should raise_error(/received :foo with unexpected arguments/)
169
169
  end
170
170
 
171
171
  it "should complain if called with other arg" do
172
172
  lambda do
173
173
  @stub.foo("other")
174
- end.should raise_error
174
+ end.should raise_error(/received :foo with unexpected arguments/)
175
175
  end
176
176
 
177
177
  it "should not complain if also mocked w/ different args" do
@@ -0,0 +1,377 @@
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">&nbsp;</p>
177
+ <p id="duration">&nbsp;</p>
178
+ </div>
179
+ </div>
180
+
181
+ <div class="results">
182
+ <div class="example_group">
183
+ <dl>
184
+ <dt id="example_group_1">Mocker</dt>
185
+ <script type="text/javascript">moveProgressBar('5.8');</script>
186
+ <dd class="spec passed"><span class="passed_spec_name">should be able to call mock()</span></dd>
187
+ <script type="text/javascript">makeRed('rspec-header');</script>
188
+ <script type="text/javascript">makeRed('example_group_1');</script>
189
+ <script type="text/javascript">moveProgressBar('11.7');</script>
190
+ <dd class="spec failed">
191
+ <span class="failed_spec_name">should fail when expected message not received</span>
192
+ <div class="failure" id="failure_1">
193
+ <div class="message"><pre>Mock &quot;poke me&quot; expected :poke with (any args) once, but received it 0 times</pre></div>
194
+ <div class="backtrace"><pre>./examples/failing/mocking_example.rb:11:in `block (2 levels) in <top (required)>'
195
+ ./spec/spec_helper.rb:42:in `run_with'
196
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:41:in `block (4 levels) in <module:Formatter>'
197
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:29:in `chdir'
198
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:29:in `block (3 levels) in <module:Formatter>'</pre></div>
199
+ <pre class="ruby"><code><span class="linenum">9</span> <span class="ident">it</span> <span class="punct">&quot;</span><span class="string">should fail when expected message not received</span><span class="punct">&quot;</span> <span class="keyword">do</span>
200
+ <span class="linenum">10</span> <span class="ident">mock</span> <span class="punct">=</span> <span class="ident">mock</span><span class="punct">(&quot;</span><span class="string">poke me</span><span class="punct">&quot;)</span>
201
+ <span class="offending"><span class="linenum">11</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">should_receive</span><span class="punct">(</span><span class="symbol">:poke</span><span class="punct">)</span></span>
202
+ <span class="linenum">12</span> <span class="keyword">end</span>
203
+ <span class="linenum">13</span> </code></pre>
204
+ </div>
205
+ </dd>
206
+ <script type="text/javascript">moveProgressBar('17.6');</script>
207
+ <dd class="spec failed">
208
+ <span class="failed_spec_name">should fail when messages are received out of order</span>
209
+ <div class="failure" id="failure_2">
210
+ <div class="message"><pre>Mock &quot;one two three&quot; received :three out of order</pre></div>
211
+ <div class="backtrace"><pre>./examples/failing/mocking_example.rb:20:in `block (2 levels) in <top (required)>'
212
+ ./spec/spec_helper.rb:42:in `run_with'
213
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:41:in `block (4 levels) in <module:Formatter>'
214
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:29:in `chdir'
215
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:29:in `block (3 levels) in <module:Formatter>'</pre></div>
216
+ <pre class="ruby"><code><span class="linenum">18</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">should_receive</span><span class="punct">(</span><span class="symbol">:three</span><span class="punct">).</span><span class="ident">ordered</span>
217
+ <span class="linenum">19</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">one</span>
218
+ <span class="offending"><span class="linenum">20</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">three</span></span>
219
+ <span class="linenum">21</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">two</span>
220
+ <span class="linenum">22</span> <span class="keyword">end</span></code></pre>
221
+ </div>
222
+ </dd>
223
+ <script type="text/javascript">moveProgressBar('23.5');</script>
224
+ <dd class="spec failed">
225
+ <span class="failed_spec_name">should get yelled at when sending unexpected messages</span>
226
+ <div class="failure" id="failure_3">
227
+ <div class="message"><pre>Mock &quot;don't talk to me&quot; expected :any_message_at_all with (no args) 0 times, but received it once</pre></div>
228
+ <div class="backtrace"><pre>./examples/failing/mocking_example.rb:27:in `block (2 levels) in <top (required)>'
229
+ ./spec/spec_helper.rb:42:in `run_with'
230
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:41:in `block (4 levels) in <module:Formatter>'
231
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:29:in `chdir'
232
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:29:in `block (3 levels) in <module:Formatter>'</pre></div>
233
+ <pre class="ruby"><code><span class="linenum">25</span> <span class="ident">mock</span> <span class="punct">=</span> <span class="ident">mock</span><span class="punct">(&quot;</span><span class="string">don't talk to me</span><span class="punct">&quot;)</span>
234
+ <span class="linenum">26</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">should_not_receive</span><span class="punct">(</span><span class="symbol">:any_message_at_all</span><span class="punct">)</span>
235
+ <span class="offending"><span class="linenum">27</span> <span class="ident">mock</span><span class="punct">.</span><span class="ident">any_message_at_all</span></span>
236
+ <span class="linenum">28</span> <span class="keyword">end</span></code></pre>
237
+ </div>
238
+ </dd>
239
+ <script type="text/javascript">moveProgressBar('29.4');</script>
240
+ <dd class="spec pending_fixed">
241
+ <span class="failed_spec_name">has a bug we need to fix</span>
242
+ <div class="failure" id="failure_4">
243
+ <div class="message"><pre>Expected pending 'here is the bug' to fail. No Error was raised.</pre></div>
244
+ <div class="backtrace"><pre>./examples/failing/mocking_example.rb:31:in `block (2 levels) in <top (required)>'
245
+ ./spec/spec_helper.rb:42:in `run_with'
246
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:41:in `block (4 levels) in <module:Formatter>'
247
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:29:in `chdir'
248
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:29:in `block (3 levels) in <module:Formatter>'</pre></div>
249
+ <pre class="ruby"><code><span class="linenum">29</span>
250
+ <span class="linenum">30</span> <span class="ident">it</span> <span class="punct">&quot;</span><span class="string">has a bug we need to fix</span><span class="punct">&quot;</span> <span class="keyword">do</span>
251
+ <span class="offending"><span class="linenum">31</span> <span class="ident">pending</span> <span class="punct">&quot;</span><span class="string">here is the bug</span><span class="punct">&quot;</span> <span class="keyword">do</span></span>
252
+ <span class="linenum">32</span> <span class="comment"># Actually, no. It's fixed. This will fail because it passes :-)</span>
253
+ <span class="linenum">33</span> <span class="ident">mock</span> <span class="punct">=</span> <span class="ident">mock</span><span class="punct">(&quot;</span><span class="string">Bug</span><span class="punct">&quot;)</span></code></pre>
254
+ </div>
255
+ </dd>
256
+ </dl>
257
+ </div>
258
+ <div class="example_group">
259
+ <dl>
260
+ <dt id="example_group_2">Running specs with --diff</dt>
261
+ <script type="text/javascript">makeRed('example_group_2');</script>
262
+ <script type="text/javascript">moveProgressBar('35.2');</script>
263
+ <dd class="spec failed">
264
+ <span class="failed_spec_name">should print diff of different strings</span>
265
+ <div class="failure" id="failure_5">
266
+ <div class="message"><pre>expected: &quot;RSpec is a\nbehaviour driven development\nframework for Ruby\n&quot;,
267
+ got: &quot;RSpec is a\nbehavior driven development\nframework for Ruby\n&quot; (using ==)
268
+
269
+ Diff:
270
+ @@ -1,4 +1,4 @@
271
+ RSpec is a
272
+ -behaviour driven development
273
+ +behavior driven development
274
+ framework for Ruby
275
+ </pre></div>
276
+ <div class="backtrace"><pre>./examples/failing/diffing_spec.rb:13:in `block (2 levels) in <top (required)>'
277
+ ./spec/spec_helper.rb:42:in `run_with'
278
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:41:in `block (4 levels) in <module:Formatter>'
279
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:29:in `chdir'
280
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:29:in `block (3 levels) in <module:Formatter>'</pre></div>
281
+ <pre class="ruby"><code><span class="linenum">11</span><span class="ident">framework</span> <span class="keyword">for</span> <span class="constant">Ruby</span>
282
+ <span class="linenum">12</span><span class="constant">EOF</span>
283
+ <span class="offending"><span class="linenum">13</span> <span class="ident">usa</span><span class="punct">.</span><span class="ident">should</span> <span class="punct">==</span> <span class="ident">uk</span></span>
284
+ <span class="linenum">14</span> <span class="keyword">end</span></code></pre>
285
+ </div>
286
+ </dd>
287
+ <script type="text/javascript">moveProgressBar('41.1');</script>
288
+ <dd class="spec failed">
289
+ <span class="failed_spec_name">should print diff of different objects' pretty representation</span>
290
+ <div class="failure" id="failure_6">
291
+ <div class="message"><pre>
292
+ expected &lt;Animal
293
+ name=bob,
294
+ species=tortoise
295
+ &gt;
296
+
297
+ got &lt;Animal
298
+ name=bob,
299
+ species=giraffe
300
+ &gt;
301
+
302
+
303
+ (compared using eql?)
304
+ </pre></div>
305
+ <div class="backtrace"><pre>./examples/failing/diffing_spec.rb:34:in `block (2 levels) in <top (required)>'
306
+ ./spec/spec_helper.rb:42:in `run_with'
307
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:41:in `block (4 levels) in <module:Formatter>'
308
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:29:in `chdir'
309
+ ./spec/spec/runner/formatter/html_formatter_spec.rb:29:in `block (3 levels) in <module:Formatter>'</pre></div>
310
+ <pre class="ruby"><code><span class="linenum">32</span> <span class="ident">expected</span> <span class="punct">=</span> <span class="constant">Animal</span><span class="punct">.</span><span class="ident">new</span> <span class="punct">&quot;</span><span class="string">bob</span><span class="punct">&quot;,</span> <span class="punct">&quot;</span><span class="string">giraffe</span><span class="punct">&quot;</span>
311
+ <span class="linenum">33</span> <span class="ident">actual</span> <span class="punct">=</span> <span class="constant">Animal</span><span class="punct">.</span><span class="ident">new</span> <span class="punct">&quot;</span><span class="string">bob</span><span class="punct">&quot;,</span> <span class="punct">&quot;</span><span class="string">tortoise</span><span class="punct">&quot;</span>
312
+ <span class="offending"><span class="linenum">34</span> <span class="ident">expected</span><span class="punct">.</span><span class="ident">should</span> <span class="ident">eql</span><span class="punct">(</span><span class="ident">actual</span><span class="punct">)</span></span>
313
+ <span class="linenum">35</span> <span class="keyword">end</span>
314
+ <span class="linenum">36</span><span class="keyword">end</span></code></pre>
315
+ </div>
316
+ </dd>
317
+ </dl>
318
+ </div>
319
+ <div class="example_group">
320
+ <dl>
321
+ <dt id="example_group_3">A consumer of a stub</dt>
322
+ <script type="text/javascript">moveProgressBar('47.0');</script>
323
+ <dd class="spec passed"><span class="passed_spec_name">should be able to stub methods on any Object</span></dd>
324
+ </dl>
325
+ </div>
326
+ <div class="example_group">
327
+ <dl>
328
+ <dt id="example_group_4">A stubbed method on a class</dt>
329
+ <script type="text/javascript">moveProgressBar('52.9');</script>
330
+ <dd class="spec passed"><span class="passed_spec_name">should return the stubbed value</span></dd>
331
+ <script type="text/javascript">moveProgressBar('58.8');</script>
332
+ <dd class="spec passed"><span class="passed_spec_name">should revert to the original method after each spec</span></dd>
333
+ <script type="text/javascript">moveProgressBar('64.7');</script>
334
+ <dd class="spec passed"><span class="passed_spec_name">can stub! and mock the same message</span></dd>
335
+ </dl>
336
+ </div>
337
+ <div class="example_group">
338
+ <dl>
339
+ <dt id="example_group_5">A mock</dt>
340
+ <script type="text/javascript">moveProgressBar('70.5');</script>
341
+ <dd class="spec passed"><span class="passed_spec_name">can stub!</span></dd>
342
+ <script type="text/javascript">moveProgressBar('76.4');</script>
343
+ <dd class="spec passed"><span class="passed_spec_name">can stub! and mock</span></dd>
344
+ <script type="text/javascript">moveProgressBar('82.3');</script>
345
+ <dd class="spec passed"><span class="passed_spec_name">can stub! and mock the same message</span></dd>
346
+ </dl>
347
+ </div>
348
+ <div class="example_group">
349
+ <dl>
350
+ <dt id="example_group_6">pending example (using pending method)</dt>
351
+ <script type="text/javascript">makeYellow('example_group_6');</script>
352
+ <script type="text/javascript">moveProgressBar('88.2');</script>
353
+ <dd class="spec not_implemented"><span class="not_implemented_spec_name">should be reported as &quot;PENDING: for some reason&quot; (PENDING: for some reason)</span></dd>
354
+ </dl>
355
+ </div>
356
+ <div class="example_group">
357
+ <dl>
358
+ <dt id="example_group_7">pending example (with no block)</dt>
359
+ <script type="text/javascript">makeYellow('example_group_7');</script>
360
+ <script type="text/javascript">moveProgressBar('94.1');</script>
361
+ <dd class="spec not_implemented"><span class="not_implemented_spec_name">should be reported as &quot;PENDING: Not Yet Implemented&quot; (PENDING: Not Yet Implemented)</span></dd>
362
+ </dl>
363
+ </div>
364
+ <div class="example_group">
365
+ <dl>
366
+ <dt id="example_group_8">pending example (with block for pending)</dt>
367
+ <script type="text/javascript">makeYellow('example_group_8');</script>
368
+ <script type="text/javascript">moveProgressBar('100.0');</script>
369
+ <dd class="spec not_implemented"><span class="not_implemented_spec_name">should have a failing block, passed to pending, reported as &quot;PENDING: for some reason&quot; (PENDING: for some reason)</span></dd>
370
+ </dl>
371
+ </div>
372
+ <script type="text/javascript">document.getElementById('duration').innerHTML = "Finished in <strong>x seconds</strong>";</script>
373
+ <script type="text/javascript">document.getElementById('totals').innerHTML = "17 examples, 6 failures, 3 pending";</script>
374
+ </div>
375
+ </div>
376
+ </body>
377
+ </html>