mofo 0.1 → 0.1.1
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.
- data/CHANGELOG +4 -0
- data/lib/microformat.rb +11 -1
- data/lib/microformat/simple.rb +21 -17
- data/lib/mofo/hentry.rb +1 -1
- data/lib/mofo/hreview.rb +0 -2
- data/lib/mofo/rel_tag.rb +0 -1
- data/tests/fixtures/bob.html +69 -0
- data/tests/fixtures/chowhound.html +1052 -0
- data/tests/fixtures/corkd.html +403 -0
- data/tests/fixtures/events.html +39 -0
- data/tests/fixtures/fake.html +1 -0
- data/tests/fixtures/fauxtank.html +535 -0
- data/tests/fixtures/hatom.html +1101 -0
- data/tests/fixtures/simple.html +5 -0
- data/tests/fixtures/upcoming.html +335 -0
- data/tests/format_test.rb +230 -0
- data/tests/hatom_test.rb +39 -0
- data/tests/test_helper.rb +6 -0
- data/tests/xoxo_test.rb +49 -0
- data/vendor/testspec-0.2.0/ChangeLog +120 -0
- data/vendor/testspec-0.2.0/README +206 -0
- data/vendor/testspec-0.2.0/ROADMAP +3 -0
- data/vendor/testspec-0.2.0/Rakefile +86 -0
- data/vendor/testspec-0.2.0/SPECS +101 -0
- data/vendor/testspec-0.2.0/TODO +1 -0
- data/vendor/testspec-0.2.0/bin/specrb +103 -0
- data/vendor/testspec-0.2.0/examples/stack.rb +38 -0
- data/vendor/testspec-0.2.0/examples/stack_spec.rb +119 -0
- data/vendor/testspec-0.2.0/lib/test/spec.rb +366 -0
- data/vendor/testspec-0.2.0/lib/test/spec/dox.rb +114 -0
- data/vendor/testspec-0.2.0/lib/test/spec/rdox.rb +25 -0
- data/vendor/testspec-0.2.0/lib/test/spec/should-output.rb +48 -0
- data/vendor/testspec-0.2.0/rdoc/classes/Kernel.html +105 -0
- data/vendor/testspec-0.2.0/rdoc/classes/Object.html +154 -0
- data/vendor/testspec-0.2.0/rdoc/classes/Test/Spec.html +132 -0
- data/vendor/testspec-0.2.0/rdoc/classes/Test/Spec/DefinitionError.html +111 -0
- data/vendor/testspec-0.2.0/rdoc/classes/Test/Spec/Should.html +863 -0
- data/vendor/testspec-0.2.0/rdoc/classes/Test/Spec/ShouldNot.html +411 -0
- data/vendor/testspec-0.2.0/rdoc/classes/Test/Spec/TestCase.html +220 -0
- data/vendor/testspec-0.2.0/rdoc/classes/Test/Spec/TestCase/ClassMethods.html +290 -0
- data/vendor/testspec-0.2.0/rdoc/classes/Test/Spec/TestCase/InstanceMethods.html +195 -0
- data/vendor/testspec-0.2.0/rdoc/classes/Test/Unit/UI/RDox/TestRunner.html +222 -0
- data/vendor/testspec-0.2.0/rdoc/classes/Test/Unit/UI/SpecDox/TestRunner.html +468 -0
- data/vendor/testspec-0.2.0/rdoc/created.rid +1 -0
- data/vendor/testspec-0.2.0/rdoc/files/README.html +409 -0
- data/vendor/testspec-0.2.0/rdoc/files/ROADMAP.html +112 -0
- data/vendor/testspec-0.2.0/rdoc/files/SPECS.html +365 -0
- data/vendor/testspec-0.2.0/rdoc/files/lib/test/spec/dox_rb.html +108 -0
- data/vendor/testspec-0.2.0/rdoc/files/lib/test/spec/rdox_rb.html +108 -0
- data/vendor/testspec-0.2.0/rdoc/files/lib/test/spec/should-output_rb.html +114 -0
- data/vendor/testspec-0.2.0/rdoc/files/lib/test/spec_rb.html +123 -0
- data/vendor/testspec-0.2.0/rdoc/fr_class_index.html +37 -0
- data/vendor/testspec-0.2.0/rdoc/fr_file_index.html +33 -0
- data/vendor/testspec-0.2.0/rdoc/fr_method_index.html +95 -0
- data/vendor/testspec-0.2.0/rdoc/index.html +24 -0
- data/vendor/testspec-0.2.0/rdoc/rdoc-style.css +208 -0
- data/vendor/testspec-0.2.0/test/spec_dox.rb +39 -0
- data/vendor/testspec-0.2.0/test/spec_flexmock.rb +210 -0
- data/vendor/testspec-0.2.0/test/spec_mocha.rb +118 -0
- data/vendor/testspec-0.2.0/test/spec_nestedcontexts.rb +26 -0
- data/vendor/testspec-0.2.0/test/spec_should-output.rb +26 -0
- data/vendor/testspec-0.2.0/test/spec_testspec.rb +311 -0
- data/vendor/testspec-0.2.0/test/spec_testspec_order.rb +26 -0
- data/vendor/testspec-0.2.0/test/test_testunit.rb +21 -0
- metadata +81 -2
@@ -0,0 +1,114 @@
|
|
1
|
+
require 'test/unit/ui/console/testrunner'
|
2
|
+
|
3
|
+
module Test::Unit::UI # :nodoc:
|
4
|
+
module SpecDox # :nodoc:
|
5
|
+
class TestRunner < Test::Unit::UI::Console::TestRunner
|
6
|
+
protected
|
7
|
+
def setup_mediator
|
8
|
+
@mediator = create_mediator(@suite)
|
9
|
+
suite_name = @suite.to_s
|
10
|
+
if ( @suite.kind_of?(Module) )
|
11
|
+
suite_name = @suite.name
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def add_fault(fault)
|
16
|
+
@faults << fault
|
17
|
+
word = fault.class.name[/(.*::)?(.*)/, 2].upcase
|
18
|
+
output_no_nl " (#{word} - #{@faults.size})"
|
19
|
+
end
|
20
|
+
|
21
|
+
def started(result)
|
22
|
+
@result = result
|
23
|
+
@context = nil
|
24
|
+
@contexts = []
|
25
|
+
indent 0
|
26
|
+
end
|
27
|
+
|
28
|
+
def finished(elapsed_time)
|
29
|
+
nl
|
30
|
+
output "Finished in #{elapsed_time} seconds."
|
31
|
+
@faults.each_with_index do |fault, index|
|
32
|
+
nl
|
33
|
+
output("%3d) %s" % [index + 1, fault.long_display])
|
34
|
+
end
|
35
|
+
nl
|
36
|
+
output_result
|
37
|
+
end
|
38
|
+
|
39
|
+
def output_result
|
40
|
+
r = "%d specifications (%d requirements), %d failures" % [
|
41
|
+
@result.run_count, @result.assertion_count, @result.failure_count]
|
42
|
+
r << ", #{@result.error_count} errors" if @result.error_count > 0
|
43
|
+
output r
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_started(name)
|
47
|
+
contextname, specname = unmangle name
|
48
|
+
return if contextname.nil? || specname.nil?
|
49
|
+
|
50
|
+
if @context != contextname
|
51
|
+
@context = contextname
|
52
|
+
|
53
|
+
@old_contexts = @contexts
|
54
|
+
@contexts = @context.split("\t")
|
55
|
+
|
56
|
+
common = 0
|
57
|
+
@contexts.zip(@old_contexts) { |a, b|
|
58
|
+
break if a != b
|
59
|
+
common += 1
|
60
|
+
}
|
61
|
+
|
62
|
+
nl if common == 0
|
63
|
+
|
64
|
+
@contexts[common..-1].each_with_index { |head, i|
|
65
|
+
indent common + i
|
66
|
+
output_heading head
|
67
|
+
}
|
68
|
+
end
|
69
|
+
|
70
|
+
output_item specname
|
71
|
+
end
|
72
|
+
|
73
|
+
def test_finished(name)
|
74
|
+
# Don't let empty contexts clutter up the output.
|
75
|
+
nl unless name =~ /\Adefault_test\(/
|
76
|
+
end
|
77
|
+
|
78
|
+
def output_no_nl(something, level=NORMAL)
|
79
|
+
@io.write(something) if (output?(level))
|
80
|
+
@io.flush
|
81
|
+
end
|
82
|
+
|
83
|
+
def output_item(item)
|
84
|
+
output_no_nl "#{@prefix}- #{item}"
|
85
|
+
end
|
86
|
+
|
87
|
+
def output_heading(heading)
|
88
|
+
output "#{@prefix}#{heading}"
|
89
|
+
end
|
90
|
+
|
91
|
+
def unmangle(name)
|
92
|
+
if name =~ /\Atest_spec \{(.*?)\} \d+ \[(.*)\]/
|
93
|
+
contextname = $1
|
94
|
+
specname = $2
|
95
|
+
elsif name =~ /test_(.*?)\((.*)\)$/
|
96
|
+
specname = $1
|
97
|
+
contextname = $2
|
98
|
+
|
99
|
+
contextname.gsub!(/^Test\B|\BTest$/, '')
|
100
|
+
specname.gsub!(/_/, ' ')
|
101
|
+
else
|
102
|
+
contextname = specname = nil
|
103
|
+
end
|
104
|
+
|
105
|
+
[contextname, specname]
|
106
|
+
end
|
107
|
+
|
108
|
+
def indent(depth)
|
109
|
+
@indent = depth
|
110
|
+
@prefix = " " * depth
|
111
|
+
end
|
112
|
+
end
|
113
|
+
end
|
114
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require 'test/spec/dox'
|
2
|
+
|
3
|
+
module Test::Unit::UI # :nodoc:
|
4
|
+
module RDox # :nodoc:
|
5
|
+
class TestRunner < Test::Unit::UI::SpecDox::TestRunner
|
6
|
+
def output_heading(heading)
|
7
|
+
output "#{@headprefix} #{heading}"
|
8
|
+
end
|
9
|
+
|
10
|
+
def output_item(item)
|
11
|
+
output_no_nl "* #{item}"
|
12
|
+
end
|
13
|
+
|
14
|
+
def finished(elapsed_time)
|
15
|
+
nl
|
16
|
+
output_result
|
17
|
+
end
|
18
|
+
|
19
|
+
def indent(depth)
|
20
|
+
@prefix = ""
|
21
|
+
@headprefix = "==" + "=" * depth
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
# Code adapted from rs, written by Eero Saynatkari.
|
2
|
+
require 'fileutils'
|
3
|
+
|
4
|
+
class Test::Spec::Should
|
5
|
+
# Captures output from the IO given as
|
6
|
+
# the second argument (STDIN by default)
|
7
|
+
# and matches it against a String or
|
8
|
+
# Regexp given as the first argument.
|
9
|
+
def output(expected, to = STDOUT)
|
10
|
+
# Store the old stream
|
11
|
+
old_to = to.dup
|
12
|
+
|
13
|
+
# Obtain a filehandle to replace (works with Readline)
|
14
|
+
to.reopen File.open("/tmp/should_output_#{$$}", "w+")
|
15
|
+
|
16
|
+
# Execute
|
17
|
+
@object.call
|
18
|
+
|
19
|
+
# Restore
|
20
|
+
out = to.dup
|
21
|
+
to.reopen old_to
|
22
|
+
|
23
|
+
# Grab the data
|
24
|
+
out.rewind
|
25
|
+
output = out.read
|
26
|
+
|
27
|
+
# Match up
|
28
|
+
case expected
|
29
|
+
when Regexp
|
30
|
+
output.should.match expected
|
31
|
+
else
|
32
|
+
output.should.equal expected
|
33
|
+
end # case expected
|
34
|
+
|
35
|
+
# Clean up
|
36
|
+
ensure
|
37
|
+
out.close
|
38
|
+
|
39
|
+
# STDIO redirection will break else
|
40
|
+
begin
|
41
|
+
to.seek 0, IO::SEEK_END
|
42
|
+
rescue Errno::ESPIPE
|
43
|
+
rescue Errno::EPIPE
|
44
|
+
end
|
45
|
+
|
46
|
+
FileUtils.rm_f out.path
|
47
|
+
end # output
|
48
|
+
end # Test::Spec::Should
|
@@ -0,0 +1,105 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: Kernel</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Kernel</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/test/spec_rb.html">
|
59
|
+
lib/test/spec.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
</div>
|
78
|
+
|
79
|
+
|
80
|
+
</div>
|
81
|
+
|
82
|
+
|
83
|
+
<!-- if includes -->
|
84
|
+
|
85
|
+
<div id="section">
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
<!-- if method_list -->
|
95
|
+
|
96
|
+
|
97
|
+
</div>
|
98
|
+
|
99
|
+
|
100
|
+
<div id="validator-badges">
|
101
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
102
|
+
</div>
|
103
|
+
|
104
|
+
</body>
|
105
|
+
</html>
|
@@ -0,0 +1,154 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Object</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Object</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/test/spec_rb.html">
|
59
|
+
lib/test/spec.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
<a href="Object.html">
|
69
|
+
Object
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
<div id="description">
|
84
|
+
<p>
|
85
|
+
Global helpers
|
86
|
+
</p>
|
87
|
+
|
88
|
+
</div>
|
89
|
+
|
90
|
+
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<div id="method-list">
|
94
|
+
<h3 class="section-bar">Methods</h3>
|
95
|
+
|
96
|
+
<div class="name-list">
|
97
|
+
<a href="#M000001">should</a>
|
98
|
+
</div>
|
99
|
+
</div>
|
100
|
+
|
101
|
+
</div>
|
102
|
+
|
103
|
+
|
104
|
+
<!-- if includes -->
|
105
|
+
|
106
|
+
<div id="section">
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
<!-- if method_list -->
|
116
|
+
<div id="methods">
|
117
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
118
|
+
|
119
|
+
<div id="method-M000001" class="method-detail">
|
120
|
+
<a name="M000001"></a>
|
121
|
+
|
122
|
+
<div class="method-heading">
|
123
|
+
<a href="#M000001" class="method-signature">
|
124
|
+
<span class="method-name">should</span><span class="method-args">()</span>
|
125
|
+
</a>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
<div class="method-description">
|
129
|
+
<p><a class="source-toggle" href="#"
|
130
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
131
|
+
<div class="method-source-code" id="M000001-source">
|
132
|
+
<pre>
|
133
|
+
<span class="ruby-comment cmt"># File lib/test/spec.rb, line 355</span>
|
134
|
+
355: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">should</span>
|
135
|
+
356: <span class="ruby-constant">Test</span><span class="ruby-operator">::</span><span class="ruby-constant">Spec</span><span class="ruby-operator">::</span><span class="ruby-constant">Should</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>)
|
136
|
+
357: <span class="ruby-keyword kw">end</span>
|
137
|
+
</pre>
|
138
|
+
</div>
|
139
|
+
</div>
|
140
|
+
</div>
|
141
|
+
|
142
|
+
|
143
|
+
</div>
|
144
|
+
|
145
|
+
|
146
|
+
</div>
|
147
|
+
|
148
|
+
|
149
|
+
<div id="validator-badges">
|
150
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
151
|
+
</div>
|
152
|
+
|
153
|
+
</body>
|
154
|
+
</html>
|