Sha256: b49fe2af63b520771f988de42264cb81026b9b3ff72cc3848cfef1af0109c61b

Contents?: true

Size: 662 Bytes

Versions: 3

Compression:

Stored size: 662 Bytes

Contents

require "active_support/concern"
require "capybara_objects/registry_instance"
require "capybara_objects/exceptions/missing_locator"
module CapybaraObjects
  module ValidationMethods
    extend ActiveSupport::Concern
    # Validates that the component exists
    # this is simply done by searching for the root node.
    # However, a sub class may implement its own stricter
    # validation if required.
    # @raise CapybaraObjects::Exceptions::MissingLocator If a locator hasn't been defined using default_locator or locator (instance)
    def validate!
      raise Exceptions::MissingLocator unless locator.present?
      root_node.present?
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
capybara_objects-0.1.2 lib/capybara_objects/validation_methods.rb
capybara_objects-0.1.1 lib/capybara_objects/validation_methods.rb
capybara_objects-0.1.0 lib/capybara_objects/validation_methods.rb