nambrot / rspec-api-blueprint-formatter

Auto-generate API docs from your RSpec tests!
MIT License
55 stars 10 forks source link

Fix some minor issues with the formatter logic #2

Closed GregPK closed 7 years ago

GregPK commented 7 years ago

Fix some minor issues with the formatter logic:

(Note: I bumped the version number)

bug in catching uniqueness logic:

Given action.keys = [[["DELETE /api/v2/resource/:id"]], /api/v2/resource/:id"]]]

running:

actions.keys.map {|action| action.scan(/\[([A-Z]+)\]/).flatten[0] }

gives us [nil,nil] which in turn raises the exception. Changing the regexp from

/\[([A-Z]+)\]/

to

/\[([A-Z]+).*\]/

solves the issue

bug regarding shared_examples

Defining shared_examples doesn't have parents, so that parent[:action].nil? raises NoMethodError because parent is nil. Changed to check parent also.

fix typo: 'resoure' -> 'resource'

nambrot commented 7 years ago

Thank you for contribution!

nambrot commented 7 years ago

I pushed your changes to Rubygems and bumped the version to 0.1.3

GregPK commented 7 years ago

My pleasure, thanks for the gem!