Skip to content

Commit 21018d7

Browse files
committed
Bump version to 0.0.9
solves deprication warning for: The `:example_group` key in an example group's metadata hash is deprecated. Use the example group's hash directly for the computed keys and `:parent_example_group` to access the parent example group metadata instead. Called from /home/chris/dev/forked_gems/rspec_api also solves scope issue with rspec hooks, the example needs tobe passed into the block. adds support for non-Rails(Sintra) apps tested via rspec and Rack::test Signed-off-by: ChrisCPO <[email protected]>
1 parent 16d6e69 commit 21018d7

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ Write tests using the following convention:
2929
- Tests must be placed in `spec/requests` folder or they have to be tagged with `type: :request`
3030
- Top level descriptions are named after the model (plural form) followed by the word “Requests”. For a example model called Arena it would be “Arenas Requests”.
3131
- Second level descriptions are actions in the form of “VERB path”. For the show action of the Arenas controller it would be “GET /arenas/{id}”.
32+
- Run your specs as normal and files named after the plural form of the model will
33+
be created in a folder at the root directory of your project named
34+
'/api_docs'. The documentation for Arenas would be at
35+
`<project_root>/api_docs/arenas.txt`
3236

3337
Example:
3438

lib/rspec_api_blueprint.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
require "rspec_api_blueprint/version"
22
require "rspec_api_blueprint/string_extensions"
33

4+
require "active_support/all"
5+
46

57
RSpec.configure do |config|
68
config.before(:suite) do
@@ -17,7 +19,7 @@
1719
end
1820
end
1921

20-
config.after(:each, type: :request) do
22+
config.after(:each, type: :request) do |example|
2123
response ||= last_response
2224
request ||= last_request
2325

@@ -27,7 +29,7 @@
2729

2830
while example_group
2931
example_groups << example_group
30-
example_group = example_group[:example_group]
32+
example_group = example_group[:parent_example_group]
3133
end
3234

3335
action = example_groups[-2][:description_args].first if example_groups[-2]

lib/rspec_api_blueprint/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module RspecApiBlueprint
2-
VERSION = "0.0.8"
2+
VERSION = "0.0.9"
33
end

rspec_api_blueprint.gemspec

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,5 @@ Gem::Specification.new do |spec|
2222
spec.add_development_dependency "rake"
2323

2424
spec.add_dependency 'rspec-rails'
25-
end
25+
spec.add_dependency 'activesupport'
26+
end

0 commit comments

Comments
 (0)