summaryrefslogtreecommitdiff
path: root/qa/qa/page/page_concern.rb
blob: 6ba2d27f5746acaa31e371134edcb54a83a7c16e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
module QA
  module Page
    module PageConcern
      def included(base)
        unless base.is_a?(Class)
          raise "Expected #{self} to be prepended to a class, but #{base} is a module!"
        end

        unless base.ancestors.include?(::QA::Page::Base)
          raise "Expected #{self} to be prepended to a class that inherits from ::QA::Page::Base, but #{base} doesn't!"
        end
      end
      alias_method :prepended, :included
    end
  end
end