Class: AutoTest

Inherits:
Object
  • Object
show all
Defined in:
lib/autotest.rb

Instance Method Summary collapse

Constructor Details

#initialize(paths) ⇒ AutoTest

Returns a new instance of AutoTest.



4
5
6
7
# File 'lib/autotest.rb', line 4

def initialize(paths)
    @paths = paths
    run
end

Instance Method Details

#addWatches(pathList) ⇒ Object



22
23
24
25
26
# File 'lib/autotest.rb', line 22

def addWatches(pathList)
    Watch.new(pathList) {
        runTests
    }
end

#get_pathArray_from_file(fileName) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/autotest.rb', line 9

def get_pathArray_from_file(fileName)
    @paths = []
    File.open(fileName, "r") do |file|
        file.each do |line|
            @paths.push line
        end
    end
end

#makePathsObject



32
33
34
35
36
37
38
# File 'lib/autotest.rb', line 32

def makePaths()
    pathList = "./{"
    @paths.each do |folder|
        pathList += folder + ","
    end
    pathList += "}/*"
end

#runObject



18
19
20
# File 'lib/autotest.rb', line 18

def run
    addWatches makePaths
end

#runTestsObject



28
29
30
# File 'lib/autotest.rb', line 28

def runTests
    system "rake test:all"
end