Module: Brick::Cucumber::Extensions

Defined in:
lib/brick/frameworks/cucumber.rb

Overview

Helper method for disabling Brick in Cucumber features

Instance Method Summary collapse

Instance Method Details

#without_brickObject



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/brick/frameworks/cucumber.rb', line 17

def without_brick
  was_enable_routes = ::Brick.enable_routes?
  # was_enable_models = ::Brick.enable_models?
  # was_enable_controllers = ::Brick.enable_controllers?
  # was_enable_views = ::Brick.enable_views?
  ::Brick.enable_routes = false
  # ::Brick.enable_models = false
  # ::Brick.enable_controllers = false
  # ::Brick.enable_views = false
  begin
    yield
  ensure
    ::Brick.enable_routes = was_enable_routes
    # ::Brick.enable_models = was_enable_models
    # ::Brick.enable_controllers = was_enable_controllers
    # ::Brick.enable_views = was_enable_views
  end
end