Skip to content

Commit

Permalink
(BKR-953) Stop including the dsl at the top level
Browse files Browse the repository at this point in the history
To reload the beaker dsl after adding modules to it, beaker-pe had just
included the module into the top level namespace. This resulted in
errors loading in other libraries not expecting the dsl to be loaded at
the top level. This commit changes that inclusion mechanism to be safe
from namespace collisions.
  • Loading branch information
tvpartytonight committed Oct 6, 2016
1 parent 7362ab7 commit 12823a5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions lib/beaker-pe.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ module PE
# Boilerplate DSL inclusion mechanism:
# First we register our module with the Beaker DSL
Beaker::DSL.register( Beaker::DSL::PE )
# Then we have to re-include our amended DSL in the TestCase,
# because in general, the DSL is included in TestCase far
# before test files are executed, so our amendments wouldn't
# come through otherwise
include Beaker::DSL

# Second,We need to reload the DSL, but before we had reloaded
# it in the global namespace, which result in errors colliding
# with other gems rightfully not expecting beaker's dsl to
# be available at the global level.
module Beaker
class TestCase
include Beaker::DSL
end
end

0 comments on commit 12823a5

Please sign in to comment.