This repository was archived by the owner on Nov 30, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 102
Document how to test #171
Closed
Closed
Document how to test #171
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,3 +24,51 @@ end | |
3. Commit your changes (`git commit -am 'Add some feature'`) | ||
4. Push to the branch (`git push origin my-new-feature`) | ||
5. Create new Pull Request | ||
|
||
## Testing | ||
|
||
### General: Which Ruby | ||
|
||
Check that the Ruby version you are running is one that is supported. | ||
You can see what versions RSpec is tested against by looking at the | ||
[.travis.yml](https://github.com/rspec/rspec-support/blob/v3.2.1/.travis.yml#L16-26) | ||
(noting [allowed failures](https://github.com/rspec/rspec-support/blob/master/.travis.yml#L34-L36)) | ||
and the [appveyor.yml](https://github.com/rspec/rspec-support/blob/v3.2.1/appveyor.yml#L32-L34). | ||
|
||
### Running tests | ||
|
||
`bundle exec rake` locally, and check the CI results in your pull request. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't see that a place for this yet exists on http://rspec.info/contributing/. If something like this text is ok, I would make a PR to add it to the page and link to it from here. |
||
### Caveats: Encodings | ||
|
||
Some tests fail if the external/locale/filesystem encoding is ISO-8859-1, which is the default on | ||
some machines, such as the [rake-compiler-dev-box](https://github.com/tjschuck/rake-compiler-dev-box). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd still like to just not mention this... |
||
|
||
The tests on Travis run with certain [ENV variables our suite depends on](http://docs.travis-ci.com/user/ci-environment/): | ||
|
||
> LANG=en_US.UTF-8 | ||
> LC_ALL=en_US.UTF-8 | ||
> JRUBY_OPTS="--server -Dcext.enabled=false -Xcompile.invokedynamic=false" | ||
|
||
**Ruby 1.9+ on *nix** uses `LANG`, `LC_ALL` among other variables to set the Encoding.default_external. | ||
The settings above will set it to UTF-8. Thus, before running tests, you'll want to ensure you or your | ||
login profile have run | ||
|
||
```bash | ||
export LANG=en_US.UTF-8 | ||
export LC_ALL=en_US.UTF-8 | ||
``` | ||
|
||
**Ruby 1.9+ on Windows** likely runs under an Encoding.default_external such as `ibm437`. | ||
You can get the current `codepage` from the command prompt by running `chcp` and | ||
change it to utf8 via `chcp 65001`. See | ||
https://github.com/rspec/rspec-support/pull/151#discussion_r22991439 | ||
http://stackoverflow.com/questions/1259084/what-encoding-code-page-is-cmd-exe-using and | ||
https://github.com/ruby/ruby/blob/9fd7afefd04134c98abe594154a527c6cfe2123b/ext/win32ole/win32ole.c#L540 | ||
for more information and https://github.com/rspec/rspec-support/pull/151#discussion_r22991439 for | ||
background discussion. | ||
|
||
The above platform-specific methods are necessary when running our tests on Ruby 1.8.7. Otherwise, | ||
we could run our tests commands with `ruby -E UTF-8:UTF-8 -S $spec_command`, which fails on Ruby 1.8.7. | ||
|
||
Available **JRUBY** options can be reviewed by running `jruby --properties`. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We support > 1.8.7 basically...