Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Acceptance tests and tweaks for Strategies

  • Loading branch information...
commit c2a3d947c8eecb7edb780c60fd49535fd852ae5c 1 parent 4ab61ad
@neo-technology-release-persona neo-technology-release-persona authored
View
33 features/strategies.feature
@@ -0,0 +1,33 @@
+Feature: puppet install strategies
+ In order to install Puppet in a way that suits me
+ As a someone who wants to deploy something to the machine
+ I want to choose a strategy to do so
+
+ @announce-stdout
+ @announce-stderr
+ Scenario: Defaults strategy of Bundler
+ Given I have puppet code in "/tmp/more_skewer_test_code"
+ And a file named ".skewer.json" with:
+ """
+ {"puppet_repo":"/tmp/skewer_test_code"}
+ """
+ When I run `./bin/skewer provision --cloud=stub --role=foobar --image=ami-deadbeef`
+ Then the stdout should contain "Deploying Puppet via Bundler"
+
+ Scenario: Explicit invocation of Bundler
+ Given I have puppet code in "/tmp/more_skewer_test_code"
+ And a file named ".skewer.json" with:
+ """
+ {"puppet_repo":"/tmp/skewer_test_code"}
+ """
+ When I run `./bin/skewer --strategy=bundler provision --cloud=stub --role=foobar --image=ami-deadbeef`
+ Then the stdout should contain "Deploying Puppet via Bundler"
+
+ Scenario: Explicit invocation of Debian
+ Given I have puppet code in "/tmp/more_skewer_test_code"
+ And a file named ".skewer.json" with:
+ """
+ {"puppet_repo":"/tmp/skewer_test_code"}
+ """
+ When I run `./bin/skewer --strategy=debian provision --cloud=stub --role=foobar --image=ami-deadbeef`
+ Then the stdout should contain "Deploying Puppet via Debian"
View
4 lib/skewer/dispatcher.rb
@@ -19,9 +19,9 @@ def initialize(options)
def select_strategy(option)
require 'skewer/strategy/bundler'
require 'skewer/strategy/debian_package'
- if option == :bundler
+ if option.to_sym == :bundler
Skewer::Strategy::Bundler.new(@node)
- elsif option == :debian
+ elsif option.to_sym == :debian
Skewer::Strategy::DebianPackage.new(@node)
else
raise "I don't know about that strategy - sorry"
View
3  lib/skewer/puppet.rb
@@ -9,6 +9,7 @@ class Puppet
def initialize(installer)
@installer = installer
end
+
def arguments
[
"--modulepath modules",
@@ -51,4 +52,4 @@ def self.run(node, installer, options)
this.run(node, options)
end
end
-end
+end
View
1  lib/skewer/strategy/bundler.rb
@@ -6,6 +6,7 @@ class Bundler
def initialize(node)
@node = node
@asset_dir = File.join(File.dirname(__FILE__), '..','..', '..', 'assets')
+ logger.debug "Deploying Puppet via Bundler"
end
def install
View
2  lib/skewer/strategy/debian_package.rb
@@ -1,8 +1,10 @@
module Skewer
module Strategy
class DebianPackage
+ include Skewer
def initialize(node)
@node = node
+ logger.debug "Deploying Puppet via Debian"
end
def install_command
Please sign in to comment.
Something went wrong with that request. Please try again.