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



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

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)



53
54
55
56
57
58
# File 'lib/autospec/rspec_runner.rb', line 53

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

#reloadersObject



44
45
46
# File 'lib/autospec/rspec_runner.rb', line 44

def reloaders
  RELOADERS
end

#watchersObject



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

def watchers
  WATCHERS
end