Skip to content

Commit

Permalink
Merge pull request #165 from OpenGeoMetadata/reorg-spec
Browse files Browse the repository at this point in the history
Rename spec
  • Loading branch information
ewlarson committed Jan 29, 2024
2 parents 954af96 + 3ac63a5 commit 323a711
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions spec/lib/geo_combine_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,28 @@

require 'spec_helper'

RSpec.describe GeoCombine::Metadata do
RSpec.describe GeoCombine do
include XmlDocs
describe '#initialize' do
it 'reads metadata from file if File is readable' do
expect(File).to receive(:readable?).and_return(true)
expect(File).to receive(:read).and_return(simple_xml)
metadata_object = described_class.new('./tmp/fake/file/location')
expect(metadata_object).to be_an described_class
expect(metadata_object.metadata).to be_an Nokogiri::XML::Document
expect(metadata_object.metadata.css('Author').count).to eq 2
end

it 'reads metadata from parameter if File is not readable' do
metadata_object = described_class.new(simple_xml)
expect(metadata_object).to be_an described_class
expect(metadata_object.metadata).to be_an Nokogiri::XML::Document
expect(metadata_object.metadata.css('Author').count).to eq 2
describe GeoCombine::Metadata do
describe '#initialize' do
it 'reads metadata from file if File is readable' do
expect(File).to receive(:readable?).and_return(true)
expect(File).to receive(:read).and_return(simple_xml)
metadata_object = described_class.new('./tmp/fake/file/location')
expect(metadata_object).to be_an described_class
expect(metadata_object.metadata).to be_an Nokogiri::XML::Document
expect(metadata_object.metadata.css('Author').count).to eq 2
end

it 'reads metadata from parameter if File is not readable' do
metadata_object = described_class.new(simple_xml)
expect(metadata_object).to be_an described_class
expect(metadata_object.metadata).to be_an Nokogiri::XML::Document
expect(metadata_object.metadata.css('Author').count).to eq 2
end
end
# GeoCombine subclasses should individually test `to_geoblacklight` and
# `to_html` methods
end
# GeoCombine subclasses should individually test `to_geoblacklight` and
# `to_html` methods
end

0 comments on commit 323a711

Please sign in to comment.