Skip to content
This repository
Browse code

fix --path handling and add tests around it

- also adds a basic smoke test around `librarian-puppet install`
- ups the aruba "slow" timeout since install can take longer
  • Loading branch information...
commit 23c3f2786ebf1e53161f676dc59770df4780d870 1 parent c2faaf7
Paul Hinze phinze authored
31 features/install.feature
... ... @@ -0,0 +1,31 @@
  1 +Feature: cli/install
  2 + In order to be worth anything
  3 + Puppet librarian needs to install modules properly
  4 +
  5 + Scenario: Installing a module and its dependencies
  6 + Given a file named "Puppetfile" with:
  7 + """
  8 + forge "http://forge.puppetlabs.com"
  9 +
  10 + mod 'puppetlabs/apt'
  11 + """
  12 + When I run `librarian-puppet install`
  13 + Then the exit status should be 0
  14 + And the file "modules/apt/Modulefile" should match /name *'puppetlabs-apt'/
  15 + And the file "modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/
  16 +
  17 + Scenario: Changing the path
  18 + Given a directory named "puppet"
  19 + And a file named "Puppetfile" with:
  20 + """
  21 + forge "http://forge.puppetlabs.com"
  22 +
  23 + mod 'puppetlabs/apt'
  24 + """
  25 + When I run `librarian-puppet install --path puppet/modules`
  26 + And I run `librarian-puppet config`
  27 + Then the exit status should be 0
  28 + And the output from "librarian-puppet config" should contain "path: puppet/modules"
  29 + And the file "puppet/modules/apt/Modulefile" should match /name *'puppetlabs-apt'/
  30 + And the file "puppet/modules/stdlib/Modulefile" should match /name *'puppetlabs-stdlib'/
  31 +
2  features/support/env.rb
@@ -5,5 +5,5 @@
5 5 slow_boot ||= RUBY_PLATFORM == "java"
6 6 slow_boot ||= defined?(::Rubinius)
7 7
8   - @aruba_timeout_seconds = slow_boot ? 5 : 2
  8 + @aruba_timeout_seconds = slow_boot ? 10 : 2
9 9 end
3  lib/librarian/puppet/environment.rb
@@ -12,7 +12,8 @@ def adapter_name
12 12 end
13 13
14 14 def install_path
15   - project_path.join("modules")
  15 + part = config_db["path"] || "modules"
  16 + project_path.join(part)
16 17 end
17 18
18 19 def cache_path

0 comments on commit 23c3f27

Please sign in to comment.
Something went wrong with that request. Please try again.