-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
changed sample param in docs to max 100, added test for random_dois t…
…o test this fix #30 bumped dev version
- Loading branch information
Showing
4 changed files
with
37 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Serrano | ||
VERSION = "0.2.2" | ||
VERSION = "0.2.2.1" | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
require 'simplecov' | ||
SimpleCov.start | ||
if ENV['CI']=='true' | ||
require 'codecov' | ||
SimpleCov.formatter = SimpleCov::Formatter::Codecov | ||
end | ||
|
||
require "serrano" | ||
require "serrano/error" | ||
require 'fileutils' | ||
require "test/unit" | ||
require "json" | ||
|
||
class TestRandomDois < Test::Unit::TestCase | ||
|
||
def test_random_dois | ||
res = Serrano.random_dois() | ||
assert_equal(10, res.length) | ||
assert_equal(Array, res.class) | ||
assert_equal(String, res[0].class) | ||
end | ||
|
||
def test_random_dois_limit | ||
res = Serrano.random_dois(sample: 3) | ||
assert_equal(3, res.length) | ||
end | ||
|
||
def test_random_dois_errors | ||
assert_raise Serrano::BadRequest do | ||
puts Serrano.random_dois(sample: 101) | ||
end | ||
end | ||
end |