Class: Sevgi::Test::Suite Private
- Inherits:
-
Object
- Object
- Sevgi::Test::Suite
- Defined in:
- lib/sevgi/showcase/minitest/suite.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Showcase script suite collection.
Constant Summary collapse
- NON_VALIDS =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Suite names that are expected to be invalid examples.
["gotcha"].freeze
Instance Method Summary collapse
-
#[](suite) ⇒ Array<Sevgi::Test::Script>
private
Returns scripts belonging to a suite.
-
#initialize(rootdir) ⇒ void
constructor
private
Creates a suite from a showcase root directory.
-
#non_valids ⇒ Array<Sevgi::Test::Script>
private
Returns scripts expected to be invalid.
-
#suites ⇒ Array<String>
private
Returns all suite names.
-
#valids ⇒ Array<Sevgi::Test::Script>
(also: #to_a)
private
Returns scripts expected to render successfully.
Constructor Details
#initialize(rootdir) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Creates a suite from a showcase root directory.
13 14 15 |
# File 'lib/sevgi/showcase/minitest/suite.rb', line 13 def initialize(rootdir) @scripts = load(rootdir) end |
Instance Method Details
#[](suite) ⇒ Array<Sevgi::Test::Script>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns scripts belonging to a suite.
20 21 22 |
# File 'lib/sevgi/showcase/minitest/suite.rb', line 20 def [](suite) (@cache ||= {})[suite] ||= @scripts.select { |script| script.suite == suite.to_s } end |
#non_valids ⇒ Array<Sevgi::Test::Script>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns scripts expected to be invalid.
35 36 37 |
# File 'lib/sevgi/showcase/minitest/suite.rb', line 35 def non_valids NON_VALIDS.map { self[it] }.flatten end |
#suites ⇒ Array<String>
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns all suite names.
26 27 28 |
# File 'lib/sevgi/showcase/minitest/suite.rb', line 26 def suites @suites ||= @scripts.map(&:suite).uniq end |
#valids ⇒ Array<Sevgi::Test::Script> Also known as: to_a
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns scripts expected to render successfully.
41 42 43 |
# File 'lib/sevgi/showcase/minitest/suite.rb', line 41 def valids suites.reject { NON_VALIDS.include?(it) }.map { self[it] }.flatten end |