diff --git a/features/cli/layout.feature b/features/cli/layout.feature index 3512939..162b5ba 100644 --- a/features/cli/layout.feature +++ b/features/cli/layout.feature @@ -9,3 +9,7 @@ Feature: layout CLI option """ When I run uhwm with option -v -r./layout -l MyLayout Then the output must match /layout.+mylayout/i + + Scenario: resolves layout class from the root namespace + When I run uhwm with option -v -l Layout + Then the output must contain "uninitialized constant Layout" diff --git a/lib/uh/wm/cli.rb b/lib/uh/wm/cli.rb index f69287b..e1faddd 100644 --- a/lib/uh/wm/cli.rb +++ b/lib/uh/wm/cli.rb @@ -68,7 +68,7 @@ module Uh log "Loaded `#{feature}' ruby feature" end opts.on '-l', '--layout LAYOUT', 'specify layout' do |layout| - @env.layout_class = self.class.const_get layout.to_sym + @env.layout_class = Object.const_get layout.to_sym end opts.on '-w', Workers.types, '--worker WORKER', 'specify worker' do |worker|