rspec 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGES +9 -5
- data/Rakefile +35 -29
- data/bin/spec +0 -5
- data/doc/README +5 -0
- data/doc/config.yaml +2 -0
- data/doc/plugin/syntax.rb +38 -0
- data/doc/reference/rspec reference.page +0 -0
- data/doc/src/community.page +8 -0
- data/doc/src/default.css +198 -0
- data/doc/src/default.template +34 -0
- data/doc/src/documentation/api.page +251 -0
- data/doc/src/documentation/index.page +8 -0
- data/doc/src/documentation/mocks.page +207 -0
- data/doc/src/documentation/specs.page +20 -0
- data/doc/src/download.page +8 -0
- data/doc/src/examples.page +9 -0
- data/doc/src/images/ul.gif +0 -0
- data/doc/src/index.page +8 -0
- data/doc/src/tools/index.page +8 -0
- data/doc/src/tools/rails.page +8 -0
- data/doc/src/tools/rake.page +8 -0
- data/doc/src/tools/rcov.page +8 -0
- data/doc/src/tools/spec_runner.page +8 -0
- data/doc/src/tools/specdoc.page +8 -0
- data/doc/src/tools/test2rspec.page +8 -0
- data/doc/src/ul.gif +0 -0
- data/doc/src/why_rspec.page +8 -0
- data/examples/mocking_spec.rb +2 -2
- data/examples/spec_framework_spec.rb +4 -4
- data/lib/spec/api/helper/have_helper.rb +55 -55
- data/lib/spec/api/mock.rb +111 -38
- data/lib/spec/runner/backtrace_tweaker.rb +4 -4
- data/lib/spec/runner/context.rb +2 -1
- data/lib/spec/runner/context_runner.rb +3 -3
- data/lib/spec/runner/option_parser.rb +8 -4
- data/lib/spec/runner/simple_text_reporter.rb +29 -19
- data/lib/spec/runner/specification.rb +2 -1
- data/lib/spec/version.rb +1 -1
- data/test/rake/rcov_testtask.rb +45 -0
- data/test/spec/api/helper/arbitrary_predicate_test.rb +39 -24
- data/test/spec/api/helper/equality_test.rb +19 -0
- data/test/spec/api/helper/should_have_test.rb +183 -0
- data/test/spec/api/mock_arg_constraints_test.rb +90 -0
- data/test/spec/api/mock_test.rb +101 -21
- data/test/spec/runner/context_runner_test.rb +3 -3
- data/test/spec/runner/context_test.rb +2 -5
- data/test/spec/runner/execution_context_test.rb +1 -1
- data/test/spec/runner/option_parser_test.rb +16 -8
- data/test/spec/runner/simple_text_reporter_test.rb +57 -33
- data/test/spec/runner/specification_test.rb +7 -7
- data/test/spec/tool/command_line_test.rb +4 -4
- data/test/test_helper.rb +2 -2
- metadata +37 -8
- data/README +0 -38
- data/TODO +0 -9
- data/TUTORIAL +0 -259
- data/WHY_RSPEC +0 -115
data/CHANGES
CHANGED
@@ -1,13 +1,17 @@
|
|
1
1
|
= RSpec Changelog
|
2
2
|
|
3
|
-
== Version 0.5.
|
3
|
+
== Version 0.5.1
|
4
|
+
This release is the first release of RSpec with a new website. It will look better soon.
|
4
5
|
|
5
|
-
|
6
|
-
*
|
6
|
+
* Added initial documentation for API [dastels]
|
7
|
+
* Added website based on webgen [aslak_hellesoy]
|
8
|
+
* Modified test task to use rcov [aslak_hellesoy]
|
9
|
+
* Deleted unused code (thanks, rcov!) [aslak_hellesoy]
|
10
|
+
* Various changes to the mock API [dastels]
|
7
11
|
|
8
|
-
== Version 0.
|
12
|
+
== Version 0.5.0
|
9
13
|
|
10
|
-
|
14
|
+
This release introduces a new API and obsoletes previous versions.
|
11
15
|
|
12
16
|
* Moved source code to separate subfolders
|
13
17
|
* Added new DSL runner based on instance_exec
|
data/Rakefile
CHANGED
@@ -9,6 +9,7 @@ require 'rake/testtask'
|
|
9
9
|
require 'rake/rdoctask'
|
10
10
|
require 'lib/spec/version'
|
11
11
|
require 'lib/spec/rake/spectask'
|
12
|
+
require 'test/rake/rcov_testtask'
|
12
13
|
|
13
14
|
PKG_NAME = "rspec"
|
14
15
|
# Versioning scheme: MAJOR.MINOR.PATCH
|
@@ -16,11 +17,7 @@ PKG_NAME = "rspec"
|
|
16
17
|
# MINOR bumps when the API is broken backwards in a very slight/subtle (but not fatal) way
|
17
18
|
# -OR when a new release is made and propaganda is sent out.
|
18
19
|
# PATCH is bumped for every API addition and/or bugfix (ideally for every commit)
|
19
|
-
|
20
|
-
#
|
21
|
-
# (This is subject to change - AH)
|
22
|
-
#
|
23
|
-
# REMEMBER TO KEEP PKG_VERSION IN SYNC WITH CHANGELOG
|
20
|
+
|
24
21
|
PKG_VERSION = Spec::VERSION::STRING
|
25
22
|
PKG_FILE_NAME = "#{PKG_NAME}-#{PKG_VERSION}"
|
26
23
|
PKG_FILES = FileList[
|
@@ -44,21 +41,18 @@ Rake::TestTask.new do |t|
|
|
44
41
|
t.verbose = true
|
45
42
|
end
|
46
43
|
|
47
|
-
#
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
# t.verbose = true
|
53
|
-
#end
|
54
|
-
|
44
|
+
# Generates the HTML documentation
|
45
|
+
desc 'Generate documentation'
|
46
|
+
task :doc do
|
47
|
+
sh %{pushd doc; webgen; popd }
|
48
|
+
end
|
55
49
|
|
56
|
-
|
50
|
+
desc 'Generate RDoc'
|
57
51
|
rd = Rake::RDocTask.new("rdoc") do |rdoc|
|
58
|
-
rdoc.rdoc_dir = '
|
52
|
+
rdoc.rdoc_dir = 'doc/output/rdoc'
|
59
53
|
rdoc.title = "RSpec"
|
60
54
|
rdoc.options << '--line-numbers' << '--inline-source' << '--main' << 'README'
|
61
|
-
rdoc.rdoc_files.include('
|
55
|
+
rdoc.rdoc_files.include('CHANGES')
|
62
56
|
rdoc.rdoc_files.include('lib/**/*.rb', 'doc/**/*.rdoc')
|
63
57
|
rdoc.rdoc_files.exclude('doc/**/*_attrs.rdoc')
|
64
58
|
end
|
@@ -111,12 +105,10 @@ spec = Gem::Specification.new do |s|
|
|
111
105
|
s.rubyforge_project = "rspec"
|
112
106
|
end
|
113
107
|
|
114
|
-
desc "Build Gem"
|
115
108
|
Rake::GemPackageTask.new(spec) do |pkg|
|
116
109
|
pkg.need_zip = true
|
117
110
|
pkg.need_tar = true
|
118
111
|
end
|
119
|
-
task :gem => [:test]
|
120
112
|
|
121
113
|
# Support Tasks ------------------------------------------------------
|
122
114
|
|
@@ -139,22 +131,40 @@ task :todo do
|
|
139
131
|
egrep /#.*(FIXME|TODO|TBD)/
|
140
132
|
end
|
141
133
|
|
142
|
-
task :
|
134
|
+
task :clobber do
|
135
|
+
rm_rf 'coverage'
|
136
|
+
rm_rf 'doc/output'
|
137
|
+
end
|
138
|
+
|
139
|
+
task :release => [:clobber, :test, :verify_env_vars, :upload_releases, :publish_website, :publish_news]
|
140
|
+
|
141
|
+
task :rcov do
|
142
|
+
mv 'coverage', 'doc/output'
|
143
|
+
end
|
143
144
|
|
144
145
|
task :verify_env_vars do
|
145
146
|
raise "RUBYFORGE_USER environment variable not set!" unless ENV['RUBYFORGE_USER']
|
146
147
|
raise "RUBYFORGE_PASSWORD environment variable not set!" unless ENV['RUBYFORGE_PASSWORD']
|
147
148
|
end
|
148
149
|
|
149
|
-
|
150
|
-
|
150
|
+
desc "Upload Website to RubyForge"
|
151
|
+
task :publish_website => [:doc, :rdoc, :rcov] do
|
152
|
+
publisher = Rake::SshDirPublisher.new(
|
153
|
+
"#{ENV['RUBYFORGE_USER']}@rubyforge.org",
|
154
|
+
"/var/www/gforge-projects/#{PKG_NAME}",
|
155
|
+
"doc/output"
|
156
|
+
)
|
157
|
+
|
151
158
|
publisher.upload
|
152
159
|
end
|
153
160
|
|
154
|
-
desc "Release gem to RubyForge.
|
155
|
-
task :
|
161
|
+
desc "Release gem to RubyForge. You must make sure lib/version.rb is aligned with the CHANGELOG file"
|
162
|
+
task :upload_releases => :package do
|
163
|
+
|
156
164
|
release_files = FileList[
|
157
|
-
"pkg/#{PKG_FILE_NAME}.gem"
|
165
|
+
"pkg/#{PKG_FILE_NAME}.gem",
|
166
|
+
"pkg/#{PKG_FILE_NAME}.tgz",
|
167
|
+
"pkg/#{PKG_FILE_NAME}.zip"
|
158
168
|
]
|
159
169
|
|
160
170
|
Rake::XForge::Release.new(MetaProject::Project::XForge::RubyForge.new(PKG_NAME)) do |xf|
|
@@ -167,11 +177,7 @@ task :release_files => [:gem] do
|
|
167
177
|
end
|
168
178
|
|
169
179
|
desc "Publish news on RubyForge"
|
170
|
-
task :publish_news
|
171
|
-
release_files = FileList[
|
172
|
-
"pkg/#{PKG_FILE_NAME}.gem"
|
173
|
-
]
|
174
|
-
|
180
|
+
task :publish_news do
|
175
181
|
Rake::XForge::NewsPublisher.new(MetaProject::Project::XForge::RubyForge.new(PKG_NAME)) do |news|
|
176
182
|
# Never hardcode user name and password in the Rakefile!
|
177
183
|
news.user_name = ENV['RUBYFORGE_USER']
|
data/bin/spec
CHANGED
data/doc/README
ADDED
data/doc/config.yaml
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
module Tags
|
2
|
+
# gem install syntax
|
3
|
+
require 'syntax/convertors/html'
|
4
|
+
|
5
|
+
# prints out nicely formatted ruby code in html
|
6
|
+
class RubyInliner < DefaultTag
|
7
|
+
summary "renders a ruby file in html and inserts it"
|
8
|
+
depends_on "Tags"
|
9
|
+
add_param 'filename', nil, 'The File to insert'
|
10
|
+
set_mandatory 'filename', true
|
11
|
+
|
12
|
+
CONVERTOR = Syntax::Convertors::HTML.for_syntax "ruby"
|
13
|
+
|
14
|
+
def initialize
|
15
|
+
super
|
16
|
+
register_tag( 'ruby_inline')
|
17
|
+
end
|
18
|
+
|
19
|
+
def process_tag(tag, node, ref_node)
|
20
|
+
content = ''
|
21
|
+
begin
|
22
|
+
filename = get_param('filename')
|
23
|
+
if !File.exists?(filename)
|
24
|
+
if filename[0...1] == "~"
|
25
|
+
filename = File.expand_path(filename)
|
26
|
+
else
|
27
|
+
filename = ref_node.parent.recursive_value( 'src' ) + get_param( 'filename' )
|
28
|
+
end
|
29
|
+
end
|
30
|
+
self.logger.debug { "File location: <#{filename}>" }
|
31
|
+
content = File.read( filename )
|
32
|
+
rescue
|
33
|
+
self.logger.error { "Given file <#{filename}> does not exist (tag specified in <#{ref_node.recursive_value( 'src' )}>" }
|
34
|
+
end
|
35
|
+
CONVERTOR.convert(content)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
Binary file
|
data/doc/src/default.css
ADDED
@@ -0,0 +1,198 @@
|
|
1
|
+
/* CSS Document by JM (ISeeYou-Designs.com) */
|
2
|
+
|
3
|
+
body {
|
4
|
+
background-color:#fff;
|
5
|
+
font-family:"Trebuchet MS",arial,sans-serif;
|
6
|
+
font-size:62.5%;
|
7
|
+
color:#777;
|
8
|
+
margin:0;
|
9
|
+
padding:0;
|
10
|
+
}
|
11
|
+
a {
|
12
|
+
text-decoration:none;
|
13
|
+
color:#222;
|
14
|
+
}
|
15
|
+
a:hover {
|
16
|
+
color:#c00;
|
17
|
+
}
|
18
|
+
acronym {
|
19
|
+
cursor:help;
|
20
|
+
border-bottom:1px dotted #ddd;
|
21
|
+
}
|
22
|
+
#container {
|
23
|
+
font-size:1.2em;
|
24
|
+
width:550px;
|
25
|
+
margin:0 auto;
|
26
|
+
border-right:3px double #000;
|
27
|
+
}
|
28
|
+
#header {
|
29
|
+
color:#444;
|
30
|
+
margin:0;
|
31
|
+
padding:10px;
|
32
|
+
background:#fff url(business_card.jpg) no-repeat bottom right;
|
33
|
+
}
|
34
|
+
#header h1 {
|
35
|
+
font-family:"Trebuchet MS",arial,sans-serif;
|
36
|
+
font-size:2em;
|
37
|
+
color:#333;
|
38
|
+
margin:0;
|
39
|
+
font-weight:normal;
|
40
|
+
}
|
41
|
+
#header h1 strong {
|
42
|
+
color:#c00;
|
43
|
+
}
|
44
|
+
|
45
|
+
#header h2 {
|
46
|
+
margin:140px 0 0 0;
|
47
|
+
font-size:1em;
|
48
|
+
font-weight:normal;
|
49
|
+
color:#999;
|
50
|
+
}
|
51
|
+
#header h2 strong {
|
52
|
+
color:#c00;
|
53
|
+
}
|
54
|
+
#navigation {
|
55
|
+
text-align:right;
|
56
|
+
margin:10px 10px 10px auto;
|
57
|
+
}
|
58
|
+
#navigation {
|
59
|
+
margin:0 10px 0 0;
|
60
|
+
padding:0;
|
61
|
+
}
|
62
|
+
#navigation li {
|
63
|
+
margin:0;
|
64
|
+
padding:0;
|
65
|
+
list-style:none;
|
66
|
+
display:inline;
|
67
|
+
}
|
68
|
+
|
69
|
+
#navigation li a {
|
70
|
+
padding:5px 5px 2px 5px;
|
71
|
+
margin:0 1px 0 1px;
|
72
|
+
color:#666;
|
73
|
+
text-decoration:none;
|
74
|
+
font-weight:bold;
|
75
|
+
border-bottom:1px solid #c00;
|
76
|
+
}
|
77
|
+
|
78
|
+
#navigation li a:hover {
|
79
|
+
color:#C00;
|
80
|
+
border-bottom:1px solid #ddd;
|
81
|
+
}
|
82
|
+
#content {
|
83
|
+
margin:20px 0 20px 10px;
|
84
|
+
padding:0;
|
85
|
+
}
|
86
|
+
#content p {
|
87
|
+
padding:2px 20px;
|
88
|
+
text-align:justify;
|
89
|
+
text-indent:0.5cm;
|
90
|
+
line-height:1.8em;
|
91
|
+
}
|
92
|
+
#content h1 {
|
93
|
+
display:block;
|
94
|
+
margin:50px 0 0 10px;
|
95
|
+
padding:0;
|
96
|
+
font-family:"Trebuchet MS",arial,sans-serif;
|
97
|
+
font-size:1.8em;
|
98
|
+
color:#c00;
|
99
|
+
border-color:#ddd;
|
100
|
+
border-style:solid;
|
101
|
+
border-width:0 0 1px 0;
|
102
|
+
}
|
103
|
+
#content h2 {
|
104
|
+
display:block;
|
105
|
+
margin:20px 0 0 30px;
|
106
|
+
padding:0;
|
107
|
+
font-family:"Trebuchet MS",arial,sans-serif;
|
108
|
+
font-size:1.1em;
|
109
|
+
letter-spacing:2px;
|
110
|
+
color:#444;
|
111
|
+
border-color:#c00;
|
112
|
+
border-style:solid;
|
113
|
+
border-width:0 0 1px 0;
|
114
|
+
}
|
115
|
+
#content .post_info {
|
116
|
+
text-align:right;
|
117
|
+
margin:0 25px 5px 25px;
|
118
|
+
padding:2px;
|
119
|
+
font-size:0.8em;
|
120
|
+
font-family:arial,sans-serif;
|
121
|
+
color:#aaa;
|
122
|
+
line-height:0.9em;
|
123
|
+
word-spacing:1px;
|
124
|
+
border-top:1px solid #ddd;
|
125
|
+
}
|
126
|
+
#content .post_info a {
|
127
|
+
text-transform:uppercase;
|
128
|
+
}
|
129
|
+
#content blockquote {
|
130
|
+
margin:10px 60px;
|
131
|
+
padding:5px;
|
132
|
+
font-family:"Trebuchet MS",arial,sans-serif;
|
133
|
+
font-size:0.9em;
|
134
|
+
color:#444;
|
135
|
+
border:1px solid #ddd;
|
136
|
+
background-color:#eee;
|
137
|
+
}
|
138
|
+
#content blockquote p {
|
139
|
+
margin:0;
|
140
|
+
padding:0;
|
141
|
+
text-indent:0;
|
142
|
+
}
|
143
|
+
#content pre {
|
144
|
+
margin:10px 60px;
|
145
|
+
padding:5px;
|
146
|
+
color:#444;
|
147
|
+
border:1px solid #eee;
|
148
|
+
background-color:#fafafa;
|
149
|
+
}
|
150
|
+
#content ul {
|
151
|
+
margin-left:70px;
|
152
|
+
list-style:upper-roman outside;
|
153
|
+
font-family:arial,sans-serif;
|
154
|
+
font-size:0.9em;
|
155
|
+
}
|
156
|
+
#content li {
|
157
|
+
padding:3px;
|
158
|
+
}
|
159
|
+
#footer {
|
160
|
+
font-size:0.9em;
|
161
|
+
font-family:arial,sans-serif;
|
162
|
+
margin:90px 0 20px 0;
|
163
|
+
padding:5px;
|
164
|
+
border-top:1px solid #c00;
|
165
|
+
}
|
166
|
+
#footer p {
|
167
|
+
text-align:right;
|
168
|
+
line-height:1.1em;
|
169
|
+
color:#bbb;
|
170
|
+
font-size:0.9em;
|
171
|
+
font-family:arial,sans-serif;
|
172
|
+
margin:0;
|
173
|
+
padding:0;
|
174
|
+
}
|
175
|
+
#footer span {
|
176
|
+
color:#888;
|
177
|
+
}
|
178
|
+
#footer a {
|
179
|
+
color:#888;
|
180
|
+
}
|
181
|
+
#footer a:hover {
|
182
|
+
color:#aaa;
|
183
|
+
}
|
184
|
+
|
185
|
+
/* Ruby code */
|
186
|
+
pre {
|
187
|
+
font-size: 12px;
|
188
|
+
}
|
189
|
+
.keyword { font-family: monospace; color: #8B0000; }
|
190
|
+
.constant, .attribute, .global, .class, .module { font-family: monospace; color: black;}
|
191
|
+
.string { font-family: monospace; color: #00008B; }
|
192
|
+
.ident, .method { font-family: monospace; color: #006400; }
|
193
|
+
.number, .char { font-family: monospace; color: #888800; }
|
194
|
+
.comment { font-family: monospace; color: purple; }
|
195
|
+
.symbol { font-family: monospace; color: #884400; }
|
196
|
+
.regex { font-family: monospace; color: #808080; }
|
197
|
+
.punct { font-family: monospace; color: black; }
|
198
|
+
.escape, .interp, .expr { font-family: monospace; color: black; background-color: #dddddd; }
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
3
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{lang:}">
|
4
|
+
<head>
|
5
|
+
<title>{title: }</title>
|
6
|
+
<link href="{relocatable: default.css}" rel="stylesheet" />
|
7
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
<div id="container">
|
12
|
+
<div id="header">
|
13
|
+
<h2>Behaviour Driven Development for <strong>Ruby</strong></h2>
|
14
|
+
<h1>RSpec</h1>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<div id="navigation">
|
18
|
+
<!-- Not sure how to get this in the menu -->
|
19
|
+
<a href="rdoc/index.html">RDoc</a>
|
20
|
+
<a href="coverage/index.html">RCov</a>
|
21
|
+
{menu: }
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div id="content">
|
25
|
+
{content: }
|
26
|
+
|
27
|
+
<div id="footer">
|
28
|
+
Webdesign by <a href="http://www.oswd.org/user/profile/id/9462">JM</a>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
</div>
|
32
|
+
|
33
|
+
</body>
|
34
|
+
</html>
|