Sha256: 14b3a810fc463e5cacdd2b2d5e7f16c04e663717daf6c084b1a2618e6b74413e

Contents?: true

Size: 1.83 KB

Versions: 20

Compression:

Stored size: 1.83 KB

Contents

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))
    end
  end

  context "get crosscite metadata" do
    it "SoftwareSourceCode" do
      expect(subject.valid?).to be true
      expect(subject.id).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.id).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

20 entries across 20 versions & 1 rubygems

Version Path
bolognese-0.9.33 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.32 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.31 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.30 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.29 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.28 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.27 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.26 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.25 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.24 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.23 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.22 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.21 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.20 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.19 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.18 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.17 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.16 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.15 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.14 spec/readers/crosscite_reader_spec.rb