[DRE-commits] [librarian-puppet] 65/153: Test Forge.manifests

Stig Sandbeck Mathisen ssm at debian.org
Wed Jun 1 20:30:43 UTC 2016


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository librarian-puppet.

commit a679fa76f11f14c3752471262c529b21b93a40f3
Author: Carlos Sanchez <csanchez at maestrodev.com>
Date:   Fri Oct 10 12:20:05 2014 +0200

    Test Forge.manifests
---
 spec/source/forge_spec.rb | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/spec/source/forge_spec.rb b/spec/source/forge_spec.rb
index 991f829..cbb9630 100644
--- a/spec/source/forge_spec.rb
+++ b/spec/source/forge_spec.rb
@@ -1,5 +1,6 @@
 require "librarian/puppet/source/forge"
 require "librarian/puppet/environment"
+require 'librarian/puppet/extension'
 
 include Librarian::Puppet::Source
 
@@ -7,14 +8,24 @@ describe Forge do
 
   let(:environment) { Librarian::Puppet::Environment.new }
   let(:uri) { "https://forge.puppetlabs.com" }
+  let(:puppet_version) { "3.6.0" }
   subject { Forge.new(environment, uri) }
 
-  before do
-    Librarian::Puppet.should_receive(:puppet_version).at_least(1).and_return(puppet_version)
-    Librarian::Puppet.should_receive(:puppet_gem_version).at_least(1).and_return(Gem::Version.create(puppet_version.split(' ').first.strip.gsub('-', '.')))
+  describe "#manifests" do
+    let(:manifests) { [] }
+    before do
+      expect_any_instance_of(Librarian::Puppet::Source::Forge::RepoV3).to receive(:get_versions).at_least(:once) { manifests }
+    end
+    it "should return the manifests" do
+      expect(subject.manifests("x")).to eq(manifests)
+    end
   end
 
   describe "#check_puppet_module_options" do
+    before do
+      expect(Librarian::Puppet).to receive(:puppet_version).at_least(:once) { puppet_version }
+      expect(Librarian::Puppet).to receive(:puppet_gem_version).at_least(:once) { Gem::Version.create(puppet_version.split(' ').first.strip.gsub('-', '.')) }
+    end
     context "Puppet OS" do
       context "3.4.3" do
         let(:puppet_version) { "3.4.3" }
@@ -25,7 +36,6 @@ describe Forge do
         it { Forge.client_api_version().should == 1 }
       end
       context "3.6.0" do
-        let(:puppet_version) { "3.6.0" }
         it { Forge.client_api_version().should == 3 }
       end
     end

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/librarian-puppet.git



More information about the Pkg-ruby-extras-commits mailing list