Sha256: a72a1c2f56655486dca0f7f0ee075dd945a0d1680b07c880d68c1da705a508c9

Contents?: true

Size: 589 Bytes

Versions: 38

Compression:

Stored size: 589 Bytes

Contents

module Celerity

  class Identifier
    attr_accessor :text
    attr_reader :tag, :attributes

    def initialize(tag, attributes = {})
      @tag        = tag
      @attributes = attributes
      @text       = nil
    end

    def match?(element)
      return false unless @tag == element.getTagName

      attr_result = @attributes.all? do |key, values|
        values.any? { |val| Util.matches?(element.getAttribute(key.to_s), val) }
      end

      if @text
        attr_result && Util.matches?(element.asText.strip, @text)
      else
        attr_result
      end
    end
  end

end

Version data entries

38 entries across 38 versions & 6 rubygems

Version Path
celerity_thingista-0.9.3 lib/celerity/identifier.rb
celerity_thingista-0.9.2 lib/celerity/identifier.rb
frameworks-capybara-0.2.0.rc6 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/lib/celerity/identifier.rb
frameworks-capybara-0.2.0.rc5 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/lib/celerity/identifier.rb
frameworks-capybara-0.2.0.rc4 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/lib/celerity/identifier.rb
frameworks-capybara-0.2.0.rc3 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/lib/celerity/identifier.rb
frameworks-capybara-0.2.0.rc2 vendor/bundle/ruby/1.8/gems/celerity-0.9.2/lib/celerity/identifier.rb
celerity-0.9.2 lib/celerity/identifier.rb
celerity-0.9.1 lib/celerity/identifier.rb
no-click-exception-celerity-0.9.0 lib/celerity/identifier.rb
celerity-0.9.0 lib/celerity/identifier.rb
celerity-0.8.9 lib/celerity/identifier.rb
celerity-0.8.9.pre lib/celerity/identifier.rb
celerity-0.8.8 lib/celerity/identifier.rb
celerity-0.8.7 lib/celerity/identifier.rb
celerity-0.8.6 lib/celerity/identifier.rb
celerity-0.8.5 lib/celerity/identifier.rb
celerity-0.8.4 lib/celerity/identifier.rb
celerity-0.8.2 lib/celerity/identifier.rb
celerity-0.8.1 lib/celerity/identifier.rb