Class: Evergreen::Spec

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(suite, name) ⇒ Spec

Returns a new instance of Spec.



7
8
9
10
# File 'lib/evergreen/spec.rb', line 7

def initialize(suite, name)
  @suite = suite
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/evergreen/spec.rb', line 5

def name
  @name
end

#suiteObject (readonly)

Returns the value of attribute suite.



5
6
7
# File 'lib/evergreen/spec.rb', line 5

def suite
  @suite
end

Instance Method Details

#exist?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/evergreen/spec.rb', line 42

def exist?
  File.exist?(full_path)
end

#failure_messagesObject



38
39
40
# File 'lib/evergreen/spec.rb', line 38

def failure_messages
  runner.failure_messages
end

#full_pathObject



16
17
18
# File 'lib/evergreen/spec.rb', line 16

def full_path
  File.join(root, Evergreen.spec_dir, name)
end

#passed?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/evergreen/spec.rb', line 34

def passed?
  runner.passed?
end

#readObject Also known as: contents



20
21
22
23
24
25
26
27
# File 'lib/evergreen/spec.rb', line 20

def read
  if full_path =~ /\.coffee$/
    require 'coffee-script'
    CoffeeScript.compile(File.read(full_path))
  else
    File.read(full_path)
  end
end

#rootObject



12
13
14
# File 'lib/evergreen/spec.rb', line 12

def root
  suite.root
end

#urlObject



30
31
32
# File 'lib/evergreen/spec.rb', line 30

def url
  "#{suite.mounted_at}/run/#{name}"
end