axe-core-api 4.5.1.pre.343efa9 → 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: fd7e60d52b1c4b789d22afca425b266a7d82f4fc3fbbcf06287827550aa60c5f
4
- data.tar.gz: 94031c6ae67f7eee928ee397cd271ff9d89ac56d9361302522a52154ff40e1dd
3
+ metadata.gz: 25e4de4ad734fb6207582545b0eea32cd475ee2ec5260f17bf2cf54936cdf933
4
+ data.tar.gz: 51ac546b1aabe1c0ed05bbedbff3ff5393973688fe1794d7159fb54123e10176
5
5
  SHA512:
6
- metadata.gz: 4aaed70387e4ca0b01e118915f8dd891a34e8f641151460bc7ad8b14789f3eb5f5f2237a28b5d35bf768b52b3b244decdaccfb3368d7ba3774c1e95f868b41fe
7
- data.tar.gz: ac87f42b009a6cf9d43b7f43bc1b59a76b97bbdbc36546fc9f543a29e98bfee2d7346b698cd73cef3cdb6f711bbc5ec78ddc45cbbe84ccc72bf30f7be6b2b94a
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