File: 0001-Allow-running-test-suite-without-PAGINATOR-set.patch

package info (click to toggle)
ruby-api-pagination 4.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 184 kB
  • ctags: 48
  • sloc: ruby: 689; makefile: 3
file content (30 lines) | stat: -rw-r--r-- 1,147 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
From: Antonio Terceiro <terceiro@softwarelivre.org>
Date: Thu, 4 Feb 2016 11:14:20 -0200
Subject: Allow running test suite without PAGINATOR set

kaminari is the default, so let's assume that. Otherwise, if PAGINATOR
is not set while running the test suite, you will always get a failure
like this:

  1) ApiPagination Using kaminari should accept paginate_array_options option
     Failure/Error: ApiPagination.config.paginator = ENV['PAGINATOR'].to_sym
     NoMethodError:
       undefined method `to_sym' for nil:NilClass
     # ./spec/api-pagination_spec.rb:13:in `block (3 levels) in <top (required)>'
---
 spec/api-pagination_spec.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/spec/api-pagination_spec.rb b/spec/api-pagination_spec.rb
index 998fcea..adcc887 100644
--- a/spec/api-pagination_spec.rb
+++ b/spec/api-pagination_spec.rb
@@ -10,7 +10,7 @@ describe ApiPagination do
     end
 
     after do
-      ApiPagination.config.paginator = ENV['PAGINATOR'].to_sym
+      ApiPagination.config.paginator = ENV.fetch('PAGINATOR', 'kaminari').to_sym
     end
 
     it 'should accept paginate_array_options option' do