Sha256: ce95725dc1f6157a1b1c9c09f6f91b70df348752f5a352f09cefbc2a84c0110c

Contents?: true

Size: 1.83 KB

Versions: 55

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).strip)
    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

55 entries across 55 versions & 1 rubygems

Version Path
bolognese-0.9.75 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.74 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.73 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.72 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.71 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.70 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.69 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.68 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.67 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.66 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.65 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.64 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.63 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.62 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.61 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.60 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.59 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.58 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.56 spec/readers/crosscite_reader_spec.rb
bolognese-0.9.55 spec/readers/crosscite_reader_spec.rb