Sha256: 9431fa7f9aac230956e4e4659499d600e230a85d601c39442c5bdf7e91498464
Contents?: true
Size: 963 Bytes
Versions: 3
Compression:
Stored size: 963 Bytes
Contents
require 'spec_helper' describe Bergamasco::Jats do subject { Bergamasco::Jats } it 'should convert to jats' do filepath = fixture_path + 'cool-dois.html.md' file = IO.read(filepath) xml = subject.render_jats(file, skip_yaml_header: true, csl: 'spec/fixtures/apa.csl', bibliography: 'spec/fixtures/references.yaml') doc = Nokogiri::XML(xml) article_id = doc.at_xpath("//article-id") expect(article_id.text).to eq("10.23725/0000-03VC") expect(article_id.values.first).to eq("doi") end it 'should write jats xml' do filepath = fixture_path + 'cool-dois.html.md' xml_path = subject.write_jats(filepath, skip_yaml_header: true, csl: 'spec/fixtures/apa.csl', bibliography: 'spec/fixtures/references.yaml') doc = File.open(xml_path) { |f| Nokogiri::XML(f) } article_id = doc.at_xpath("//article-id") expect(article_id.text).to eq("10.23725/0000-03VC") expect(article_id.values.first).to eq("doi") end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
bergamasco-0.3.2 | spec/jats_spec.rb |
bergamasco-0.3.1 | spec/jats_spec.rb |
bergamasco-0.3 | spec/jats_spec.rb |