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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
|
# Rspec::PendingFor
Easiest to just show you:
```ruby
it("blah is blah") do
pending_for(engine: "ruby", version: "2.1.5")
pending_for(engine: "jruby", version: "2.2.2")
expect("blah").to eq "blah"
end
```
Requires Ruby 1.9+ (any engine)
| Project | Rspec::PendingFor |
|------------------------ | ------------------ |
| gem name | rspec-pending_for |
| license | MIT |
| version | [](http://badge.fury.io/rb/rspec-pending_for) |
| dependencies | [](https://gemnasium.com/pboling/rspec-pending_for) |
| code quality | [](https://codeclimate.com/github/pboling/rspec-pending_for) |
| inline documenation | [](http://inch-ci.org/github/pboling/rspec-pending_for) |
| continuous integration | [](https://travis-ci.org/pboling/rspec-pending_for) |
| homepage | [https://github.com/pboling/rspec-pending_for][homepage] |
| documentation | [http://rdoc.info/github/pboling/rspec-pending_for/frames][documentation] |
| author | [Peter Boling](https://coderbits.com/pboling) |
| Spread ~♡ⓛⓞⓥⓔ♡~ | [](http://coderwall.com/pboling) |
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'rspec-pending_for'
```
And then execute:
$ bundle
Or install it yourself as:
$ gem install rspec-pending_for
## Usage
The gem auto-configures itself for use in your Rspec suite. Just use it!
To mark a spec pending for a specific ruby engine, and/or versions:
```ruby
it("blah is blah") do
pending_for(engine: "ruby", version: "2.1.5")
expect("blah").to eq "blah"
end
```
To skip a spec for a specific ruby engine, and/or versions:
```ruby
it("blah is blah") do
skip_for(engine: "ruby", version: "2.1.5")
expect("blah").to eq "blah"
end
```
To mark a spec pending for all versions of a given engine:
```ruby
it("blah is blah") do
skip_for(engine: "jruby")
expect("blah").to eq "blah"
end
```
To mark a spec pending for a custom reason (overriding the default message):
```ruby
it("blah is blah") do
skip_for(engine: "jruby", reason: "This does not work on JRuby")
expect("blah").to eq "blah"
end
```
To mark a spec pending or skipped for multiple engines and versions, just what you would expect:
```ruby
it("blah is blah") do
skip_for(engine: "jruby", reason: "This does not work on JRuby so skipping for now") # All JRuby versions will be skipped
pending_for(engine: "rbx", reason: "This does not work on Rubinius so pending for now") # All rbx versions will be pending
pending_for(engine: "ruby", versions:%w(1.9.3 2.0.0 2.1.0)) # uses the default message
expect("blah").to eq "blah"
end
```
## Development
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Authors
[Peter H. Boling][peterboling] of [Rails Bling][railsbling] is the author.
## Contributors
See the [Network View](https://github.com/pboling/rspec-pending_for/network) and the [CHANGELOG](https://github.com/pboling/rspec-pending_for/blob/master/CHANGELOG.md)
## Contributing
1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Added some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
6. Create new Pull Request
Bug reports and pull requests are welcome on GitHub at https://github.com/pboling/rspec-pending_for.
## Versioning
This library aims to adhere to [Semantic Versioning 2.0.0][semver].
Violations of this scheme should be reported as bugs. Specifically,
if a minor or patch version is released that breaks backward
compatibility, a new version should be immediately released that
restores compatibility. Breaking changes to the public API will
only be introduced with new major versions.
As a result of this policy, you can (and should) specify a
dependency on this gem using the [Pessimistic Version Constraint][pvc] with two digits of precision.
For example:
spec.add_dependency 'rspec-pending_for', '~> 1.1'
## Legal
* MIT License - See LICENSE file in this project
* Copyright (c) 2015 [Peter H. Boling][peterboling] of [Rails Bling][railsbling]
[semver]: http://semver.org/
[pvc]: http://docs.rubygems.org/read/chapter/16#page74
[railsbling]: http://www.railsbling.com
[peterboling]: https://about.me/peter.boling
[documentation]: http://rdoc.info/github/pboling/rspec-pending_for/frames
[homepage]: https://github.com/pboling/rspec-pending_for
|