rspec-html 0.2.17 → 0.2.19

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: 202d1ada700f7071e92c4468a5a6777ce953c080d003ddb38da2b1368e0dc4fb
4
- data.tar.gz: 16c180dc70119aa3152241e4dfd75249c563df2bf5091a08d594c54b14cf2baa
3
+ metadata.gz: 8865227f9bc455819f4ba863c81203949304871e7e99d61c28d97f7564aaad4b
4
+ data.tar.gz: af0fb5b13c1ee182abf8f38a3b5ff9298db43caaf59fc5bd11c6de4e6bd6523a
5
5
  SHA512:
6
- metadata.gz: 0cc5a31d66fe3087d9248cb7528b088d667635672de83174f41b45b8a61d2708ade6f50db6cbcada675049bb30f684ed2df7cc83312b096cf4a0e5d1d1ed9dee
7
- data.tar.gz: a6611b7dfd07963cbac2d5df0afd403e49afbc57419e5afdb9cc0a5604c73ad0de6407619d577fd03b98ab9675523596bc86aa7dfd89fa8667c58ed3acd95791
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.17)
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
- nokogiri (1.13.10-x86_64-linux)
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)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RSpec
4
4
  module HTML
5
- VERSION = '0.2.17'
5
+ VERSION = '0.2.19'
6
6
  end
7
7
  end
@@ -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
 
@@ -16,16 +16,20 @@ 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
22
26
 
23
27
  def css(*args)
24
- self.class.new(@element&.css(*args), :css)
28
+ self.class.new(@element&.css(*args), :css, element_wrapper)
25
29
  end
26
30
 
27
31
  def xpath(*args)
28
- self.class.new(@element&.xpath(*args), :xpath)
32
+ self.class.new(@element&.xpath(*args), :xpath, element_wrapper)
29
33
  end
30
34
 
31
35
  def present?
@@ -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("//#{tag}#{conditions}")
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.17
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-02 00:00:00.000000000 Z
11
+ date: 2023-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri