Class: Matest::Runner
- Inherits:
-
Object
- Object
- Matest::Runner
- Defined in:
- lib/matest.rb
Instance Attribute Summary collapse
-
#example_groups ⇒ Object
readonly
Returns the value of attribute example_groups.
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#printer ⇒ Object
readonly
Returns the value of attribute printer.
Class Method Summary collapse
Instance Method Summary collapse
- #<<(example_group) ⇒ Object
- #execute! ⇒ Object
-
#initialize(printer: SpecPrinter.new) ⇒ Runner
constructor
A new instance of Runner.
- #load_file(file) ⇒ Object
Constructor Details
#initialize(printer: SpecPrinter.new) ⇒ Runner
Returns a new instance of Runner.
12 13 14 15 16 |
# File 'lib/matest.rb', line 12 def initialize(printer: SpecPrinter.new) @example_groups = [] @info = {} @printer = printer end |
Instance Attribute Details
#example_groups ⇒ Object (readonly)
Returns the value of attribute example_groups.
8 9 10 |
# File 'lib/matest.rb', line 8 def example_groups @example_groups end |
#info ⇒ Object (readonly)
Returns the value of attribute info.
9 10 11 |
# File 'lib/matest.rb', line 9 def info @info end |
#printer ⇒ Object (readonly)
Returns the value of attribute printer.
10 11 12 |
# File 'lib/matest.rb', line 10 def printer @printer end |
Class Method Details
.runner ⇒ Object
18 19 20 |
# File 'lib/matest.rb', line 18 def self.runner @runner ||= new end |
Instance Method Details
#<<(example_group) ⇒ Object
22 23 24 |
# File 'lib/matest.rb', line 22 def <<(example_group) example_groups << example_group end |
#execute! ⇒ Object
30 31 32 33 34 35 |
# File 'lib/matest.rb', line 30 def execute! example_groups.each do |current_group| current_group.execute! end printer.print(self) end |
#load_file(file) ⇒ Object
26 27 28 |
# File 'lib/matest.rb', line 26 def load_file(file) load(file) end |