class RailsEdgeTest::Configuration
Attributes
edge_root_path[RW]
elm_path[RW]
printer[RW]
Public Class Methods
new()
click to toggle source
# File lib/rails_edge_test/configuration.rb, line 5 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
Public Instance Methods
after_each(&block)
click to toggle source
Provide a block to be executed after running each `edge` block
# File lib/rails_edge_test/configuration.rb, line 33 def after_each(&block) @after_each_blocks << block end
before_each(&block)
click to toggle source
Provide a block to be executed before running each `edge` block
# File lib/rails_edge_test/configuration.rb, line 28 def before_each(&block) @before_each_blocks << block end
before_suite(&block)
click to toggle source
Provide a block to be executed once before running any `edge` blocks
# File lib/rails_edge_test/configuration.rb, line 23 def before_suite(&block) @before_suite_blocks << block end
include(mod)
click to toggle source
Provide any Module here with methods you would like to be able to access from within an `edge` block. @param [Module] mod - a module to be included into all `edge` blocks
# File lib/rails_edge_test/configuration.rb, line 17 def include(mod) Dsl::Controller.include(mod) Dsl::Edge.include(mod) end
wrap_edge_execution(&edge)
click to toggle source
# File lib/rails_edge_test/configuration.rb, line 45 def wrap_edge_execution(&edge) @before_each_blocks.each do |before_each_block| before_each_block.call end edge.call @after_each_blocks.each do |after_each_block| after_each_block.call end end
wrap_suite_execution(&block)
click to toggle source
# File lib/rails_edge_test/configuration.rb, line 37 def wrap_suite_execution(&block) @before_suite_blocks.each do |before_suit_block| before_suit_block.call end block.call end