Skip to content
Browse files

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...
1 parent c2faaf7 commit 23c3f2786ebf1e53161f676dc59770df4780d870 @phinze phinze committed Aug 4, 2012
Showing with 34 additions and 2 deletions.
  1. +31 −0 features/install.feature
  2. +1 −1 features/support/env.rb
  3. +2 −1 lib/librarian/puppet/environment.rb
View
31 features/install.feature
@@ -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'/
+
View
2 features/support/env.rb
@@ -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
View
3 lib/librarian/puppet/environment.rb
@@ -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

0 comments on commit 23c3f27

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