Sha256: 6825eb293c818933d85071fad9b74698abe76647950e0208f22056b0f070e523

Contents?: true

Size: 1.88 KB

Versions: 24

Compression:

Stored size: 1.88 KB

Contents

# frozen_string_literal: true

require 'spec_helper'

describe Bolognese::Metadata, vcr: true do
  let(:input) { fixture_path + "crosscite.json" }

  subject { Bolognese::Metadata.new(input: input) }

  context "get crosscite raw" do
    it "SoftwareSourceCode" do
      expect(subject.raw).to eq(IO.read(input).strip)
    end
  end

  context "get crosscite metadata" do
    it "SoftwareSourceCode" do
      expect(subject.valid?).to be true
      expect(subject.identifier).to eq("https://doi.org/10.5281/zenodo.48440")
      expect(subject.type).to eq("SoftwareSourceCode")
      expect(subject.resource_type_general).to eq("Software")
      expect(subject.author).to eq("type"=>"Person", "familyName" => "Garza", "givenName" => "Kristian", "name" => "Kristian Garza")
      expect(subject.title).to eq("Analysis Tools for Crossover Experiment of UI using Choice Architecture")
      expect(subject.description["text"]).to start_with("This tools are used to analyse the data produced by the Crosssover Experiment")
      expect(subject.date_published).to eq("2016-03-27")
    end

    it "SoftwareSourceCode as string" do
      input = IO.read(fixture_path + "crosscite.json")
      subject = Bolognese::Metadata.new(input: input)
      expect(subject.valid?).to be true
      expect(subject.identifier).to eq("https://doi.org/10.5281/zenodo.48440")
      expect(subject.type).to eq("SoftwareSourceCode")
      expect(subject.resource_type_general).to eq("Software")
      expect(subject.author).to eq("type"=>"Person", "familyName" => "Garza", "givenName" => "Kristian", "name" => "Kristian Garza")
      expect(subject.title).to eq("Analysis Tools for Crossover Experiment of UI using Choice Architecture")
      expect(subject.description["text"]).to start_with("This tools are used to analyse the data produced by the Crosssover Experiment")
      expect(subject.date_published).to eq("2016-03-27")
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
bolognese-0.15.9 spec/readers/crosscite_reader_spec.rb
bolognese-0.15.8 spec/readers/crosscite_reader_spec.rb
bolognese-0.15.6 spec/readers/crosscite_reader_spec.rb
bolognese-0.15.3 spec/readers/crosscite_reader_spec.rb
bolognese-0.15.1 spec/readers/crosscite_reader_spec.rb
bolognese-0.14.1 spec/readers/crosscite_reader_spec.rb
bolognese-0.14 spec/readers/crosscite_reader_spec.rb
bolognese-0.13.6 spec/readers/crosscite_reader_spec.rb
bolognese-0.13.4 spec/readers/crosscite_reader_spec.rb
bolognese-0.13.3 spec/readers/crosscite_reader_spec.rb
bolognese-0.13.2 spec/readers/crosscite_reader_spec.rb
bolognese-0.13.1 spec/readers/crosscite_reader_spec.rb
bolognese-0.12.3 spec/readers/crosscite_reader_spec.rb
bolognese-0.12.2 spec/readers/crosscite_reader_spec.rb
bolognese-0.12.1 spec/readers/crosscite_reader_spec.rb
bolognese-0.12 spec/readers/crosscite_reader_spec.rb
bolognese-0.11.7 spec/readers/crosscite_reader_spec.rb
bolognese-0.11.6 spec/readers/crosscite_reader_spec.rb
bolognese-0.11.5 spec/readers/crosscite_reader_spec.rb
bolognese-0.11.4 spec/readers/crosscite_reader_spec.rb