Skip to content

Commit 51a2ef3

Browse files
committed
Merge pull request #35 from rspec/doc-page-improvements
Doc page improvements
2 parents bdd3314 + d07a9fd commit 51a2ef3

10 files changed

+49
-87
lines changed

config.rb

+6
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,10 @@ def rspec_documentation
7979
end
8080
hash
8181
end
82+
83+
def documentation_links_for(gem_name)
84+
rspec_documentation.fetch(gem_name) { [] }.sort.reverse.map do |version|
85+
link_to version, "/documentation/#{version}/#{gem_name}/"
86+
end
87+
end
8288
end

source/code_snippets/_bowling_spec.html.erb

-14
This file was deleted.

source/code_snippets/_doubles.html.erb

-4
This file was deleted.

source/code_snippets/_install.html.erb

-3
This file was deleted.

source/code_snippets/_matchers.html.erb

-7
This file was deleted.

source/code_snippets/_story.html.erb

-13
This file was deleted.

source/code_snippets/bowling.html.erb

-14
This file was deleted.

source/code_snippets/fail.html.erb

-6
This file was deleted.

source/code_snippets/green.html.erb

-10
This file was deleted.

source/documentation.html.slim

+43-16
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,56 @@
11
---
22
title: RSpec documentation
3+
gems:
4+
- name: rspec-core
5+
description: >
6+
The spec runner, providing a rich command line program, flexible and
7+
customizable reporting, and an API to organize your code examples
8+
- name: rspec-expectations
9+
description: >
10+
Provides a readable API to express expected outcomes of a code example
11+
- name: rspec-mocks
12+
description: >
13+
Test double framework, providing multiple types of fake objects to allow you
14+
to tightly control the environment in which your specs run
15+
- name: rspec-rails
16+
description: >
17+
Supports using RSpec to test Ruby on Rails applications in place of Rails' built-in test framework.
318
---
419
section
5-
article.relish
6-
h2 Relish
20+
article.rdoc
21+
h2 API Documentation
722

823
p
9-
| RSpec is documented through executable examples on Relish. These examples
10-
are executed via cucumber to ensure they it stays up-to-date with the current
11-
code base.
24+
| The API documentation contains details about all public APIs supported by RSpec.
25+
We consider these the primary docs and will treat these APIs according to the
26+
policies of #{link_to 'Semantic Versioning', 'http://semver.org/'}. We encourage you
27+
to use only public APIs as private APIs may change in any release without warning.
28+
If you have a use case not supported by the existing public APIs, #{link_to 'please ask', '/help'}
29+
and we'll be glad to add an API for you or make an existing private API public.
1230

31+
p
32+
| RSpec is composed of multiple libraries, which are designed to work together, or
33+
can be used independently with other testing tools like #{link_to 'Cucumber', 'http://cukes.info/'}
34+
or #{link_to 'Minitest', 'http://docs.seattlerb.org/minitest/'}. The parts of RSpec are:
1335
ul
14-
li= link_to 'http://relishapp.com/rspec', 'http://relishapp.com/rspec'
36+
- current_page.data.fetch('gems').each do |gem|
37+
li
38+
b
39+
| #{gem.name}: 
40+
| #{gem.description}
41+
#{documentation_links_for(gem.name).join(' | ')}
1542

16-
article.rdoc
17-
h2 API Documentation
43+
article.relish
44+
h2 Relish
1845

1946
p
20-
| You can find detailed API documentation for versions below
47+
| RSpec is also documented through executable examples on Relish. The examples
48+
are written in an "end-to-end" style demonstrating the use of various RSpec
49+
features in the context of executable spec files. It's a good resource for
50+
getting a survey of what RSpec is capable of and seeing how the pieces can
51+
be used together, but for detailed documentation about a partiular API or
52+
feature, we recommend the API docs. The relish examples are executed via
53+
Cucumber to ensure they are always up-to-date with the current code base.
2154

2255
ul
23-
- rspec_documentation.each do |gem, versions|
24-
li
25-
b
26-
| #{gem}: 
27-
- versions.sort.reverse.each do |version|
28-
= link_to version, "/documentation/#{version}/#{gem}/"
29-
|  
56+
li= link_to 'http://relishapp.com/rspec', 'http://relishapp.com/rspec'

0 commit comments

Comments
 (0)