xpath-specs 0.0.2 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- checksums.yaml.gz.sig +3 -2
- data.tar.gz.sig +0 -0
- data/.travis.yml +3 -0
- data/README.md +10 -0
- data/lib/xpath/specs/contain_a_matcher.rb +5 -5
- data/lib/xpath/specs/version.rb +1 -1
- data/spec/spec_helper.rb +3 -0
- data/xpath-specs.gemspec +3 -2
- metadata +33 -5
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NGE1YTQ0Yjc4NWE3OWQ0MTU3NjVhMGYzNWVhNjc3Mjc3NmNkYmNkMw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
N2JlZjFkYTI1ZjliMjBiOTA4Yzk2NGQwMmRhM2ZlN2RlNWEyOWZmZQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NTJiMmFhYjdiOGNiNzU2YjU1ZGEyMjFlM2JiMTI2OGVkZWQxMDQ2MmY1MjE0
|
10
|
+
ZTUzZTdiOTgwNmFjYmY0Y2ZmNGUwNDYzNzI0NDk4YWY5YjRmNTUwODc1Y2U5
|
11
|
+
Njc0OWZlMDdjYThjN2Y4NmQ5MDVhMzgyMGM3ZTRlYzIwZjAwMTk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZGQ3M2QxY2FjNDM5YmI2ZmU2ZjMxOGQyMjYyNDUzM2M3ODIyN2FlMDFiNGRi
|
14
|
+
ZWViOTMzN2RiMjU1MTlkNWIyNmVkNmExM2NmNzc2NjgxOWY0OGQ3YmI5Yzdi
|
15
|
+
OGM0M2VkYjdmNDViZTVhZTc0M2RhNWY1ZTAyMzdlMzM5MWZjYWY=
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1,3 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
���j�F��D�T�����=T�!U�t!��O�������̒)i�a�)o��|��X��_2#f�`���k<����3lC,6?��B/��i
|
2
|
+
@�ϑy<�=v�/D֬�3E�����oY���S�
|
3
|
+
G�>K^���"�R�Q3�>ws.����~� �K�%or[��<Dh�'`lYM��K��O1���R�Q�T��d�2����K���d-Ϛ[Zv%�V�����rY6A����}�2HKF��-����=�
|
data.tar.gz.sig
CHANGED
Binary file
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[](https://travis-ci.org/philou/xpath-specs) [](https://codeclimate.com/github/philou/xpath-specs) [](https://codeclimate.com/github/philou/xpath-specs)
|
2
|
+
|
1
3
|
# Xpath::Specs
|
2
4
|
|
3
5
|
An RSpec library to get better messages when matching XPaths
|
@@ -97,6 +99,14 @@ expected the page to contain a dish that is named Grilled Lobster (//table[@id='
|
|
97
99
|
but not a dish that is named Grilled Lobster (//table[@id='dish-panel']//tr[td[contains(.,'#{name}')]])
|
98
100
|
```
|
99
101
|
|
102
|
+
### Testing from Cucumber
|
103
|
+
|
104
|
+
Just use the 'page' in place of your view :
|
105
|
+
|
106
|
+
```ruby
|
107
|
+
expect(page).to contain_a(dish_panel)
|
108
|
+
```
|
109
|
+
|
100
110
|
## Contributing
|
101
111
|
|
102
112
|
1. Fork it
|
@@ -16,11 +16,11 @@ module Xpath
|
|
16
16
|
doc_contains(@page_part)
|
17
17
|
end
|
18
18
|
|
19
|
-
def
|
20
|
-
|
19
|
+
def failure_message
|
20
|
+
failure_message_ex(@page_part)
|
21
21
|
end
|
22
22
|
|
23
|
-
def
|
23
|
+
def failure_message_when_negated
|
24
24
|
"expected the page not to contain #{@page_part.long_description})"
|
25
25
|
end
|
26
26
|
|
@@ -46,9 +46,9 @@ module Xpath
|
|
46
46
|
!matched_node(page_part).empty?
|
47
47
|
end
|
48
48
|
|
49
|
-
def
|
49
|
+
def failure_message_ex(page_part)
|
50
50
|
if parent_cannot_be_found(page_part)
|
51
|
-
|
51
|
+
failure_message_ex(page_part.parent)
|
52
52
|
elsif !page_part.has_parent
|
53
53
|
[description,
|
54
54
|
"but could not find #{page_part.long_description}"].join("\n")
|
data/lib/xpath/specs/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
data/xpath-specs.gemspec
CHANGED
@@ -18,10 +18,11 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.
|
21
|
+
spec.add_dependency "nokogiri", "~> 1.0"
|
22
|
+
spec.add_dependency "rspec", "~> 3.0"
|
22
23
|
|
23
24
|
spec.add_development_dependency "bundler"
|
24
25
|
spec.add_development_dependency "rake"
|
25
26
|
spec.add_development_dependency "guard-rspec"
|
26
|
-
|
27
|
+
spec.add_development_dependency "codeclimate-test-reporter"
|
27
28
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xpath-specs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Philou
|
@@ -38,10 +38,38 @@ cert_chain:
|
|
38
38
|
NU5zd3dIY0llUVpCL05JRDdiZXJJZjlhd3gzCnlMY2wxY21tNUFMdEovK0Jr
|
39
39
|
a21wMGk0YW1YZVRETXZxOXI4UEJzVnNRd3hZT1lKQlArVW14ejNQWDZIakZI
|
40
40
|
clEKWGRrWHgzb1oKLS0tLS1FTkQgQ0VSVElGSUNBVEUtLS0tLQo=
|
41
|
-
date: 2014-
|
41
|
+
date: 2014-08-25 00:00:00.000000000 Z
|
42
42
|
dependencies:
|
43
43
|
- !ruby/object:Gem::Dependency
|
44
44
|
name: nokogiri
|
45
|
+
requirement: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - ~>
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '1.0'
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - ~>
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '1.0'
|
57
|
+
- !ruby/object:Gem::Dependency
|
58
|
+
name: rspec
|
59
|
+
requirement: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ~>
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: '3.0'
|
64
|
+
type: :runtime
|
65
|
+
prerelease: false
|
66
|
+
version_requirements: !ruby/object:Gem::Requirement
|
67
|
+
requirements:
|
68
|
+
- - ~>
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: '3.0'
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: bundler
|
45
73
|
requirement: !ruby/object:Gem::Requirement
|
46
74
|
requirements:
|
47
75
|
- - ! '>='
|
@@ -55,7 +83,7 @@ dependencies:
|
|
55
83
|
- !ruby/object:Gem::Version
|
56
84
|
version: '0'
|
57
85
|
- !ruby/object:Gem::Dependency
|
58
|
-
name:
|
86
|
+
name: rake
|
59
87
|
requirement: !ruby/object:Gem::Requirement
|
60
88
|
requirements:
|
61
89
|
- - ! '>='
|
@@ -69,7 +97,7 @@ dependencies:
|
|
69
97
|
- !ruby/object:Gem::Version
|
70
98
|
version: '0'
|
71
99
|
- !ruby/object:Gem::Dependency
|
72
|
-
name:
|
100
|
+
name: guard-rspec
|
73
101
|
requirement: !ruby/object:Gem::Requirement
|
74
102
|
requirements:
|
75
103
|
- - ! '>='
|
@@ -83,7 +111,7 @@ dependencies:
|
|
83
111
|
- !ruby/object:Gem::Version
|
84
112
|
version: '0'
|
85
113
|
- !ruby/object:Gem::Dependency
|
86
|
-
name:
|
114
|
+
name: codeclimate-test-reporter
|
87
115
|
requirement: !ruby/object:Gem::Requirement
|
88
116
|
requirements:
|
89
117
|
- - ! '>='
|
metadata.gz.sig
CHANGED
Binary file
|