Class: RailsEdgeTest::Configuration
- Inherits:
-
Object
- Object
- RailsEdgeTest::Configuration
- Defined in:
- lib/rails_edge_test/configuration.rb
Instance Attribute Summary collapse
-
#edge_root_path ⇒ Object
Returns the value of attribute edge_root_path.
-
#elm_path ⇒ Object
Returns the value of attribute elm_path.
-
#printer ⇒ Object
Returns the value of attribute printer.
Instance Method Summary collapse
-
#after_each(&block) ⇒ Object
Provide a block to be executed after running each
edgeblock. -
#before_each(&block) ⇒ Object
Provide a block to be executed before running each
edgeblock. -
#before_suite(&block) ⇒ Object
Provide a block to be executed once before running any
edgeblocks. -
#include(mod) ⇒ Object
Provide any Module here with methods you would like to be able to access from within an
edgeblock. -
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #wrap_edge_execution(&edge) ⇒ Object
- #wrap_suite_execution(&block) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 10 11 12 13 14 |
# File 'lib/rails_edge_test/configuration.rb', line 7 def initialize self.elm_path = Rails.root.join('spec') self.edge_root_path = Rails.root.join('spec', 'edge') self.printer = Printers::Boring @before_suite_blocks = [] @before_each_blocks = [] @after_each_blocks = [] end |
Instance Attribute Details
#edge_root_path ⇒ Object
Returns the value of attribute edge_root_path.
5 6 7 |
# File 'lib/rails_edge_test/configuration.rb', line 5 def edge_root_path @edge_root_path end |
#elm_path ⇒ Object
Returns the value of attribute elm_path.
5 6 7 |
# File 'lib/rails_edge_test/configuration.rb', line 5 def elm_path @elm_path end |
#printer ⇒ Object
Returns the value of attribute printer.
5 6 7 |
# File 'lib/rails_edge_test/configuration.rb', line 5 def printer @printer end |
Instance Method Details
#after_each(&block) ⇒ Object
Provide a block to be executed after running each edge block
35 36 37 |
# File 'lib/rails_edge_test/configuration.rb', line 35 def after_each(&block) @after_each_blocks << block end |
#before_each(&block) ⇒ Object
Provide a block to be executed before running each edge block
30 31 32 |
# File 'lib/rails_edge_test/configuration.rb', line 30 def before_each(&block) @before_each_blocks << block end |
#before_suite(&block) ⇒ Object
Provide a block to be executed once before running any edge blocks
25 26 27 |
# File 'lib/rails_edge_test/configuration.rb', line 25 def before_suite(&block) @before_suite_blocks << block end |
#include(mod) ⇒ Object
Provide any Module here with methods you would like to be able to access from within an edge block.
19 20 21 22 |
# File 'lib/rails_edge_test/configuration.rb', line 19 def include(mod) Dsl::Controller.include(mod) Dsl::Edge.include(mod) end |
#wrap_edge_execution(&edge) ⇒ Object
45 46 47 48 49 50 51 |
# File 'lib/rails_edge_test/configuration.rb', line 45 def wrap_edge_execution(&edge) @before_each_blocks.each(&:call) edge.call @after_each_blocks.each(&:call) end |
#wrap_suite_execution(&block) ⇒ Object
39 40 41 42 43 |
# File 'lib/rails_edge_test/configuration.rb', line 39 def wrap_suite_execution(&block) @before_suite_blocks.each(&:call) block.call end |