spec/unit/manifest_handler_spec.rb in inqlude-0.10.0 vs spec/unit/manifest_handler_spec.rb in inqlude-0.11.0
- old
+ new
@@ -1,11 +1,10 @@
require File.expand_path('../spec_helper', __FILE__)
include GivenFilesystemSpecHelpers
describe ManifestHandler do
-
let(:settings) do
s = Settings.new
s.manifest_path = File.expand_path('spec/data/manifests')
s.offline = true
s
@@ -53,11 +52,10 @@
File.expand_path( "~/.local/share/inqlude/manifests/mylib/mylib.2014-02-01.manifest" ) )
end
end
describe "#libraries" do
-
it "returns all libraries" do
expect( mh.libraries.count ).to eq 5
end
it "returns stable libraries" do
@@ -90,11 +88,10 @@
it "returns latest libraries" do
libraries = mh.latest_libraries
expect(libraries.first.manifests.last.name).to eq "proprietarylib"
expect(libraries).not_to include "newlib"
end
-
end
describe "#group" do
it "returns all libraries of a group" do
libraries = mh.group("kde-frameworks")
@@ -107,18 +104,36 @@
it "returns all libraries of a topic" do
libraries = mh.topic("API")
expect( libraries.count ).to eq 2
expect( libraries.first.manifests.last.name ).to eq "awesomelib"
end
+
+ it "returns same results when called again" do
+ libraries = mh.topic("API")
+ expect( libraries.count ).to eq 2
+ expect( libraries.first.manifests.last.name ).to eq "awesomelib"
+
+ libraries2 = mh.topic("API")
+ expect(libraries2).to eq(libraries)
+ end
end
- describe "#library" do
+ describe "#no_of_libraries" do
+ it "returns number of libraries with given topic" do
+ expect(mh.no_of_libraries("API")).to eq(2)
+ end
+ it "returns same result when called again" do
+ no = mh.no_of_libraries("API")
+ expect(mh.no_of_libraries("API")).to eq(no)
+ end
+ end
+
+ describe "#library" do
it "returns one library" do
library = mh.library "awesomelib"
expect( library.name ).to eq "awesomelib"
end
-
end
context "library with generic and release manifest" do
use_given_filesystem