fieldhand 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,31 @@
1
+ require 'fieldhand/set'
2
+ require 'ox'
3
+
4
+ module Fieldhand
5
+ RSpec.describe Set do
6
+ describe '#descriptions' do
7
+ it 'returns an empty array if there are no descriptions' do
8
+ element = ::Ox.parse('<set/>')
9
+ set = described_class.new(element)
10
+
11
+ expect(set.descriptions).to be_empty
12
+ end
13
+
14
+ it 'returns descriptions when present' do
15
+ element = ::Ox.parse('<set><setDescription/><setDescription/></set>')
16
+ set = described_class.new(element)
17
+
18
+ expect(set.descriptions.size).to eq(2)
19
+ end
20
+ end
21
+
22
+ describe '#to_s' do
23
+ it 'returns the set spec' do
24
+ element = ::Ox.parse('<set><setSpec>A</setSpec></set>')
25
+ set = described_class.new(element)
26
+
27
+ expect(set.to_s).to eq('A')
28
+ end
29
+ end
30
+ end
31
+ end
@@ -0,0 +1,28 @@
1
+ require 'webmock/rspec'
2
+
3
+ RSpec.configure do |config|
4
+ config.shared_context_metadata_behavior = :apply_to_host_groups
5
+ config.filter_run_when_matching :focus
6
+ config.example_status_persistence_file_path = 'spec/examples.txt'
7
+ config.disable_monkey_patching!
8
+ config.warnings = true
9
+ config.default_formatter = 'doc' if config.files_to_run.one?
10
+ config.profile_examples = 10
11
+ config.order = :random
12
+ Kernel.srand config.seed
13
+
14
+ config.expect_with :rspec do |expectations|
15
+ expectations.include_chain_clauses_in_custom_matcher_descriptions = true
16
+ end
17
+
18
+ config.mock_with :rspec do |mocks|
19
+ mocks.verify_partial_doubles = true
20
+ end
21
+
22
+ def stub_oai_request(uri, fixture)
23
+ fixtures_dir = File.expand_path('../fixtures', __FILE__)
24
+
25
+ stub_request(:get, uri).
26
+ to_return(:body => File.read(File.join(fixtures_dir, fixture)))
27
+ end
28
+ end
metadata ADDED
@@ -0,0 +1,145 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: fieldhand
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Paul Mucur
8
+ - Maciej Gajewski
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2017-05-07 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: ox
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '2.5'
21
+ type: :runtime
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - "~>"
26
+ - !ruby/object:Gem::Version
27
+ version: '2.5'
28
+ - !ruby/object:Gem::Dependency
29
+ name: rspec
30
+ requirement: !ruby/object:Gem::Requirement
31
+ requirements:
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '3.6'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '3.6'
42
+ - !ruby/object:Gem::Dependency
43
+ name: webmock
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '1.21'
49
+ - - "<"
50
+ - !ruby/object:Gem::Version
51
+ version: '1.22'
52
+ type: :development
53
+ prerelease: false
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - "~>"
57
+ - !ruby/object:Gem::Version
58
+ version: '1.21'
59
+ - - "<"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.22'
62
+ - !ruby/object:Gem::Dependency
63
+ name: addressable
64
+ requirement: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.3'
69
+ - - "<"
70
+ - !ruby/object:Gem::Version
71
+ version: '2.4'
72
+ type: :development
73
+ prerelease: false
74
+ version_requirements: !ruby/object:Gem::Requirement
75
+ requirements:
76
+ - - "~>"
77
+ - !ruby/object:Gem::Version
78
+ version: '2.3'
79
+ - - "<"
80
+ - !ruby/object:Gem::Version
81
+ version: '2.4'
82
+ description: " A library to harvest metadata from OAI-PMH repositories.\n"
83
+ email: support@altmetric.com
84
+ executables: []
85
+ extensions: []
86
+ extra_rdoc_files: []
87
+ files:
88
+ - LICENSE
89
+ - README.md
90
+ - lib/fieldhand.rb
91
+ - lib/fieldhand/arguments.rb
92
+ - lib/fieldhand/datestamp.rb
93
+ - lib/fieldhand/header.rb
94
+ - lib/fieldhand/identify.rb
95
+ - lib/fieldhand/logger.rb
96
+ - lib/fieldhand/metadata_format.rb
97
+ - lib/fieldhand/paginator.rb
98
+ - lib/fieldhand/record.rb
99
+ - lib/fieldhand/repository.rb
100
+ - lib/fieldhand/set.rb
101
+ - spec/fieldhand/arguments_spec.rb
102
+ - spec/fieldhand/datestamp_spec.rb
103
+ - spec/fieldhand/header_spec.rb
104
+ - spec/fieldhand/identify_spec.rb
105
+ - spec/fieldhand/metadata_format_spec.rb
106
+ - spec/fieldhand/paginator_spec.rb
107
+ - spec/fieldhand/record_spec.rb
108
+ - spec/fieldhand/repository_spec.rb
109
+ - spec/fieldhand/set_spec.rb
110
+ - spec/spec_helper.rb
111
+ homepage: https://github.com/altmetric/fieldhand
112
+ licenses:
113
+ - MIT
114
+ metadata: {}
115
+ post_install_message:
116
+ rdoc_options: []
117
+ require_paths:
118
+ - lib
119
+ required_ruby_version: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ required_rubygems_version: !ruby/object:Gem::Requirement
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ version: '0'
129
+ requirements: []
130
+ rubyforge_project:
131
+ rubygems_version: 2.5.1
132
+ signing_key:
133
+ specification_version: 4
134
+ summary: An OAI-PMH harvester
135
+ test_files:
136
+ - spec/fieldhand/arguments_spec.rb
137
+ - spec/fieldhand/datestamp_spec.rb
138
+ - spec/fieldhand/header_spec.rb
139
+ - spec/fieldhand/identify_spec.rb
140
+ - spec/fieldhand/metadata_format_spec.rb
141
+ - spec/fieldhand/paginator_spec.rb
142
+ - spec/fieldhand/record_spec.rb
143
+ - spec/fieldhand/repository_spec.rb
144
+ - spec/fieldhand/set_spec.rb
145
+ - spec/spec_helper.rb