From d58436bd0913f617a5c39f2be10fd6723b9b86f8 Mon Sep 17 00:00:00 2001 From: hiteshbedre <32206192+hiteshbedre@users.noreply.github.com> Date: Fri, 15 Oct 2021 16:22:12 +0530 Subject: [PATCH] Create dob.rb --- covid-scraper/src/dob.rb | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 covid-scraper/src/dob.rb diff --git a/covid-scraper/src/dob.rb b/covid-scraper/src/dob.rb new file mode 100644 index 0000000..679a1ff --- /dev/null +++ b/covid-scraper/src/dob.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +RSpec.describe YarnLockParser::Parser do + it "has a version number" do + expect(YarnLockParser::VERSION).not_to be nil + end + + describe "#parse" do + let(:expected_content) { fixture_file_content("fixtures/long_yarn.lock.expected") } + + it "parses small lock file" do + res = described_class.parse("spec/fixtures/long_yarn.lock") + expect(res.size).to eq(53) + expect(res.first[:name]).to eq("accepts") + expect(res.last[:name]).to eq("vary") + end + + it "parses a string" do + yarn_file = fixture_file_content("fixtures/long_yarn.lock") + res = described_class.parse_string(yarn_file) + expect(res.size).to eq(53) + expect(res.first[:name]).to eq("accepts") + expect(res.last[:name]).to eq("vary") + end +public void setBirthDate(java.util.Date birthDate) { + this.birthDate = birthDate; + } + + it "parses long lock file" do + res = described_class.parse("spec/fixtures/invalid_yarn.lock") + expect(res.nil?).to eq(true) + end + end +end