Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/namusyaka/rspec-image
Provides some matchers for testing your image file.
https://github.com/namusyaka/rspec-image
Last synced: about 1 month ago
JSON representation
Provides some matchers for testing your image file.
- Host: GitHub
- URL: https://github.com/namusyaka/rspec-image
- Owner: namusyaka
- License: mit
- Created: 2015-01-10T03:42:15.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-01-10T05:11:00.000Z (almost 10 years ago)
- Last Synced: 2024-09-10T12:47:17.138Z (2 months ago)
- Language: Ruby
- Size: 180 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# RSpec::Image
[![Build Status](https://travis-ci.org/namusyaka/rspec-image.svg)](https://travis-ci.org/namusyaka/rspec-image)
Provides some matchers for testing your image file.
This was created with reference to the [carrierwave](https://github.com/carrierwaveuploader/carrierwave) gem.
## Installation
Add this line to your application's Gemfile:
gem 'rspec-image'
And then execute:
$ bundle
Or install it yourself as:
$ gem install rspec-image
## Usage
### `be_identical_with`
```ruby
describe "thumbnail file" do
subject { "/path/to/something.jpg" }
it { should be_identical_with("/path/to/something.jpg") }
end
```### `have_width`
```ruby
describe "thumbnail file" do
subject { "/path/to/something.jpg" }
it { should have_width(400) }
end
```### `have_height`
```ruby
describe "thumbnail file" do
subject { "/path/to/something.jpg" }
it { should have_height(300) }
end
```### `have_dimensions`
```ruby
describe "thumbnail file" do
subject { "/path/to/something.jpg" }
it { should have_dimensions(400, 300) }
end
```## Contributing
1. Fork it ( https://github.com/namusyaka/rspec-image/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