exlibris-primo 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Exlibris::Primo
2
- [![Build Status](https://secure.travis-ci.org/scotdalton/exlibris-primo.png)](https://travis-ci.org/scotdalton/exlibris-primo)
2
+ [![Build Status](https://api.travis-ci.org/scotdalton/exlibris-primo.png?branch=master)](https://travis-ci.org/scotdalton/exlibris-primo)
3
3
  [![Dependency Status](https://gemnasium.com/scotdalton/exlibris-primo.png)](https://gemnasium.com/scotdalton/exlibris-primo)
4
4
  [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/scotdalton/exlibris-primo)
5
5
 
@@ -10,7 +10,7 @@ module Exlibris
10
10
 
11
11
  self.abstract = true
12
12
 
13
- attr_accessor :record_id, :original_id,
13
+ attr_accessor :institution, :record_id, :original_id,
14
14
  :url, :display, :notes, :subfields
15
15
  end
16
16
 
@@ -1,5 +1,5 @@
1
1
  module Exlibris
2
2
  module Primo
3
- VERSION = "1.0.5"
3
+ VERSION = "1.0.6"
4
4
  end
5
5
  end
@@ -1,6 +1,7 @@
1
1
  require 'test_helper'
2
2
  class LinkTest < Test::Unit::TestCase
3
3
  def setup
4
+ @institution = "INSTITUTION"
4
5
  @record_id = "aleph002895625"
5
6
  @url = "http://example.com"
6
7
  end
@@ -13,8 +14,9 @@ class LinkTest < Test::Unit::TestCase
13
14
 
14
15
  def test_new_fulltext
15
16
  assert_nothing_raised {
16
- link = Exlibris::Primo::Fulltext.new :record_id => @record_id,
17
+ link = Exlibris::Primo::Fulltext.new :institution => @institution, :record_id => @record_id,
17
18
  :original_id => @record_id, :url => @url, :display => "Fulltext Instance"
19
+ assert_equal "INSTITUTION", link.institution
18
20
  assert_equal "aleph002895625", link.record_id
19
21
  assert_equal "aleph002895625", link.original_id
20
22
  assert_equal "http://example.com", link.url
@@ -23,8 +25,9 @@ class LinkTest < Test::Unit::TestCase
23
25
  end
24
26
 
25
27
  def test_new_table_of_contents
26
- link = Exlibris::Primo::TableOfContents.new :record_id => @record_id,
28
+ link = Exlibris::Primo::TableOfContents.new :institution => @institution, :record_id => @record_id,
27
29
  :original_id => @record_id, :url => @url, :display => "Table of Contents Instance"
30
+ assert_equal "INSTITUTION", link.institution
28
31
  assert_equal "aleph002895625", link.record_id
29
32
  assert_equal "aleph002895625", link.original_id
30
33
  assert_equal "http://example.com", link.url
@@ -32,8 +35,9 @@ class LinkTest < Test::Unit::TestCase
32
35
  end
33
36
 
34
37
  def test_new_related_link
35
- link = Exlibris::Primo::RelatedLink.new :record_id => @record_id,
38
+ link = Exlibris::Primo::RelatedLink.new :institution => @institution, :record_id => @record_id,
36
39
  :original_id => @record_id, :url => @url, :display => "Related Link Instance"
40
+ assert_equal "INSTITUTION", link.institution
37
41
  assert_equal "aleph002895625", link.record_id
38
42
  assert_equal "aleph002895625", link.original_id
39
43
  assert_equal "http://example.com", link.url
@@ -5,6 +5,8 @@ module Pnx
5
5
  record = Exlibris::Primo::Record.new(:raw_xml => dedupmgr_record_xml)
6
6
  assert_not_nil record.fulltexts
7
7
  assert((not record.fulltexts.empty?))
8
+ assert_not_nil(record.fulltexts.first.institution)
9
+ assert_equal("NYU", record.fulltexts.first.institution)
8
10
  assert_not_nil(record.fulltexts.first.record_id)
9
11
  assert_equal("dedupmrg17343091", record.fulltexts.first.record_id)
10
12
  assert_not_nil(record.fulltexts.first.original_id)
@@ -17,6 +19,8 @@ module Pnx
17
19
  record = Exlibris::Primo::Record.new(:raw_xml => dedupmgr_record_xml)
18
20
  assert_not_nil record.tables_of_contents
19
21
  assert((not record.tables_of_contents.empty?))
22
+ assert_not_nil(record.tables_of_contents.first.institution)
23
+ assert_equal("NYUAD", record.tables_of_contents.first.institution)
20
24
  assert_not_nil(record.tables_of_contents.first.record_id)
21
25
  assert_equal("dedupmrg17343091", record.tables_of_contents.first.record_id)
22
26
  assert_not_nil(record.tables_of_contents.first.original_id)
@@ -31,6 +35,8 @@ module Pnx
31
35
  record = Exlibris::Primo::Record.new(:raw_xml => dedupmgr_record_xml)
32
36
  assert_not_nil record.related_links
33
37
  assert((not record.related_links.empty?))
38
+ assert_equal("NYUAD", record.related_links.first.institution)
39
+ assert_not_nil(record.related_links.first.record_id)
34
40
  assert_not_nil(record.related_links.first.record_id)
35
41
  assert_equal("dedupmrg17343091", record.related_links.first.record_id)
36
42
  assert_not_nil(record.related_links.first.original_id)
@@ -19,12 +19,10 @@ require 'webmock'
19
19
  # have to tell webmock to let us.
20
20
  WebMock.allow_net_connect!(:net_http_connect_on_start => true)
21
21
 
22
- without_ctx_tim = VCR.request_matchers.uri_without_param(:ctx_tim)
23
22
  VCR.configure do |c|
24
23
  c.cassette_library_dir = 'test/vcr_cassettes'
25
24
  # webmock needed for HTTPClient testing
26
25
  c.hook_into :webmock
27
- c.register_request_matcher(:uri_without_ctx_tim, &without_ctx_tim)
28
26
  # c.debug_logger = $stderr
29
27
  end
30
28
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exlibris-primo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-01-16 00:00:00.000000000 Z
12
+ date: 2013-02-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -421,7 +421,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
421
421
  version: '0'
422
422
  segments:
423
423
  - 0
424
- hash: -1133596326614136531
424
+ hash: -1710299729139398631
425
425
  required_rubygems_version: !ruby/object:Gem::Requirement
426
426
  none: false
427
427
  requirements:
@@ -430,7 +430,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
430
430
  version: '0'
431
431
  segments:
432
432
  - 0
433
- hash: -1133596326614136531
433
+ hash: -1710299729139398631
434
434
  requirements: []
435
435
  rubyforge_project:
436
436
  rubygems_version: 1.8.24