Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename spec #165

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading