Skip to content

Commit 632b188

Browse files
committed
some modifications to get tests passing
1 parent 5c6ae47 commit 632b188

File tree

10 files changed

+9
-56
lines changed

10 files changed

+9
-56
lines changed

Changes

Lines changed: 0 additions & 36 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
```
2-
_ _
3-
_ __ _ _| |__ _ _ ___ __ _(_)
4-
| '__| | | | '_ \| | | |_____ / _ \ / _` | |
5-
| | | |_| | |_) | |_| |_____| (_) | (_| | |
6-
|_| \__,_|_.__/ \__, | \___/ \__,_|_|
7-
|___/
8-
```
1+
ruby-oai
2+
========
93

104
ruby-oai is a Open Archives Protocol for Metadata Harvesting (OAI-PMH)
115
library for Ruby. OAI-PMH[http://openarchives.org] it is a somewhat

Rakefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ spec = Gem::Specification.new do |s|
2121
s.summary = 'A ruby library for working with the Open Archive Initiative Protocol for Metadata Harvesting (OAI-PMH)'
2222
s.require_path = 'lib'
2323
s.autorequire = 'oai'
24-
s.has_rdoc = true
2524
s.bindir = 'bin'
2625
s.executables = 'oai'
2726

lib/oai/provider/metadata_format.rb

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,8 @@ def value_for(field, record, map)
5858

5959
if record.respond_to?(pluralize(method))
6060
record.send pluralize(method)
61-
elsif record.respond_to?(method)
62-
# at this point, this function will throw a dep. error because of the call to type -- a reserved work
63-
# in ruby
61+
elsif method != 'type' and record.respond_to?(method)
62+
# TODO: this calls type, which is deprecated, should be
6463
record.send method
6564
else
6665
[]

lib/oai/provider/response.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ def valid?
6161

6262
return true if self.class.valid_options.nil? and options.empty?
6363

64-
# Added by [email protected]. Needed if the request includes an argument and there are no valid arguments for that verb (Identify, for example).
64+
# check if the request includes an argument and there are no valid
65+
# arguments for that verb (Identify, for example).
6566
raise OAI::ArgumentException.new if self.class.valid_options.nil? && !options.empty?
6667

6768
if self.class.required_options

lib/oai/provider/resumption_token.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ def self.parse(token_string)
3232
end
3333
self.new(options)
3434
rescue => err
35-
36-
# This was not caught by the tests.
3735
raise OAI::ResumptionTokenException.new
3836
end
3937
end

test/client/tc_exception.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class ExceptionTest < Test::Unit::TestCase
44

55
def test_not_found
66
client = OAI::Client.new 'http://www.google.com'
7-
assert_raises(ArgumentError) { client.identify }
7+
assert_raises(OAI::Exception) { client.identify }
88
end
99

1010
def test_xml_error

test/client/tc_low_resolution_dates.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
class LowResolutionDatesTest < Test::Unit::TestCase
44

55
def test_low_res_date_parsing
6-
client = OAI::Client.new 'http://caltechcstr.library.caltech.edu/perl/oai2'
6+
client = OAI::Client.new 'http://authors.library.caltech.edu/cgi/oai2'
77

88
date = Date.new 2003, 1, 1
99

test/provider/models.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ def generate_chunks(records, limit)
112112
end
113113

114114
def generate_records(number, timestamp = Time.now.utc.xmlschema, sets = [], deleted = false)
115-
# [email protected] -- causes tests to die
116-
# @earliest = timestamp.dup if @earliest.nil? || timestamp.to_s < @earliest
115+
@earliest = timestamp.dup if @earliest.nil? || timestamp.to_s < @earliest
117116
@earliest = timestamp.dup if @earliest.nil?
118117

119118
# Add any sets we don't already have

test/provider/tc_exceptions.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ def setup
77
@provider = ComplexProvider.new
88
end
99

10-
1110
def test_argument_exception
1211
assert_raise(OAI::ArgumentException) do
1312
@provider.identify(:identifier => 'invalid_arg')

0 commit comments

Comments
 (0)