Skip to content

Commit 52207af

Browse files
authored
Merge pull request davidcelis#65 from codeodor/fix-specs
Set default paginator in ENV so specs don't fail without it
2 parents e9a6649 + aa5906f commit 52207af

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

.travis.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
language: ruby
22
sudo: false
33
rvm:
4-
- 1.9.3
5-
- 2.0.0
6-
- 2.1.0
7-
- 2.2.0
8-
- 2.3.0
4+
- 2.2.5
5+
- 2.3.1
96
script: bundle exec rspec
107
env:
118
- PAGINATOR=kaminari

spec/spec_helper.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@
22
require 'support/numbers_api'
33
require 'api-pagination'
44

5-
if ENV['PAGINATOR']
6-
require ENV['PAGINATOR']
7-
ApiPagination.config.paginator = ENV['PAGINATOR'].to_sym
8-
else
5+
if ENV['PAGINATOR'].nil?
96
warn 'No PAGINATOR set. Defaulting to kaminari. To test against will_paginate, run `PAGINATOR=will_paginate bundle exec rspec`'
10-
require 'kaminari'
11-
ApiPagination.config.paginator = :kaminari
7+
ENV['PAGINATOR'] = 'kaminari'
128
end
139

10+
require ENV['PAGINATOR']
11+
ApiPagination.config.paginator = ENV['PAGINATOR'].to_sym
12+
1413
require 'will_paginate/array'
1514

1615
RSpec.configure do |config|

0 commit comments

Comments
 (0)