axe-core-api 4.5.1 → 4.6.0.pre.094e546

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 855680bb403cceb1eed265773f3697b92b784af839d4c35b379da6d94d1ad730
4
- data.tar.gz: 8a22df8e11835506cc51e2c6e8b257b523cffd140009f55242e494a654c6324a
3
+ metadata.gz: 25e4de4ad734fb6207582545b0eea32cd475ee2ec5260f17bf2cf54936cdf933
4
+ data.tar.gz: 51ac546b1aabe1c0ed05bbedbff3ff5393973688fe1794d7159fb54123e10176
5
5
  SHA512:
6
- metadata.gz: 636c56da57308e948dca2ebba6db5435329d40353ad8d7e59e4e0630df83992117640b0c2b876250644c6b227943d9d9daf62b91ad0d0af5389457d2c907b33c
7
- data.tar.gz: '0995cfc1871a631cea5459c249dda586be7038349cd866d715f30030b0640a33648b4c59f7dab5b790a960af4217ecf7177fc0e840e437327cd988ab7c5abf52'
6
+ metadata.gz: e4db262d589a3ff7678f86f7cc538e40423776ff6bcf6311486fa97976cef1bb0dcb300f51b03b2ec8d033f9a0a2739e7a0d86dfda9aca5364f157983eb3613b
7
+ data.tar.gz: 7e9c7f0d0f938b2a347a65ebeafae7eb1e0dc3f1735709206beecbfa6f8c6f265995c29c28a128de1b9c90157c9c36d561d010fc658169d42883dbf51f2c899f
@@ -9,11 +9,11 @@ module Axe
9
9
  end
10
10
 
11
11
  def within(*selectors)
12
- @inclusion.concat selectors.map { |s| Array(Selector.new s) }
12
+ @inclusion.concat selectors.map { |s| Selector::normalize s }
13
13
  end
14
14
 
15
15
  def excluding(*selectors)
16
- @exclusion.concat selectors.map { |s| Array(Selector.new s) }
16
+ @exclusion.concat selectors.map { |s| Selector::normalize s }
17
17
  end
18
18
 
19
19
  def to_h
@@ -1,6 +1,18 @@
1
1
  module Axe
2
2
  module API
3
3
  class Selector
4
+ def self.normalize(s)
5
+ if s.is_a? Hash
6
+ if s.key? :iframe and s.key? :selector
7
+ Array(Selector.new s)
8
+ else
9
+ s
10
+ end
11
+ else
12
+ Array(Selector.new s)
13
+ end
14
+ end
15
+
4
16
  def initialize(s)
5
17
  @selector = case s
6
18
  when Array then s