Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

content updates

  • Loading branch information...
commit dae3099e772e4c70dc957841a6d0acee62177475 1 parent 79c96dc
@dchelimsky dchelimsky authored
View
10 content/rspec-core/index.page
@@ -8,9 +8,7 @@ filter:
h2. Executable Code Examples
-RSpec provides a Domain Specific Language with which you can express executable examples of the expected behaviour of your code.
-
-Imagine that you were talking to a customer requesting software for her bank. Part of that conversation might well look like this:
+RSpec helps you express executable examples of the expected behaviour of your code. Imagine you're talking with a customer requesting software for a bank. Part of that conversation might look like this:
<pre>
You: Describe an account when it is first created.
@@ -26,11 +24,7 @@ Here's how we express that conversation in RSpec:
end
<% end -%>
-The <code>describe()</code> method returns an <code>ExampleGroup</code> class, which contains a group of examples of a particular behaviour of the system that you wish to describe.
-
-The <code>it()</code> method returns an instance of the <code>ExampleGroup</code> in which that example is run.
-
-When you run this example, RSpec can provide a report like this:
+The <code>describe</code> method returns an example group, which contains examples of a particular behaviour of the system that you wish to describe. The <code>it</code> method returns an example. When you run this example, RSpec can provide a report like this:
<pre>
Account when first created
View
80 content/rspec-core/tools/extensions/editors/index.page
@@ -3,51 +3,59 @@ title: editors
order: 1
filter:
- erb
- - textile
+ - markdown
---
-h2. <%= @page.title %>
+## <%= @page.title %>
-RSpec's commandline API and pluggable formatters makes it very easy to integrate it with external tools
-such as text editors (including IDEs). Below we describe the general steps you need to perform to write
-an RSpec plugin for your editor.
+RSpec's commandline API and pluggable formatters make it easy to integrate with
+external tools like text editors and IDEs. Here are the general steps you need
+to write an RSpec plugin for your editor.
-The RSpec team maintains a TextMate bundle which does exactly this. You may want to look at its source if
-you're about to write a plugin for a new editor.
+The RSpec team maintains a [TextMate
+bundle](https://github.com/rspec/rspec-tmbundle) which does exactly this. You
+may want to look at its source if you're about to write a plugin for a new
+editor.
-We'd be happy to accept more editor plugins into RSpec. Please see "Contribute":../../../../community/contribute.html for
-details. Or, if you're a developer of an editor, perhaps you want to bundle it with the editor.
+### Launch RSpec from the IDE
-h3. Launch RSpec from the IDE
+Most advanced editors provide a mechanism to launch external processes by
+hitting a keystroke. Depending on your editor, you may want to launch RSpec
+directly via the `rspec` command (which must be on your `$PATH`).
+Alternatively, if your editor makes it possible to run Ruby scripts directly,
+you may execute RSpec via `RSpec::Core::Runner.run` (which has
+a similar API to the `spec` command, except you can call it straight
+from Ruby without forking a new Ruby process).
-Most advanced editors provide a mechanism to launch external processes by hitting a keystroke.
-Depending on your editor, you may want to launch RSpec directly via the <code>spec</code> spec command
-(which must be on your $PATH). Alternatively, if your editor makes it possible to run Ruby scripts
-directly, you may execute RSpec via <code>Spec::Runner::CommandLine.run</code> (which has a similar API to
-the <code>spec</code> command, except you can call it straight from Ruby without forking a new Ruby process).
+### Tell RSpec what spec(s) to run
-h3. Tell RSpec what spec(s) to run
+You may want to assign different keystrokes to run your specs. You could run
+All specs in your project, the ones in the currently open file or just the one
+you have focussed in the editor. RSpec's commandline API has a
+`--line` option which will make RSpec run the spec at the current
+line (it also works if the line is inside the spec). Most editors provide a
+way to query the current file and the line of the cursor when launching an
+external process, and you can use this to feed the right argument to the --line
+option.
-You may want to assign different keystrokes to run your specs. You could run All specs in your project,
-the ones in the currently open file or just the one you have focussed in the editor.
-RSpec's commandline API has a <code>--line</code> option which will make RSpec run the spec at the current
-line (it also works if the line is inside the spec).
-Most editors provide a way to query the current file and the line of the cursor when launching an external
-process, and you can use this to feed the right argument to the --line option.
+### Make the backtrace work with your editor
-h3. Make the backtrace work with your editor
-
-When a spec fails, the backtrace is displayed in the error message. The backtrace contains lines with
-file paths and line numbers. Most editors have a mechanism that will open the file and put the
-cursor on the right line when such a line is clicked - provided the line is on a format that the editor
+When a spec fails, the backtrace is displayed in the error message. The
+backtrace contains lines with file paths and line numbers. Most editors have a
+mechanism that will open the file and put the cursor on the right line when
+such a line is clicked - provided the line is on a format that the editor
understands.
-It is possible to customise the backtrace lines of RSpec's output to achieve this. All you need to do is
-to implement your own Formatter class, typically by subclassing
-"ProgressBarFormatter":../rdoc/classes/Spec/Runner/Formatter/ProgressBarFormatter.html or "HtmlFormatter":../rdoc/classes/Spec/Runner/Formatter/HtmlFormatter.html
-(depending on what your editor understands). In your formatter class you
-can override the <code>backtrace_line</code> method to make the output be something that works with your editor.
-
-Then, when the editor plugin launches RSpec, just make sure it uses the <code>--formatter</code>
-option to specify *your* custom formatter. Note that you will probably have to use <code>--require</code>
-too, so that the code for your custom formatter is loaded. See <code>spec --help</code> for details.
+It is possible to customise the backtrace lines of RSpec's output to achieve
+this. All you need to do is to implement your own Formatter class, typically by
+subclassing
+[`ProgressBarFormatter`](../rdoc/classes/Spec/Runner/Formatter/ProgressBarFormatter.html)
+or [HtmlFormatter](../rdoc/classes/Spec/Runner/Formatter/HtmlFormatter.html)
+(depending on what your editor understands). In your formatter class you can
+override the `backtrace_line` method to make the output be something
+that works with your editor.
+
+Then, when the editor plugin launches RSpec, just make sure it uses the
+`--formatter` option to specify *your* custom formatter. Note that
+you will probably have to use `--require` too, so that the code for
+your custom formatter is loaded. See `spec --help` for details.
Please sign in to comment.
Something went wrong with that request. Please try again.