Class: Providence::CucumberWatchr

Inherits:
BaseWatchr show all
Defined in:
lib/providence/cucumber_watchr.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseWatchr

alert_message, fail_message, pass_message, pending_message, run, run_command

Class Method Details

.commandObject



28
29
30
# 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) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# 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_allObject



24
25
26
# File 'lib/providence/cucumber_watchr.rb', line 24

def run_all
  run 'features'
end

Instance Method Details

#watch(ec) ⇒ Object

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



4
5
6
7
# 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