Class: Sevgi::Test::Suite
- Inherits:
-
Object
- Object
- Sevgi::Test::Suite
- Defined in:
- lib/sevgi/showcase/minitest/suite.rb
Constant Summary collapse
- NON_VALIDS =
["gotcha"].freeze
Instance Method Summary collapse
- #[](suite) ⇒ Object
-
#initialize(rootdir) ⇒ Suite
constructor
A new instance of Suite.
- #non_valids ⇒ Object
- #suites ⇒ Object
- #valids ⇒ Object (also: #to_a)
Constructor Details
#initialize(rootdir) ⇒ Suite
Returns a new instance of Suite.
6 7 8 |
# File 'lib/sevgi/showcase/minitest/suite.rb', line 6 def initialize(rootdir) @scripts = load(rootdir) end |
Instance Method Details
#[](suite) ⇒ Object
10 11 12 |
# File 'lib/sevgi/showcase/minitest/suite.rb', line 10 def [](suite) (@cache ||= {})[suite] ||= @scripts.select { |script| script.suite == suite.to_s } end |
#non_valids ⇒ Object
20 21 22 |
# File 'lib/sevgi/showcase/minitest/suite.rb', line 20 def non_valids NON_VALIDS.map { self[it] }.flatten end |
#suites ⇒ Object
14 15 16 |
# File 'lib/sevgi/showcase/minitest/suite.rb', line 14 def suites @suites ||= @scripts.map(&:suite).uniq end |
#valids ⇒ Object Also known as: to_a
24 25 26 |
# File 'lib/sevgi/showcase/minitest/suite.rb', line 24 def valids suites.reject { NON_VALIDS.include?(it) }.map { self[it] }.flatten end |