class Providence::CucumberWatchr

Public Class Methods

command() click to toggle source
# File lib/providence/cucumber_watchr.rb, line 28
def command
  "cucumber --color --drb --require features/step_definitions --require features/support"
end
parse_test_status(status) click to toggle source
# File lib/providence/cucumber_watchr.rb, line 10
def parse_test_status(status)
  status = status.join('').gsub(/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]/, '')
  
  if status.match(/failed/)
    :fail
  elsif status.match(/passed/)
    :pass
  elsif status.match(/undefined/)
    :pending
  else
    :alert
  end        
end
run_all() click to toggle source
# File lib/providence/cucumber_watchr.rb, line 24
def run_all
  run 'features'
end

Public Instance Methods

watch(ec) click to toggle source

order matters here, top is last to match, bottom is first

# File lib/providence/cucumber_watchr.rb, line 4
def watch(ec)
  ec.watch('features/support/.*')  { |m| Providence::CucumberWatchr.run_all }
  ec.watch('features/.*\.feature') { |m| Providence::CucumberWatchr.run m[0] }
end