-
Notifications
You must be signed in to change notification settings - Fork 11
/
README
30 lines (24 loc) · 913 Bytes
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
== RSpec Steps
=== ( or: why would I want to relearn how to write specs? )
RSpec Steps allows you to chain examples into a series of steps without having
to go the whole 9 yards over to Cucumber. It's often incredibly useful to be
able to aseemble a series of tests that should all pass, but where completely
isolating them is less than sensible.
One excellent example is web site integration tests. With RSpec steps you can
do:
steps "Add a user" do
it do
visit root
page.should have_text "Login"
end
it do
fill_in :name, "Johnny User"
click "Login"
page.should have_text "Welcome, Johnny!"
end
...
end
Add dozens of steps to a set. They get run in order, and the state of the
tests isn't reset between them. Better still, if one step fails, the rest are
all marked "pending" so they don't even try to run, which helps speed up
testing.