Commit 1f3903e6 authored by Carlos Sanchez's avatar Carlos Sanchez

Add tests for new exclusion syntax in librarian

parent e2abaf19
......@@ -72,6 +72,8 @@ as if the Puppetfile contained
mod 'acme-mymodule', :path => './some_folder'
exclusion 'acme-bad_module'
### Recursive module dependency resolution
......@@ -148,6 +150,10 @@ to be downloaded from GitHub tarball.
Our puppet infrastructure repository depends on the `acme-mymodule` module,
which is already in the filesystem.
exclusion 'acme-bad_module'
Exclude the module `acme-bad_module` from resolution and installation.
## How to Use
Install librarian-puppet:
......
forge 'http://forge.puppetlabs.com'
metadata
{
"name": "librarian-duplicated_dependencies",
"version": "0.0.1",
"license": "Apache 2.0",
"dependencies": [
{
"name": "ripienaar-concat",
"version_requirement": ">= 0"
},
{
"name": "puppetlabs-concat",
"version_requirement": "1.2.0"
}
]
}
forge 'http://forge.puppetlabs.com'
metadata
mod 'librarian-duplicated_dependencies', :git => 'https://github.com/rodjek/librarian-puppet.git', :path => 'features/examples/duplicated_dependencies'
{
"name": "librarian-duplicated_dependencies_transitive",
"version": "0.0.1",
"license": "Apache 2.0",
"dependencies": []
}
......@@ -30,6 +30,30 @@ Feature: cli/install
And the output should not contain "Executing puppet module install for puppetlabs/stdlib"
And the output should not contain "Executing puppet module install for puppetlabs-stdlib"
Scenario: Installing two modules with same name and using exclusions
Given a file named "Puppetfile" with:
"""
forge "https://forgeapi.puppetlabs.com"
mod 'librarian-duplicated_dependencies', :path => '../../features/examples/duplicated_dependencies'
exclusion 'ripienaar-concat'
"""
When I run `librarian-puppet install --verbose`
Then the exit status should be 0
And the file "modules/concat/metadata.json" should match /"name": "puppetlabs-concat"/
And the output should contain "Excluding dependency ripienaar-concat from"
Scenario: Installing two modules with same name and using exclusions, apply transitively
Given a file named "Puppetfile" with:
"""
forge "https://forgeapi.puppetlabs.com"
mod 'librarian-duplicated_dependencies_transitive', :path => '../../features/examples/duplicated_dependencies_transitive'
"""
When PENDING I run `librarian-puppet install --verbose`
Then the exit status should be 0
And the file "modules/concat/metadata.json" should match /"name": "puppetlabs-concat"/
Scenario: Install a module with Modulefile without version
Given a file named "Puppetfile" with:
"""
......
......@@ -26,7 +26,7 @@ Gem::Specification.new do |s|
s.executables = ['librarian-puppet']
s.add_dependency "librarianp", ">=0.4.0"
s.add_dependency "librarianp", ">=0.5.0"
s.add_dependency "rsync"
s.add_dependency "puppet_forge"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment