Class: Siesta::TestSuite
- Inherits:
-
Object
- Object
- Siesta::TestSuite
- Defined in:
- lib/siesta/test_suite.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #groups ⇒ Object
- #has_tests?(path) ⇒ Boolean
-
#initialize(path) ⇒ TestSuite
constructor
A new instance of TestSuite.
Constructor Details
#initialize(path) ⇒ TestSuite
Returns a new instance of TestSuite.
38 39 40 |
# File 'lib/siesta/test_suite.rb', line 38 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
36 37 38 |
# File 'lib/siesta/test_suite.rb', line 36 def path @path end |
Instance Method Details
#groups ⇒ Object
42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/siesta/test_suite.rb', line 42 def groups return @groups if @groups @groups = Dir.glob(File.join(path, '**', '*')).inject([]) do |c, f| c << Group.new(:path => f, :suite => self) if has_tests?(f) c end @groups << Group.new(:path => path, :suite => self) if has_tests?(path) @groups end |
#has_tests?(path) ⇒ Boolean
55 56 57 |
# File 'lib/siesta/test_suite.rb', line 55 def has_tests?(path) File.directory?(path) && !Dir[File.join(path, '*.t.js')].empty? end |