Class: Evergreen::Suite

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ Suite

Returns a new instance of Suite.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/evergreen/suite.rb', line 5

def initialize(root)
  @root = root

  paths = [
    File.expand_path("config/evergreen.rb", root),
    File.expand_path(".evergreen", root),
    "#{ENV["HOME"]}/.evergreen"
  ]
  paths.each { |path| load(path) if File.exist?(path) }

  @runner = Runner.new(self)
  @server = Server.new(self)
  @application = Evergreen.application(self)
end

Instance Attribute Details

#applicationObject (readonly)

Returns the value of attribute application.



3
4
5
# File 'lib/evergreen/suite.rb', line 3

def application
  @application
end

#driverObject (readonly)

Returns the value of attribute driver.



3
4
5
# File 'lib/evergreen/suite.rb', line 3

def driver
  @driver
end

#rootObject (readonly)

Returns the value of attribute root.



3
4
5
# File 'lib/evergreen/suite.rb', line 3

def root
  @root
end

#runnerObject (readonly)

Returns the value of attribute runner.



3
4
5
# File 'lib/evergreen/suite.rb', line 3

def runner
  @runner
end

#serverObject (readonly)

Returns the value of attribute server.



3
4
5
# File 'lib/evergreen/suite.rb', line 3

def server
  @server
end

Instance Method Details

#get_spec(name) ⇒ Object



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

def get_spec(name)
  Spec.new(self, name)
end

#runObject



20
21
22
# File 'lib/evergreen/suite.rb', line 20

def run
  runner.run
end

#serveObject



24
25
26
# File 'lib/evergreen/suite.rb', line 24

def serve
  server.serve
end

#specsObject



32
33
34
35
36
# File 'lib/evergreen/suite.rb', line 32

def specs
  Dir.glob(File.join(root, Evergreen.spec_dir, '*_spec.{js,coffee}')).map do |path|
    Spec.new(self, File.basename(path))
  end
end

#templatesObject



38
39
40
41
42
# File 'lib/evergreen/suite.rb', line 38

def templates
  Dir.glob(File.join(root, Evergreen.template_dir, '*')).map do |path|
    Template.new(self, File.basename(path))
  end
end