Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
* Update README for consistency across all shoulda-* gems
* Add MAINTAINING
* Drop CONTRIBUTING document since this gem is more or less deprecated

[ci skip]
  • Loading branch information
mcmire committed Jun 14, 2020
1 parent eff9fdd commit 5da1895
Show file tree
Hide file tree
Showing 4 changed files with 133 additions and 63 deletions.
38 changes: 0 additions & 38 deletions CONTRIBUTING.md

This file was deleted.

2 changes: 1 addition & 1 deletion MIT-LICENSE → LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2006-2020, Tammer Saleh and thoughtbot, inc.
Copyright (c) 2006-2020 Tammer Saleh and thoughtbot, inc.

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
Expand Down
104 changes: 104 additions & 0 deletions MAINTAINING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Maintaining Shoulda Context

Although Shoulda Context doesn't receive feature updates these days, you may
need to update the gem for new versions of Ruby or Rails. Here's what you need
to know in order to do that.

## Getting started

First, run the setup script:

bin/setup

Then run all the tests to make sure everything is green:

bundle exec rake

## Running tests

This project uses Minitest for tests and Appraisal to create environments
attuned for different versions of Rails. To run a single test in a single test
file, you will need to use a combination of Appraisal and the [`m`][m] gem. For
instance:

[m]: https://github.com/qrush/m

bundle exec appraisal rails_6_0 m test/shoulda/context_test.rb:39

## Updating the changelog

After every user-facing change makes it into master, we make a note of it in the
changelog, kept in `CHANGELOG.md`. The changelog is sorted in reverse order by
release version, with the topmost version as the next release (tagged as
"(Unreleased)").

Within each version, there are five available categories you can divide changes
into. They are all optional but they should appear in this order:

1. Backward-compatible changes
1. Deprecations
1. Bug fixes
1. Features
1. Improvements

Within each category section, the changes relevant to that category are listed
in chronological order.

For each change, provide a human-readable description of the change as well as a
linked reference to the PR where that change emerged (or the commit ID if no
such PR is available). This helps users cross-reference changes if they need to.

## Versioning

### Naming a new version

As designated in the README, we follow [SemVer 2.0][semver]. This offers a
meaningful baseline for deciding how to name versions. Generally speaking:

[semver]: https://semver.org/spec/v2.0.0.html

* We bump the "major" part of the version if we're introducing
backward-incompatible changes (e.g. changing the API or core behavior,
removing parts of the API, or dropping support for a version of Ruby).
* We bump the "minor" part if we're adding a new feature (e.g. adding a new
matcher or adding a new qualifier to a matcher).
* We bump the "patch" part if we're merely including bugfixes.

In addition to major, minor, and patch levels, you can also append a
suffix to the version for pre-release versions. We usually use this to issue
release candidates prior to an actual release. A version number in this case
might look like `4.0.0.rc1`.

### Preparing and releasing a new version

In order to release any versions at all, you will need to have been added as
an owner of the Ruby gem. If you want to give someone else these permissions,
then run:

```bash
gem owner shoulda-context -a <email address>
```

Assuming you have permission to publish a new version to RubyGems, then this is
how you release a version:

1. First, you'll want to [make sure that the changelog is up to
date](#updating-the-changelog).

2. Next, you'll want to update the `VERSION` constant in
`lib/shoulda/context/version.rb`. This constant is referenced in the
gemspec and is used in the Rake tasks to publish the gem on RubyGems.

3. Assuming that everything looks good, place your changes to the changelog,
`version.rb`, and README in their own commit titled "Bump version to
*X.Y.Z*". Push this to GitHub (you can use `[ci skip]`) in the body of the
commit message to skip CI for this commit if you so choose). **There is no
going back after this point!**

6. Once GitHub has the version-change commit, you will run:

```bash
rake release
```

This will push the gem to RubyGems and make it available for download.
52 changes: 28 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ fully compatible with your existing tests and requires no retooling to use.
[rubydocs]: http://rubydoc.info/github/thoughtbot/shoulda-context/master/frames
[changelog]: CHANGELOG.md

## Usage
[shoulda-matchers]: https://github.com/thoughtbot/shoulda-matchers
[minitest_matchers-vaccine]: https://github.com/rmm5t/minitest-matchers_vaccine

## Overview

Instead of writing Ruby methods with `lots_of_underscores`, Shoulda Context lets
you name your tests and group them together using English.
Expand Down Expand Up @@ -138,41 +141,42 @@ may be of use:
* `assert_reject` — what `should_not` uses internally; asserts that a matcher
object does not match against a value

## Note on running tests
## Compatibility

Normally, you will run a single test like this:
Shoulda Context is [tested][travis] and supported against Ruby 2.4+, Rails 4.2+,
Minitest 4.x, and Test::Unit 3.x.

ruby -I lib -I test path_to_test.rb -n name_of_test_method
## Versioning

When using Shoulda Context, however, you'll need to put a space after the test
name:
Shoulda Context follows Semantic Versioning 2.0 as defined at
<http://semver.org>.

ruby -I lib -I test path_to_test.rb -n "test_: a calculator should add two numbers for the sum. "
## Team

If this is too cumbersome, consider using the [m] gem to run tests instead:
Shoulda Context is maintained by [Elliot Winkler][mcmire]. It was previously
maintained by [Travis Jeffery][travisjeffery].

m path_to_test.rb:39
[mcmire]: https://github.com/mcmire
[travisjeffery]: https://github.com/travisjeffery

[m]: https://github.com/qrush/m
## Copyright/License

## Compatibility
Shoulda Context is copyright © 2006-2020 Tammer Saleh and [thoughtbot,
inc][thoughtbot-website]. It is free and opensource software and may be
redistributed under the terms specified in the [LICENSE](LICENSE) file.

Shoulda Context is tested and supported against Rails 4.x+, Minitest 4.x,
Test::Unit 3.x, and Ruby 2.4+.
[thoughtbot-website]: https://thoughtbot.com

## Credits
## About thoughtbot

Shoulda Context is maintained by [Elliot Winkler][elliot-winkler], [Travis
Jeffery][travis-jeffery], and thoughtbot. Thank you to all the [contributors].
![thoughtbot][thoughtbot-logo]

[elliot-winkler]: https://github.com/mcmire
[travis-jeffery]: https://github.com/travisjeffery
[contributors]: https://github.com/thoughtbot/shoulda-context/contributors
[thoughtbot-logo]: https://presskit.thoughtbot.com/images/thoughtbot-logo-for-readmes.svg

## License
The names and logos for thoughtbot are trademarks of thoughtbot, inc.

Shoulda Context is copyright © 2006-2020 [thoughtbot, inc][thoughtbot-website].
It is free software, and may be redistributed under the terms specified in the
[MIT-LICENSE](MIT-LICENSE) file.
We are passionate about open source software. See [our other
projects][community]. We are [available for hire][hire].

[thoughtbot-website]: https://thoughtbot.com
[community]: https://thoughtbot.com/community?utm_source=github
[hire]: https://thoughtbot.com?utm_source=github

0 comments on commit 5da1895

Please sign in to comment.