module Cucumber
  module Salad
    module Widgets
      class Document < Widget
        include WidgetContainer

        root 'body'

        def initialize(options)
          self.widget_lookup_scope =
            options.delete(:widget_lookup_scope) or raise "No scope given"

          options[:root] ||= Capybara.current_session

          super options
        end

        def widget(name)
          widget_class(name).in_node(root)
        end
      end
    end
  end
end

module Cucumber
  module Salad
    module Widgets
      class Document
        include WidgetContainer

        def initialize(options)
          self.widget_lookup_scope =
            options.delete(:widget_lookup_scope) or raise "No scope given"
        end

        def widget(name)
          widget_class(name).in_node(root)
        end

        def root
          Capybara.current_session
        end
      end
    end
  end
end

Define Document apart from Widget.
Define Document apart from Widget.
