Class: Autospec::RspecRunner

Inherits:
BaseRunner show all
Defined in:
lib/autospec/rspec_runner.rb

Direct Known Subclasses

SimpleRunner

Constant Summary collapse

WATCHERS =
{}
RELOADERS =
Set.new

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseRunner

#abort, #reload, #run, #running?, #start, #stop

Class Method Details

.reload(pattern) ⇒ Object



42
43
44
# File 'lib/autospec/rspec_runner.rb', line 42

def self.reload(pattern)
  RELOADERS << pattern
end

.watch(pattern, &blk) ⇒ Object



6
7
8
# File 'lib/autospec/rspec_runner.rb', line 6

def self.watch(pattern, &blk)
  WATCHERS[pattern] = blk
end

Instance Method Details

#failed_specsObject

reload(%rAutospec::RspecRunner.app/helpers/app/helpers/.+app/helpers/.+.rb)



55
56
57
58
59
60
# File 'lib/autospec/rspec_runner.rb', line 55

def failed_specs
  specs = []
  path = "./tmp/rspec_result"
  specs = File.readlines(path) if File.exist?(path)
  specs
end

#reloadersObject



46
47
48
# File 'lib/autospec/rspec_runner.rb', line 46

def reloaders
  RELOADERS
end

#watchersObject



10
11
12
# File 'lib/autospec/rspec_runner.rb', line 10

def watchers
  WATCHERS
end