Module: Capybarista::Extensions

Defined in:
lib/capybarista/extensions.rb

Defined Under Namespace

Modules: Base, Element, Session

Constant Summary collapse

LOG =
Logbert[self]
J =
Capybarista::Javascript

Class Method Summary collapse

Class Method Details

.applied?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/capybarista/extensions.rb', line 17

def self.applied?
  @applied
end

.apply!Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/capybarista/extensions.rb', line 21

def self.apply!

  if applied?
    LOG.debug "Capybarista extensions have already been applied"
  else
    Capybara::Session.class_eval do
      include Capybarista::Extensions::Session
    end

    Capybara::Node::Element.class_eval do
      include Capybarista::Extensions::Element
    end

    @applied = true
    LOG.warning "Capybara::Session and Capybara::Node::Element have been monkey-patched w/ the Capybarista extensions"
  end

end