Skip to content

Commit bf2c7b7

Browse files
committed
Reorganized code folders, completed tests, change:
* Use :value option to specify to value to filter by in be_filtered * Rename :comparing_with to :compare_with in be_filtered * Accept a symbol in :compare_with (e.g.: `compare_with: :<`) * `have_attributes` does not accept a block anymore
1 parent 8397c8a commit bf2c7b7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1689
-1204
lines changed

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
source 'https://rubygems.org'
2-
2+
# gem 'debugger'
33
gemspec

Gemfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
rspec-api-matchers (0.5.0)
4+
rspec-api-matchers (0.6.0)
55
activesupport
66
rack
77
rspec
@@ -22,7 +22,7 @@ GEM
2222
simplecov (>= 0.7)
2323
term-ansicolor
2424
thor
25-
diff-lcs (1.2.4)
25+
diff-lcs (1.2.5)
2626
i18n (0.6.5)
2727
mime-types (2.0)
2828
minitest (4.7.5)
@@ -36,7 +36,7 @@ GEM
3636
rspec-expectations (~> 2.14.0)
3737
rspec-mocks (~> 2.14.0)
3838
rspec-core (2.14.7)
39-
rspec-expectations (2.14.3)
39+
rspec-expectations (2.14.4)
4040
diff-lcs (>= 1.1.3, < 2.0)
4141
rspec-mocks (2.14.4)
4242
simplecov (0.7.1)
@@ -48,7 +48,7 @@ GEM
4848
thor (0.18.1)
4949
thread_safe (0.1.3)
5050
atomic
51-
tins (0.12.0)
51+
tins (0.13.0)
5252
tzinfo (0.3.38)
5353

5454
PLATFORMS

HISTORY.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
v0.6.0 - 2013/11/09
2+
--------------------
3+
4+
* Use :value option to specify to value to filter by in be_filtered
5+
* Rename :comparing_with to :compare_with in be_filtered
6+
* Accept a symbol in :compare_with (e.g.: `compare_with: :<`)
7+
* `have_attributes` does not accept a block anymore
8+
* `has_page_links` replaces `has_prev_page_link`
9+
* `have_content_type` replaces `include_content_type`
10+
* `be_wrapped_in_callback` replaces `be_a_jsonp`
11+
* matchers are available by default in examples tagged as :rspec_api
12+
113
v0.5.0 - 2013/11/07
214
--------------------
315

@@ -12,7 +24,7 @@ v0.5.0 - 2013/11/07
1224
v0.1.0 - 2013/11/03
1325
--------------------
1426

15-
* Added include_content_type matcher
27+
* Added valid_responseontent_type matcher
1628
* Added have_prev_page_link matcher
1729
* Added be_a_collection matcher
1830
* Added be_a_jsonp matcher

README.md

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,47 @@
1-
RSpec API Matchers
1+
RSpecApi::Matchers
22
==================
33

44
RSpecApi::Matchers lets you express outcomes on the response of web APIs.
55

66
expect(response).to have_status(:not_found)
77

8-
More documentation and examples about RSpec Api are available at [http://rspec-api.github.io](http://rspec-api.github.io)
8+
More documentation and examples about RSpecApi are available at [http://rspec-api.github.io](http://rspec-api.github.io)
99

1010
[![Build Status](https://travis-ci.org/rspec-api/rspec-api-matchers.png?branch=master)](https://travis-ci.org/rspec-api/rspec-api-matchers)
1111
[![Code Climate](https://codeclimate.com/github/rspec-api/rspec-api-matchers.png)](https://codeclimate.com/github/rspec-api/rspec-api-matchers)
1212
[![Coverage Status](https://coveralls.io/repos/rspec-api/rspec-api-matchers/badge.png)](https://coveralls.io/r/rspec-api/rspec-api-matchers)
1313
[![Dependency Status](https://gemnasium.com/rspec-api/rspec-api-matchers.png)](https://gemnasium.com/rspec-api/rspec-api-matchers)
1414

15-
Install
16-
-------
17-
18-
Add `gem 'rspec-api-matchers'` to your `Gemfile` and run `bundle`.
19-
Or install yourself by running `gem install rspec-api-matchers`.
20-
21-
Version changes respect [Semantic Versioning](http://semver.org).
22-
To ensure `bundle update` won't cause problems in your repository,
23-
always indicate the patch version until version 1.0.0 is released, e.g.:
24-
25-
gem 'rspec-api-matchers', '~> 0.5.0'
26-
27-
2815
Available matchers
2916
------------------
3017

3118
expect(response).to have_status(:ok)
32-
expect(response).to include_content_type(:json)
33-
expect(response).to have_prev_page_link
19+
expect(response).to have_content_type(:json)
20+
expect(response).to have_page_links
3421
expect(response).to be_a_collection
35-
expect(response).to be_a_jsonp('alert')
22+
expect(response).to be_wrapped_in_callback('alert')
3623
expect(response).to be_sorted(by: :id, verse: :desc)
37-
expect(response).to be_filtered(10, by: :id)
24+
expect(response).to be_filtered(by: :id, value: 10)
3825
expect(response).to have_attributes(id: {value: 1.2}, url: {type: {string: :url}})
3926

27+
28+
How to install
29+
==============
30+
31+
To install on your system, run `gem install rspec-api-matchers`.
32+
To use inside a bundled Ruby project, add this line to the Gemfile:
33+
34+
gem 'rspec-api-matchers', '~> 0.5.0'
35+
36+
The rspec-api-matchers gem follows [Semantic Versioning](http://semver.org).
37+
Any new release that is fully backward-compatible bumps the *patch* version (0.5.1).
38+
Any new version that breaks compatibility bumps the *minor* version (0.6.0)
39+
40+
Indicating the full version in your Gemfile (*major*.*minor*.*patch*) guarantees
41+
that your project won’t occur in any error when you `bundle update` and a new
42+
version of RSpecApi::Matchers is released.
43+
44+
4045
How to contribute
4146
=================
4247

TODO.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
* Use `default_color` or `fixed_color` for "should not expect to"
2-
* Extract a common matcher class for "expect not_to" (`does_not_match?`)
1+
* Add &block option to have_attributes
2+
* Split `attribute_matcher` into `type_matcher`, `format_matcher`
33
* Improve example description
44
* Warn if the app declares matchers with the same name, like `be_filtered_by`

lib/rspec-api/dsl/be_a_collection.rb

Lines changed: 0 additions & 24 deletions
This file was deleted.

lib/rspec-api/dsl/be_a_jsonp.rb

Lines changed: 0 additions & 24 deletions
This file was deleted.

lib/rspec-api/dsl/be_filtered.rb

Lines changed: 0 additions & 24 deletions
This file was deleted.

lib/rspec-api/dsl/be_sorted.rb

Lines changed: 0 additions & 24 deletions
This file was deleted.

lib/rspec-api/dsl/have_attributes.rb

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)