File: fix-FTBFS-with-ruby-rspec-3.12.patch

package info (click to toggle)
ruby-grape 1.6.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,156 kB
  • sloc: ruby: 25,265; makefile: 7
file content (64 lines) | stat: -rw-r--r-- 4,056 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
Author: dblock <dblock@dblock.org>
Origin: upstream, https://github.com/ruby-grape/grape/commit/76fa2ffe5816c7ac50aa8ed6ad89a74cd399fca4
Description: fix FTBFS with ruby-rspec 3.12
Bug-Debian: https://bugs.debian.org/1027074
Last-Update: 2023-01-02

Index: ruby-grape/spec/grape/dsl/request_response_spec.rb
===================================================================
--- ruby-grape.orig/spec/grape/dsl/request_response_spec.rb
+++ ruby-grape/spec/grape/dsl/request_response_spec.rb
@@ -162,34 +162,34 @@ module Grape
 
         describe 'list of exceptions is passed' do
           it 'sets hash of exceptions as rescue handlers' do
-            expect(subject).to receive(:namespace_reverse_stackable).with(:rescue_handlers, StandardError => nil)
+            expect(subject).to receive(:namespace_reverse_stackable).with(:rescue_handlers, { StandardError => nil })
             expect(subject).to receive(:namespace_stackable).with(:rescue_options, {})
             subject.rescue_from StandardError
           end
 
           it 'rescues only base handlers if rescue_subclasses: false option is passed' do
-            expect(subject).to receive(:namespace_reverse_stackable).with(:base_only_rescue_handlers, StandardError => nil)
-            expect(subject).to receive(:namespace_stackable).with(:rescue_options, rescue_subclasses: false)
+            expect(subject).to receive(:namespace_reverse_stackable).with(:base_only_rescue_handlers, { StandardError => nil })
+            expect(subject).to receive(:namespace_stackable).with(:rescue_options, { rescue_subclasses: false })
             subject.rescue_from StandardError, rescue_subclasses: false
           end
 
           it 'sets given proc as rescue handler for each key in hash' do
             rescue_handler_proc = proc {}
-            expect(subject).to receive(:namespace_reverse_stackable).with(:rescue_handlers, StandardError => rescue_handler_proc)
+            expect(subject).to receive(:namespace_reverse_stackable).with(:rescue_handlers, { StandardError => rescue_handler_proc })
             expect(subject).to receive(:namespace_stackable).with(:rescue_options, {})
             subject.rescue_from StandardError, rescue_handler_proc
           end
 
           it 'sets given block as rescue handler for each key in hash' do
             rescue_handler_proc = proc {}
-            expect(subject).to receive(:namespace_reverse_stackable).with(:rescue_handlers, StandardError => rescue_handler_proc)
+            expect(subject).to receive(:namespace_reverse_stackable).with(:rescue_handlers, { StandardError => rescue_handler_proc })
             expect(subject).to receive(:namespace_stackable).with(:rescue_options, {})
             subject.rescue_from StandardError, &rescue_handler_proc
           end
 
           it 'sets a rescue handler declared through :with option for each key in hash' do
             with_block = -> { 'hello' }
-            expect(subject).to receive(:namespace_reverse_stackable).with(:rescue_handlers, StandardError => an_instance_of(Proc))
+            expect(subject).to receive(:namespace_reverse_stackable).with(:rescue_handlers, { StandardError => an_instance_of(Proc) })
             expect(subject).to receive(:namespace_stackable).with(:rescue_options, {})
             subject.rescue_from StandardError, with: with_block
           end
Index: ruby-grape/spec/grape/dsl/routing_spec.rb
===================================================================
--- ruby-grape.orig/spec/grape/dsl/routing_spec.rb
+++ ruby-grape/spec/grape/dsl/routing_spec.rb
@@ -21,7 +21,7 @@ module Grape
         it 'sets a version for route' do
           version = 'v1'
           expect(subject).to receive(:namespace_inheritable).with(:version, [version])
-          expect(subject).to receive(:namespace_inheritable).with(:version_options, using: :path)
+          expect(subject).to receive(:namespace_inheritable).with(:version_options, { using: :path })
           expect(subject.version(version)).to eq(version)
         end
       end