arxivsync 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/test/parser.rb DELETED
@@ -1,37 +0,0 @@
1
- require 'arxivsync'
2
- require 'minitest/autorun'
3
-
4
- TEST_ROOT = File.dirname(__FILE__)
5
-
6
- class TestParser < Minitest::Test
7
- def test_parser
8
- archive = ArxivSync::XMLArchive.new(File.join(TEST_ROOT, 'fixtures'))
9
- tested = 0
10
- archive.read_metadata do |papers|
11
- assert_equal papers.count, 1000
12
- papers.each do |paper|
13
- if paper.id == "1302.0649"
14
- assert_equal paper.created, Date.parse("2013-02-04")
15
- assert_equal paper.updated, nil
16
- assert_equal paper.title, "Correlation effects in the electronic structure of the Ni-based superconducting KNi2S2"
17
- assert_equal paper.license, "http://creativecommons.org/licenses/by/3.0/"
18
- assert_equal paper.primary_category, "cond-mat.supr-con"
19
- assert_equal paper.crosslists, []
20
- assert_includes paper.abstract, "using Gutzwiller approximation method."
21
- assert_equal paper.authors.map(&:keyname), ["Lu", "Wang", "Xie", "Zhang"]
22
- assert_equal paper.authors.map(&:forenames), ["Feng", "Wei-Hua", "Xinjian", "Fu-Chun"]
23
- tested += 1
24
- end
25
-
26
- if paper.id == "1302.0758"
27
- assert_equal paper.authors[0].affiliation, "Baylor University, Waco, TX, USA"
28
- assert_equal paper.comments, "8 pages, 4 figures; presented by BFLW at ICHEP 2012"
29
- assert_equal paper.report_no, "BU-HEPP-12-05"
30
- tested += 1
31
- end
32
- end
33
- end
34
-
35
- assert_equal tested, 2
36
- end
37
- end