Skip to content

Commit

Permalink
Added CSRF and API (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
jodosha authored Jun 30, 2021
1 parent 9e32ae4 commit 8812000
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/dry/inflector/inflections/defaults.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def self.uncountable(inflect)
# @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
Expand Down
4 changes: 3 additions & 1 deletion spec/unit/dry/inflector/acronym_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -29,6 +29,7 @@
["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],
Expand All @@ -42,6 +43,7 @@
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
Expand Down

0 comments on commit 8812000

Please sign in to comment.