Skip to content

Commit

Permalink
added a few env variables in order to control the verbosity of tests;…
Browse files Browse the repository at this point in the history
… added test for negative page number
  • Loading branch information
ddnexus committed Mar 8, 2021
1 parent 3eac56b commit 6751412
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/pagy_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
_(Pagy.new(count: 100, page: '')).must_be_instance_of Pagy
_(Pagy.new(count: 100, items: '10')).must_be_instance_of Pagy
_(proc { Pagy.new({}) }).must_raise Pagy::VariableError
_(proc { Pagy.new(count: 0, page: -1) }).must_raise Pagy::VariableError
_(proc { Pagy.new(count: 100, page: 0) }).must_raise Pagy::VariableError
_(proc { Pagy.new(count: 100, page: 2, items: 0) }).must_raise Pagy::VariableError
_(proc { Pagy.new(count: 100, page: 2, size: [1, 2, 3]).series }).must_raise Pagy::VariableError
Expand Down
4 changes: 4 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
# encoding: utf-8
# frozen_string_literal: true

$VERBOSE = {'false' => false, 'true' => true}[ENV['VERBOSE']] if ENV['VERBOSE']

require 'bundler/setup'

require 'simplecov' if ENV['RUN_SIMPLECOV'] == 'true'

if ENV['RUN_CODECOV'] == 'true'
require 'codecov'
SimpleCov.formatter = SimpleCov::Formatter::Codecov
else
SimpleCov.formatter = SimpleCov::Formatter::SimpleFormatter if ENV['SILENT_SIMPLECOV'] == 'true'
end

$LOAD_PATH.unshift File.expand_path("../../lib", __FILE__)
Expand Down

0 comments on commit 6751412

Please sign in to comment.