From kde-commits Sat Oct 15 22:49:42 2016 From: Cornelius Schumacher Date: Sat, 15 Oct 2016 22:49:42 +0000 To: kde-commits Subject: [websites/inqlude] spec: Clean up tests Message-Id: X-MARC-Message: https://marc.info/?l=kde-commits&m=147657225116358 Git commit 3a4d498ea95bac67ce8de4f0ddccea06b1d1e4fe by Cornelius Schumacher. Committed on 14/08/2016 at 14:36. Pushed by cschumac into branch 'master'. Clean up tests * More expressive bracketing * Remove redundant tests M +14 -24 spec/integration/cli_view_spec.rb M +24 -24 spec/online/cli_view_spec.rb http://commits.kde.org/websites/inqlude/3a4d498ea95bac67ce8de4f0ddccea06b1d= 1e4fe diff --git a/spec/integration/cli_view_spec.rb b/spec/integration/cli_view_= spec.rb index 252f2d1..80f4e4c 100644 --- a/spec/integration/cli_view_spec.rb +++ b/spec/integration/cli_view_spec.rb @@ -55,16 +55,6 @@ describe "Command line interface" do "--output-dir=3D#{@output_dir}"]) end = - it "generates view" do - expect(File.exist?(File.join(@output_dir, "inqlude-all.json"))).to= be(true) - end - - it "checks format" do - data =3D File.read(File.join(@output_dir, 'inqlude-all.json')) - - expect {JSON.parse(data)}.to_not raise_error - end - it "checks number of manifests" do data =3D File.read(File.join(@output_dir, 'inqlude-all.json')) parsed_data =3D JSON.parse(data); @@ -78,7 +68,7 @@ describe "Command line interface" do expect(handler.libraries.length).to eq parsed_data.length end = - it "checks data" do + it "checks content" do data =3D File.read(File.join(@output_dir, 'inqlude-all.json')) parsed_data =3D JSON.parse(data); for element in parsed_data do @@ -98,22 +88,22 @@ describe "Command line interface" do = manifest =3D handler.library("awesomelib").latest_manifest = - (expect manifest.display_name).to eq "Awesomelib" - (expect manifest.release_date).to eq "2013-09-08" - (expect manifest.version).to eq "0.2.0" - (expect manifest.summary).to eq "Awesome library" - (expect manifest.topics).to eq ["API"] + expect(manifest.display_name).to eq "Awesomelib" + expect(manifest.release_date).to eq "2013-09-08" + expect(manifest.version).to eq "0.2.0" + expect(manifest.summary).to eq "Awesome library" + expect(manifest.topics).to eq ["API"] = - (expect manifest.urls.homepage).to eq "http://example.com" - (expect manifest.urls.download).to eq "http://example.com/download" - (expect manifest.urls.vcs).to eq "http://example.com/git" + expect(manifest.urls.homepage).to eq "http://example.com" + expect(manifest.urls.download).to eq "http://example.com/download" + expect(manifest.urls.vcs).to eq "http://example.com/git" = - (expect manifest.licenses).to eq ["LGPLv2.1+", "Commercial"] - (expect manifest.description).to eq "This is an awesome library." - (expect manifest.authors).to eq ["Cornelius Schumacher "] - (expect manifest.maturity).to eq "stable" + expect(manifest.licenses).to eq ["LGPLv2.1+", "Commercial"] + expect(manifest.description).to eq "This is an awesome library." + expect(manifest.authors).to eq ["Cornelius Schumacher "] + expect(manifest.maturity).to eq "stable" = - (expect manifest.packages.source).to eq "ftp://example.com/downloa= d/awesomelib-0.2.0.tar.gz" + expect(manifest.packages.source).to eq "ftp://example.com/download= /awesomelib-0.2.0.tar.gz" end end end diff --git a/spec/online/cli_view_spec.rb b/spec/online/cli_view_spec.rb index 40f1c1a..46f343e 100644 --- a/spec/online/cli_view_spec.rb +++ b/spec/online/cli_view_spec.rb @@ -32,33 +32,33 @@ describe "Command line interface" do = manifest =3D handler.library("baloo").latest_manifest = - (expect manifest.display_name).to eq library["display_name"] - (expect manifest.release_date).to eq library["release_date"] - (expect manifest.version).to eq library["version"] - (expect manifest.summary).to eq library["summary"] - (expect manifest.topics).to eq library["topics"] + expect(manifest.display_name).to eq library["display_name"] + expect(manifest.release_date).to eq library["release_date"] + expect(manifest.version).to eq library["version"] + expect(manifest.summary).to eq library["summary"] + expect(manifest.topics).to eq library["topics"] = - (expect manifest.urls.homepage).to eq library["urls"]["homepage"] - (expect manifest.urls.api_docs).to eq library["urls"]["api_docs"] - (expect manifest.urls.download).to eq library["urls"]["download"] - (expect manifest.urls.tutorial).to eq library["urls"]["tutorial"] - (expect manifest.urls.vcs).to eq library["urls"]["vcs"] - (expect manifest.urls.description_source).to eq library["urls"]["des= cription_source"] - (expect manifest.urls.announcement).to eq library["urls"]["announcem= ent"] - (expect manifest.urls.mailing_list).to eq library["urls"]["mailing_l= ist"] - (expect manifest.urls.contact).to eq library["urls"]["contact"] - (expect manifest.urls.custom).to eq library["urls"]["custom"] + expect(manifest.urls.homepage).to eq library["urls"]["homepage"] + expect(manifest.urls.api_docs).to eq library["urls"]["api_docs"] + expect(manifest.urls.download).to eq library["urls"]["download"] + expect(manifest.urls.tutorial).to eq library["urls"]["tutorial"] + expect(manifest.urls.vcs).to eq library["urls"]["vcs"] + expect(manifest.urls.description_source).to eq library["urls"]["desc= ription_source"] + expect(manifest.urls.announcement).to eq library["urls"]["announceme= nt"] + expect(manifest.urls.mailing_list).to eq library["urls"]["mailing_li= st"] + expect(manifest.urls.contact).to eq library["urls"]["contact"] + expect(manifest.urls.custom).to eq library["urls"]["custom"] = - (expect manifest.licenses).to eq library["licenses"] - (expect manifest.description).to eq library["description"] - (expect manifest.authors).to eq library["authors"] - (expect manifest.maturity).to eq library["maturity"] + expect(manifest.licenses).to eq library["licenses"] + expect(manifest.description).to eq library["description"] + expect(manifest.authors).to eq library["authors"] + expect(manifest.maturity).to eq library["maturity"] = - (expect manifest.packages.source).to eq library["packages"]["source"] - (expect manifest.packages.openSUSE).to eq library["packages"]["openS= USE"] - (expect manifest.packages.windows).to eq library["packages"]["window= s"] - (expect manifest.packages.ubuntu).to eq library["packages"]["ubuntu"] - (expect manifest.packages.osx).to eq library["packages"]["osx"] + expect(manifest.packages.source).to eq library["packages"]["source"] + expect(manifest.packages.openSUSE).to eq library["packages"]["openSU= SE"] + expect(manifest.packages.windows).to eq library["packages"]["windows= "] + expect(manifest.packages.ubuntu).to eq library["packages"]["ubuntu"] + expect(manifest.packages.osx).to eq library["packages"]["osx"] end end end