Skip to content

Commit 728e002

Browse files
committed
Pass for: to Grape::Endpoint.new for Grape HEAD compatibility
Grape HEAD introduced Grape::Endpoint::Options (a Data class) that requires a :for keyword (the owner API class). Constructing an Endpoint without it raises ArgumentError: missing keyword: :for.
1 parent d08f8ab commit 728e002

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

spec/lib/endpoint_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
describe Grape::Endpoint do
66
subject do
7-
described_class.new(Grape::Util::InheritableSetting.new, path: '/', method: :get)
7+
# Grape >= HEAD requires :for (the owner API class) when constructing an Endpoint.
8+
described_class.new(Grape::Util::InheritableSetting.new, path: '/', method: :get, **{ for: Class.new(Grape::API) })
89
end
910

1011
describe '.content_types_for' do

0 commit comments

Comments
 (0)