rspec-html 0.2.18 → 0.2.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -2
- data/lib/rspec/html/version.rb +1 -1
- data/lib/rspec_html/element.rb +2 -2
- data/lib/rspec_html/search.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8865227f9bc455819f4ba863c81203949304871e7e99d61c28d97f7564aaad4b
|
4
|
+
data.tar.gz: af0fb5b13c1ee182abf8f38a3b5ff9298db43caaf59fc5bd11c6de4e6bd6523a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 147e82f99c7412cf7cddf6439e6b6d787f0a39738a51c521dda2890545329f852797dcf242ed0ce1d61bd50c268d8dfa72fdc62ca47bfdfd041d03466d29544f
|
7
|
+
data.tar.gz: 1d2758a85c78c74a39c8114f1d00dbaac9ec3a64ffec22d5fa246b1133bc789d880dc2fdcf99daddf7641546f28fa32fd6a11fd4bc01ebf89b6cc7ab5a409ca1
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rspec-html (0.2.
|
4
|
+
rspec-html (0.2.19)
|
5
5
|
nokogiri (~> 1.10)
|
6
6
|
rspec (~> 3.0)
|
7
7
|
|
@@ -15,7 +15,9 @@ GEM
|
|
15
15
|
i18n (1.13.0)
|
16
16
|
concurrent-ruby (~> 1.0)
|
17
17
|
json (2.6.3)
|
18
|
-
|
18
|
+
mini_portile2 (2.8.2)
|
19
|
+
nokogiri (1.13.10)
|
20
|
+
mini_portile2 (~> 2.8.0)
|
19
21
|
racc (~> 1.4)
|
20
22
|
paint (2.3.0)
|
21
23
|
parallel (1.23.0)
|
data/lib/rspec/html/version.rb
CHANGED
data/lib/rspec_html/element.rb
CHANGED
@@ -3,13 +3,13 @@
|
|
3
3
|
module RSpecHTML
|
4
4
|
# HTML DOM element abstraction
|
5
5
|
class Element
|
6
|
-
attr_reader :name, :element
|
6
|
+
attr_reader :name, :element, :search
|
7
7
|
|
8
8
|
extend Forwardable
|
9
9
|
|
10
10
|
def_delegators :@search,
|
11
11
|
:has_css?, :has_xpath?, :include?,
|
12
|
-
:all, :siblings, :text, :truncated_text, :attributes,
|
12
|
+
:all, :siblings, :text, :truncated_text, :attributes, :to_a,
|
13
13
|
:size, :length, :[],
|
14
14
|
:css, :xpath, :checked?
|
15
15
|
|
data/lib/rspec_html/search.rb
CHANGED
@@ -16,6 +16,10 @@ module RSpecHTML
|
|
16
16
|
@element&.to_s
|
17
17
|
end
|
18
18
|
|
19
|
+
def to_a
|
20
|
+
all.to_a
|
21
|
+
end
|
22
|
+
|
19
23
|
def include?(val)
|
20
24
|
text.include?(val)
|
21
25
|
end
|
@@ -140,7 +144,7 @@ module RSpecHTML
|
|
140
144
|
|
141
145
|
def where_xpath(tag, query)
|
142
146
|
conditions = "[#{where_conditions(query)}]" unless query.compact.empty?
|
143
|
-
@element&.xpath("
|
147
|
+
@element&.xpath(".//#{tag}#{conditions}")
|
144
148
|
end
|
145
149
|
|
146
150
|
def where_conditions(query)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.19
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bob Farrell
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|