Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing path option #20

Merged
merged 2 commits into from
Aug 6, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
*.gem
Gemfile.lock
tmp/
31 changes: 31 additions & 0 deletions features/install.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Feature: cli/install
In order to be worth anything
Puppet librarian needs to install modules properly

Scenario: Installing a module and its dependencies
Given a file named "Puppetfile" with:
"""
forge "http://forge.puppetlabs.com"
mod 'puppetlabs/apt'
"""
When I run `librarian-puppet install`
Then the exit status should be 0
And the file "modules/apt/Modulefile" should match /name *'puppetlabs-apt'/
And the file "modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/

Scenario: Changing the path
Given a directory named "puppet"
And a file named "Puppetfile" with:
"""
forge "http://forge.puppetlabs.com"
mod 'puppetlabs/apt'
"""
When I run `librarian-puppet install --path puppet/modules`
And I run `librarian-puppet config`
Then the exit status should be 0
And the output from "librarian-puppet config" should contain "path: puppet/modules"
And the file "puppet/modules/apt/Modulefile" should match /name *'puppetlabs-apt'/
And the file "puppet/modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/

2 changes: 1 addition & 1 deletion features/support/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
slow_boot ||= RUBY_PLATFORM == "java"
slow_boot ||= defined?(::Rubinius)

@aruba_timeout_seconds = slow_boot ? 5 : 2
@aruba_timeout_seconds = slow_boot ? 10 : 2
end
3 changes: 2 additions & 1 deletion lib/librarian/puppet/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def adapter_name
end

def install_path
project_path.join("modules")
part = config_db["path"] || "modules"
project_path.join(part)
end

def cache_path
Expand Down