Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bpedro/be_an_existing_path-matcher
An RSpec matcher that checks if a given path exists.
https://github.com/bpedro/be_an_existing_path-matcher
Last synced: 16 days ago
JSON representation
An RSpec matcher that checks if a given path exists.
- Host: GitHub
- URL: https://github.com/bpedro/be_an_existing_path-matcher
- Owner: bpedro
- License: mit
- Created: 2015-03-13T15:43:59.000Z (almost 10 years ago)
- Default Branch: develop
- Last Pushed: 2015-03-13T16:03:09.000Z (almost 10 years ago)
- Last Synced: 2024-12-11T21:24:40.460Z (about 1 month ago)
- Language: Ruby
- Size: 145 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# `be_an_existing_path` [RSpec](http://rspec.info/) matcher
An RSpec matcher that checks if a given path exists.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'be_an_existing_path-matcher'
```And then execute:
$ bundle
Or install it yourself as:
$ gem install be_an_existing_path-matcher
## Usage
`require` this gem on your `spec_helper.rb`:
```ruby
require 'be_an_existing_path'
```Use it on any tests to check if a path exists, e.g.:
```ruby
RSpec.describe YourClass do
let(:existing_path) { 'EXISTING_PATH' }
let(:non_existing_path) { 'NON_EXISTING_PATH' }describe '#initialize' do
context 'when the path exists' do
subject { existing_path }
it { is_expected.to be_an_existing_path }
endcontext 'when the path doesn\'t exist' do
subject { non_existing_path }
it { is_expected.not_to be_an_existing_path }
end
end
end
```## Contributing
1. Fork it ( https://github.com/[my-github-username]/be_an_existing_path-matcher/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request