Class: Skewer::Cuke
Overview
Runs the Cucumber features for a given directory.
Specifically, the tests related to infrastructure that skewer will map against to check if the node has been successfully built.
Defined Under Namespace
Classes: CukeError
Constant Summary
Constants included from Skewer
Instance Method Summary collapse
-
#initialize(dir = nil, host = nil) ⇒ Cuke
constructor
A new instance of Cuke.
- #run ⇒ Object
Methods included from Skewer
Constructor Details
#initialize(dir = nil, host = nil) ⇒ Cuke
Returns a new instance of Cuke.
11 12 13 14 15 |
# File 'lib/cuke.rb', line 11 def initialize(dir = nil, host = nil) raise "you must provide a valid directory for features to be executed within" unless File.directory?(dir) @dir = dir @host = host end |
Instance Method Details
#run ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/cuke.rb', line 17 def run Skewer.logger.debug("Running cucumber hook") `cd #{@dir}/.. && bundle install` if File.join(@dir, '..', 'Gemfile') result = `cucumber #{@dir} SKEWER_HOST=#{@host}` parsed = result.match(/failed/)[0] rescue false raise CukeError, "One of the cuke features failed!\n\n#{result}" if parsed result end |