Sha256: bbd99cf4f3cc98f9c8be797a3b371fe5a3f1111fc4fe3bc2171414a3c7941d0c

Contents?: true

Size: 741 Bytes

Versions: 1

Compression:

Stored size: 741 Bytes

Contents

#!/usr/bin/env ruby

unless ARGV[0]
  puts "Usage: #{__FILE__} <feature>"
  exit 99
end

__DIR__ = File.expand_path(File.dirname(__FILE__))

feature = ARGV[0]
unless File.exists?(feature)
  feature = File.join(__DIR__, '..', 'features', ARGV[0]) 
end

unless File.exist?(feature)
  puts "Error: feature file doesn't exist!"
  exit 98
end

command_parts = []
command_parts << "#{__DIR__}/cucumber"
command_parts << "--require features/"

if ARGV.grep(/^\-\-pretty$/).size > 0
  command_parts << "--format pretty"
else
  command_parts << "--format Cucumber::Formatter::Nagios"
end

command_parts << feature
command = command_parts.join(' ')

if ARGV.grep(/^\-\-debug$/).size > 0
  puts command
  puts
end

system(command) ? exit(0) : exit(2)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cucumber-nagios-0.6.4 lib/generators/project/bin/cucumber-nagios