Sha256: 57b0bf69bc517336d1583913c04a4a9f862b403978a4e20069dae91a8825e6ee

Contents?: true

Size: 704 Bytes

Versions: 155

Compression:

Stored size: 704 Bytes

Contents

module Axe
  class AccessibleExpectation
    def assert(page, matcher)
      raise matcher.failure_message unless matcher.matches? page
    end
  end

  class InaccessibleExpectation
    def assert(page, matcher)
      raise matcher.failure_message_when_negated if matcher.matches? page
    end
  end

  class AccessibilityExpectation
    def self.create(negate)
      negate ? InaccessibleExpectation.new : AccessibleExpectation.new
    end

    def initialize(page)
      @page = page
    end

    def to(matcher)
      AccessibleExpectation.new.assert @page, matcher
    end

    def to_not(matcher)
      InaccessibleExpectation.new.assert @page, matcher
    end

    alias :not_to :to_not
  end
end

Version data entries

155 entries across 155 versions & 1 rubygems

Version Path
axe-core-api-4.10.1.pre.5294583 lib/axe/expectation.rb
axe-core-api-4.10.2 lib/axe/expectation.rb
axe-core-api-4.10.2.pre.2cca230 lib/axe/expectation.rb
axe-core-api-4.10.1.pre.46a0052 lib/axe/expectation.rb
axe-core-api-4.10.1.pre.7e72b19 lib/axe/expectation.rb
axe-core-api-4.10.1.pre.5e15f96 lib/axe/expectation.rb
axe-core-api-4.10.2.pre.5bd4e5c lib/axe/expectation.rb
axe-core-api-4.10.1.pre.7bf959f lib/axe/expectation.rb
axe-core-api-4.10.1 lib/axe/expectation.rb
axe-core-api-4.10.0.pre.53569f6 lib/axe/expectation.rb
axe-core-api-4.10.1.pre.7a3723a lib/axe/expectation.rb
axe-core-api-4.10.0.pre.d102edb lib/axe/expectation.rb
axe-core-api-4.9.1.pre.7a03090 lib/axe/expectation.rb
axe-core-api-4.9.1.pre.1a5838a lib/axe/expectation.rb
axe-core-api-4.10.0 lib/axe/expectation.rb
axe-core-api-4.10.0.pre.5d7eac5 lib/axe/expectation.rb
axe-core-api-4.9.1.pre.f16172e lib/axe/expectation.rb
axe-core-api-4.9.1.pre.09e659e lib/axe/expectation.rb
axe-core-api-4.9.1.pre.a80eeee lib/axe/expectation.rb
axe-core-api-4.9.0.pre.a02013a lib/axe/expectation.rb