rspec-apib 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Dockerfile +8 -7
- data/README.md +13 -2
- data/docker-compose.yml +1 -1
- data/lib/rspec/apib/recorder.rb +9 -5
- data/lib/rspec/apib/version.rb +1 -1
- data/rspec-apib.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e21bc20a799776d00e2f3b82f83eaf4774259ad
|
4
|
+
data.tar.gz: 8eaa71920cf9d9c91b4963db7540ec6e5f8a6974
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 91fd05e7336b5bc66def994ca582ae77bfd6234ce5fefff43bff0bc4fc91320a87398244b518e48a58fba0a14e81c03b8dcc0728e82ed1ee8e8459f58c19640a
|
7
|
+
data.tar.gz: dffd4b76bbdbac4219ff132691b6af552f5925b02ef459189ae2c938c9f0cdebedfbd6b31dc2f49c2c5a7d18e5606abfc1c4be029b9e70609c22a48e032609c5
|
data/Dockerfile
CHANGED
@@ -10,15 +10,16 @@ ENV APP_HOME /usr/src/app
|
|
10
10
|
RUN mkdir $APP_HOME
|
11
11
|
WORKDIR $APP_HOME
|
12
12
|
|
13
|
-
#
|
14
|
-
|
13
|
+
# Install bundler
|
14
|
+
RUN gem install bundler
|
15
|
+
|
16
|
+
# Increase Bundler workers
|
17
|
+
ENV BUNDLE_JOBS=2
|
15
18
|
|
16
|
-
#
|
17
|
-
|
18
|
-
BUNDLE_JOBS=2 \
|
19
|
-
BUNDLE_PATH=/bundle
|
19
|
+
# Copy working directory
|
20
|
+
COPY . $APP_HOME
|
20
21
|
|
21
|
-
# Install gems
|
22
|
+
# Install newer version of Bundler and gems
|
22
23
|
RUN bundle install
|
23
24
|
|
24
25
|
# Add bin/ folder to PATH
|
data/README.md
CHANGED
@@ -51,10 +51,21 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
51
51
|
|
52
52
|
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).
|
53
53
|
|
54
|
-
##
|
54
|
+
## Testing
|
55
|
+
|
56
|
+
To do continuous testing during development `guard` can be used. In order to
|
57
|
+
test against multiple versions of Rails, the environment variable
|
58
|
+
`RAILS_VERSION` can be used to choose a different dependency pattern then the
|
59
|
+
default one specified in the *.gemspec* file.
|
60
|
+
|
61
|
+
```
|
62
|
+
RAILS_VERSION='~> 4.0' bundle install; bundle exec rspec
|
63
|
+
RAILS_VERSION='~> 5.0' bundle install; bundle exec rspec
|
64
|
+
```
|
55
65
|
|
56
|
-
|
66
|
+
## Contributing
|
57
67
|
|
68
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/spieker/rspec-apib. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
58
69
|
|
59
70
|
## License
|
60
71
|
|
data/docker-compose.yml
CHANGED
data/lib/rspec/apib/recorder.rb
CHANGED
@@ -33,11 +33,11 @@ module RSpec
|
|
33
33
|
|
34
34
|
# The routing object for the rails route of the request
|
35
35
|
def route
|
36
|
-
@route
|
37
|
-
|
38
|
-
route =
|
39
|
-
route
|
36
|
+
return @route if @route
|
37
|
+
routes.router.recognize(request) do |r, params|
|
38
|
+
@route = r
|
40
39
|
end
|
40
|
+
@route
|
41
41
|
end
|
42
42
|
|
43
43
|
# The top level example group the example is contained in
|
@@ -56,7 +56,11 @@ module RSpec
|
|
56
56
|
parts = route.parts
|
57
57
|
tmp = {}
|
58
58
|
parts.each do |part|
|
59
|
-
|
59
|
+
optional_parts = route.respond_to?(:optional_parts) ?
|
60
|
+
route.optional_parts :
|
61
|
+
(route.parts - route.required_parts)
|
62
|
+
|
63
|
+
if optional_parts.include?(part)
|
60
64
|
tmp[part] = "(:#{part}:)"
|
61
65
|
else
|
62
66
|
tmp[part] = ":#{part}:"
|
data/lib/rspec/apib/version.rb
CHANGED
data/rspec-apib.gemspec
CHANGED
@@ -23,6 +23,6 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.add_development_dependency 'guard', '~> 2.13.0'
|
24
24
|
spec.add_development_dependency 'guard-rspec', '~> 4.6.4'
|
25
25
|
spec.add_development_dependency 'pry'
|
26
|
-
spec.add_dependency 'rails', '>= 4.2'
|
26
|
+
spec.add_dependency 'rails', (ENV['RAILS_VERSION'] || '>= 4.2')
|
27
27
|
spec.add_dependency 'rspec-rails', '~> 3.4'
|
28
28
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-apib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Spieker
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -160,7 +160,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
160
160
|
version: '0'
|
161
161
|
requirements: []
|
162
162
|
rubyforge_project:
|
163
|
-
rubygems_version: 2.
|
163
|
+
rubygems_version: 2.6.12
|
164
164
|
signing_key:
|
165
165
|
specification_version: 4
|
166
166
|
summary: Generates API Blueprint from request specs
|