Class: Evergreen::Spec
- Inherits:
-
Object
- Object
- Evergreen::Spec
- Defined in:
- lib/evergreen/spec.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#suite ⇒ Object
readonly
Returns the value of attribute suite.
Instance Method Summary collapse
- #exist? ⇒ Boolean
- #failure_messages ⇒ Object
- #full_path ⇒ Object
-
#initialize(suite, name) ⇒ Spec
constructor
A new instance of Spec.
- #passed? ⇒ Boolean
- #read ⇒ Object (also: #contents)
- #root ⇒ Object
- #url ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/evergreen/spec.rb', line 5 def name @name end |
#suite ⇒ Object (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
42 43 44 |
# File 'lib/evergreen/spec.rb', line 42 def exist? File.exist?(full_path) end |
#failure_messages ⇒ Object
38 39 40 |
# File 'lib/evergreen/spec.rb', line 38 def runner. end |
#full_path ⇒ Object
16 17 18 |
# File 'lib/evergreen/spec.rb', line 16 def full_path File.join(root, Evergreen.spec_dir, name) end |
#passed? ⇒ Boolean
34 35 36 |
# File 'lib/evergreen/spec.rb', line 34 def passed? runner.passed? end |
#read ⇒ Object 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 |
#root ⇒ Object
12 13 14 |
# File 'lib/evergreen/spec.rb', line 12 def root suite.root end |
#url ⇒ Object
30 31 32 |
# File 'lib/evergreen/spec.rb', line 30 def url "#{suite.mounted_at}/run/#{name}" end |