class Lopata::Runner

@private

Public Class Methods

exit_on_failure?() click to toggle source
# File lib/lopata/runner.rb, line 32
def self.exit_on_failure?
  true
end

Public Instance Methods

add_rerun_filter() click to toggle source
# File lib/lopata/runner.rb, line 52
def add_rerun_filter
  to_rerun = Lopata::Client.new.to_rerun
  Lopata.configuration.filters << -> (scenario) { to_rerun.include?(scenario.title) }
end
add_text_filter(text) click to toggle source
# File lib/lopata/runner.rb, line 48
def add_text_filter(text)
  Lopata.configuration.filters << -> (scenario) { scenario.title.include?(text) }
end
configure_from_options() click to toggle source
# File lib/lopata/runner.rb, line 37
def configure_from_options
  Lopata.configure do |c|
    c.env = options[:env].to_sym
    c.keep = options[:keep]
    c.load_environment
    c.run_before_start_hooks
  end
  add_text_filter(options[:text]) if options[:text]
  add_rerun_filter if options[:rerun]
end
test(*args) click to toggle source
# File lib/lopata/runner.rb, line 17
def test(*args)
  trap_interrupt
  configure_from_options
  Lopata::Loader.load_shared_steps
  Lopata::Loader.load_scenarios(*args)
  world = Lopata.world
  world.notify_observers(:started, world)
  world.scenarios.each { |s| s.run }
  world.notify_observers(:finished, world)
end
trap_interrupt() click to toggle source
# File lib/lopata/runner.rb, line 57
def trap_interrupt
  trap('INT') { exit!(1) }
end