Class: Defekt::Collection
Instance Method Summary collapse
- #all ⇒ Object
- #broken ⇒ Object
- #errored ⇒ Object
- #failed ⇒ Object
-
#initialize(klass) ⇒ Collection
constructor
A new instance of Collection.
- #passed ⇒ Object
Constructor Details
#initialize(klass) ⇒ Collection
Returns a new instance of Collection.
3 4 5 |
# File 'lib/defekt/collection.rb', line 3 def initialize(klass) @klass = klass end |
Instance Method Details
#all ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/defekt/collection.rb', line 7 def all @all ||= @klass.descendants.flat_map do |klass| klass.instance_methods.grep(/^test_/).map do |methot| Test.new(klass.instance_method(methot)) end end end |
#broken ⇒ Object
27 28 29 |
# File 'lib/defekt/collection.rb', line 27 def broken @broken ||= all.select(&:broken?) end |
#errored ⇒ Object
23 24 25 |
# File 'lib/defekt/collection.rb', line 23 def errored @errored ||= all.select(&:errored?) end |
#failed ⇒ Object
19 20 21 |
# File 'lib/defekt/collection.rb', line 19 def failed @failed ||= all.select(&:failed?) end |
#passed ⇒ Object
15 16 17 |
# File 'lib/defekt/collection.rb', line 15 def passed @passed ||= all.select(&:passed?) end |