Added CSRF and API (#35)

This commit is contained in:
Luca Guidi 2021-06-30 10:27:31 +02:00 committed by GitHub
parent 9e32ae4b51
commit 8812000830
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -110,7 +110,7 @@ module Dry
# @since 0.1.2
# @api private
def self.acronyms(inflect)
inflect.acronym(*%w[JSON HTTP OpenSSL HMAC])
inflect.acronym(*%w[JSON HTTP OpenSSL HMAC CSRF API])
end
private_class_method :plural, :singular, :irregular, :uncountable, :acronyms

View File

@ -3,7 +3,7 @@
RSpec.describe Dry::Inflector do
subject do
Dry::Inflector.new do |inflect|
inflect.acronym("API", "RESTful", "RoR", "PhD", "W3C", "SSL", "HTML")
inflect.acronym("RESTful", "RoR", "PhD", "W3C", "SSL", "HTML")
end
end
@ -29,6 +29,7 @@ RSpec.describe Dry::Inflector do
["HTTP::RESTful", "http/restful", "HTTP/RESTful"],
["HTTP::RESTfulAPI", "http/restful_api", "HTTP/RESTful API"],
["APIRESTful", "api_restful", "API RESTful"],
["CSRF", "csrf", "Cross Site Request Forgery"],
# misdirection
%w[Capistrano capistrano Capistrano],
@ -42,6 +43,7 @@ RSpec.describe Dry::Inflector do
expect(subject.camelize(camel)).to eql(camel)
expect(subject.underscore(camel)).to eql(under)
expect(subject.underscore(under)).to eql(under)
expect(subject.humanize(human)).to eql(human)
end
end