Class: Mutiny::Tests::TestSet
- Inherits:
-
Object
- Object
- Mutiny::Tests::TestSet
show all
- Extended by:
- Forwardable
- Defined in:
- lib/mutiny/tests/test_set.rb,
lib/mutiny/tests/test_set/filter.rb,
lib/mutiny/tests/test_set/filterable.rb,
lib/mutiny/tests/test_set/filter/default.rb
Defined Under Namespace
Modules: Filterable
Classes: Filter
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(tests) ⇒ TestSet
Returns a new instance of TestSet.
15
16
17
|
# File 'lib/mutiny/tests/test_set.rb', line 15
def initialize(tests)
@tests = tests
end
|
Class Method Details
.empty ⇒ Object
11
12
13
|
# File 'lib/mutiny/tests/test_set.rb', line 11
def self.empty
new([])
end
|
Instance Method Details
#eql?(other) ⇒ Boolean
Also known as:
==
31
32
33
|
# File 'lib/mutiny/tests/test_set.rb', line 31
def eql?(other)
is_a?(other.class) && other.tests == tests
end
|
#filterable(subjects, filtering_strategy: Filter::Default) ⇒ Object
35
36
37
38
39
|
# File 'lib/mutiny/tests/test_set.rb', line 35
def filterable(subjects, filtering_strategy: Filter::Default)
extend(Filterable)
self.filter = filtering_strategy.new(subject_names: subjects.names)
self
end
|
#locations ⇒ Object
19
20
21
|
# File 'lib/mutiny/tests/test_set.rb', line 19
def locations
tests.map(&:location)
end
|
#subset(&block) ⇒ Object
23
24
25
|
# File 'lib/mutiny/tests/test_set.rb', line 23
def subset(&block)
derive(tests.select(&block))
end
|
#take(n) ⇒ Object
27
28
29
|
# File 'lib/mutiny/tests/test_set.rb', line 27
def take(n)
derive(tests.take(n))
end
|