Class: Adva::Tasks::Test::All

Inherits:
Thor::Group
  • Object
show all
Includes:
Cucumber
Defined in:
lib/adva/tasks/core.rb

Instance Method Summary collapse

Methods included from Cucumber

#cucumber_args, #cucumber_files, #cucumber_options, #cucumber_pattern

Instance Method Details

#allObject



80
81
82
83
84
85
86
87
88
89
90
# File 'lib/adva/tasks/core.rb', line 80

def all
  require 'cucumber'
  ENV['REGENERATE_APP'] = true if options['rebuild']
  Rails.env = 'test'
  passed = !::Cucumber::Cli::Main.execute(cucumber_args) # returns true on failure

  Dir['**/test/**/*_test.rb'].each { |file| require file }
  passed &= test_runner.run # returns true on pass

  exit(passed ? 0 : 1)
end