Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit 480d8f0

Browse files
committed
Merge pull request rspec#25 from rspec/myron-further-changes
A few changes
2 parents 0f24760 + b663a16 commit 480d8f0

File tree

7 files changed

+88
-6
lines changed

7 files changed

+88
-6
lines changed

source/_upgrade.html.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
RSpec 3 includes many breaking changes, but our hope is to make this the smoothest
2+
major-version gem upgrade you've ever done. To assist with that process, we've developed
3+
RSpec 2.99 in tandem with RSpec 3. Every breaking change in 3.0 has a corresponding
4+
deprecation to 2.99. Rather than just giving you a generic upgrade document that describes
5+
_all_ of the breaking changes (most of which affect very few users!), RSpec 2.99 gives you a
6+
detailed upgrade checklist tailored to your project.
7+
8+
In addition, [Yuji Nakayama](https://twitter.com/nkym37) has created [Transpec](http://yujinakayama.me/transpec/) -- an absolutely amazing tool that can
9+
automatically upgrade most RSpec suites. We've tried it on a few projects and have been _amazed_ at how well it works.
10+
11+
## Step-by-step Instructions
12+
13+
1. Ensure your test suite is already green on whatever RSpec 2.x version
14+
you're already using.
15+
2. Install RSpec 2.99.
16+
3. Run your test suite and ensure it's still green. (It should be, but
17+
we may have made a mistake -- if it breaks anything, please report
18+
a bug!). Now would be a good time to commit.
19+
4. You'll notice a bunch of deprecation warnings printed off at the
20+
end of the spec run. These may be truncated since we don't to
21+
spam you with the same deprecation warning over and over again. To
22+
get the full list of deprecations, you can pipe them into a file
23+
by passing the `--deprecation-out path/to/file` option.
24+
5. If you want to understand all of what is being deprecated, it's a
25+
good idea to read through the deprecation messages. In some cases,
26+
you have choices -- such as continuing to use the `have` collection
27+
cardinality matchers via the extracted
28+
[rspec-collection_matchers](https://github.com/rspec/rspec-collection_matchers)
29+
gem, or by rewriting the expectation expression to something like
30+
`expect(list.size).to eq(3)`.
31+
6. `gem install transpec` (Note that this need not go into your
32+
`Gemfile`: you run `transpec` as a standalone executable
33+
outside the context of your bundle).
34+
7. Run transpec on your project. Check `transpec --help` or
35+
[the README](https://github.com/yujinakayama/transpec#transpec)
36+
for a full list of options.
37+
8. Run the test suite (it should still be green but it's always good to
38+
check!) and commit.
39+
9. If there are any remaining deprecation warnings (transpec doesn't
40+
quite handle all of the warnings you may get), deal with them.
41+
9. Once you've got a deprecation-free test suite running against RSpec
42+
2.99, you're ready to upgrade to RSpec 3. Install RSpec 3.
43+
10. Run your test suite. It should still be green. If anything fails,
44+
please open a Github issue -- we consider it a bug! Note
45+
that you may still get a few additional deprecation warnings on
46+
RSpec 3 that weren't present on 2.99. This is normal -- there are
47+
a few things we couldn't easily deprecate in 2.99 and remove in 3.0,
48+
so they trigger deprecations in 3.0 with the plan to remove them in
49+
RSpec 4.
50+
11. We recommend running `transpec` a second time. There are some
51+
changes that transpec is only able to make when your project is on
52+
RSpec 3.
53+
12. Commit and enjoy using the latest RSpec release!

source/code_snippets/green.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<% code do %>
2-
$ rspec bowling_spec.rb --format nested
2+
$ rspec bowling_spec.rb --format documentation
33

44
Bowling#score
55
with no strikes or spares

source/layouts/layout.slim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ html.no-js lang="en"
3434
nav
3535
h1= link_to 'RSpec', '/'
3636
ul
37-
li= link_to 'Documentation', '/documentation'
3837
li= link_to 'About', '/about'
38+
li= link_to 'Documentation', '/documentation'
39+
li= link_to 'Upgrade', '/upgrade'
3940
li= link_to 'Get Help', '/help'
4041
li= link_to 'Contributing', '/contributing'
4142
= yield
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@import "application";
2+
3+
section {
4+
@include outer-container;
5+
padding-top: 3em;
6+
article {
7+
@include span-columns(10);
8+
@include shift(1);
9+
10+
h2 {
11+
font-size: 3em;
12+
padding: 1em;
13+
}
14+
15+
p {
16+
font-size: 1.1em;
17+
}
18+
19+
ol {
20+
list-style-type: decimal;
21+
}
22+
}
23+
}

source/stylesheets/partials/_footer.css.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
footer {
2-
height: 130px;
2+
height: 78px;
33
width: 100%;
44
background-color: $footer-color;
55
margin-top: 100px;
6-
padding: 10px;
6+
padding: 13px;
7+
text-align: center;
78

89
span {
910
margin-left: 3px;

source/stylesheets/partials/_header.css.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ header {
66
height: 78px;
77
h1 {
88
background: url(image-path("logo-small.png")) left no-repeat;
9-
@include span-columns(4);
9+
@include span-columns(3);
1010
padding-left: 66px;
1111
padding-top: 12px;
1212
height: 100%;
@@ -18,7 +18,7 @@ header {
1818
}
1919
ul {
2020
text-align: right;
21-
@include span-columns(8);
21+
@include span-columns(9);
2222

2323
li {
2424
display: inline-block;

source/upgrade.html.slim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
section
2+
article.upgrade
3+
h2 Upgrading from RSpec 2
4+
= partial "upgrade"

0 commit comments

Comments
 (0)