capybara_table 0.1.0 → 0.1.1
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 +4 -4
- data/README.md +0 -4
- data/lib/capybara_table/rspec.rb +5 -6
- data/lib/capybara_table/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c306fa2fbb13302baff18df31bef0cc875c1f25
|
4
|
+
data.tar.gz: 9d66cef8bf929eea6511cd04e0c12228cd0431eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b820534fcb81c01c2c8ed228e7d991891bd7fefac9a4b1c5aee6d1b7568efd85f5ab14a786db869376c46a76b1d5b0b90e5a94eb6ed48db3ea0ce0d7607f0ec5
|
7
|
+
data.tar.gz: 8b1a3156bf63075e07339803af0b0890c6a13ae86eb5961e291c4ffdf6d6175496e0015166f1d5d17a433b625c4c51f3ef70e7b5371978ec89e44bf0946462af
|
data/README.md
CHANGED
@@ -71,10 +71,6 @@ within :table, "People" do
|
|
71
71
|
end
|
72
72
|
```
|
73
73
|
|
74
|
-
If the node you pass to the `have_table_row` matcher is a table (or a
|
75
|
-
descendant thereof, like a tbody), then you will get a nice ASCII table
|
76
|
-
rendering if the row can't be found.
|
77
|
-
|
78
74
|
## License
|
79
75
|
|
80
76
|
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/lib/capybara_table/rspec.rb
CHANGED
@@ -21,14 +21,13 @@ module CapybaraTable
|
|
21
21
|
end
|
22
22
|
|
23
23
|
failure_message do |node|
|
24
|
+
node = node.document if node.is_a?(Capybara::Session)
|
24
25
|
node.synchronize do
|
25
|
-
|
26
|
-
|
27
|
-
if table
|
28
|
-
selector.failure_message + " in the following table:\n\n" + CapybaraTable::Renderer.render(table)
|
29
|
-
else
|
30
|
-
selector.failure_message
|
26
|
+
tables = node.all(:xpath, XPath.descendant_or_self(:table)).map do |table|
|
27
|
+
CapybaraTable::Renderer.render(table)
|
31
28
|
end
|
29
|
+
|
30
|
+
selector.failure_message + " in the following tables:\n\n" + tables.join("\n\n")
|
32
31
|
end
|
33
32
|
end
|
34
33
|
end
|