capybara_table 0.1.0 → 0.1.1

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
  SHA1:
3
- metadata.gz: 96a5fadaa00a70d25d047626cc3c8a8b26fee919
4
- data.tar.gz: 1b8772029af2e20174820779da114a52cd7d05e6
3
+ metadata.gz: 7c306fa2fbb13302baff18df31bef0cc875c1f25
4
+ data.tar.gz: 9d66cef8bf929eea6511cd04e0c12228cd0431eb
5
5
  SHA512:
6
- metadata.gz: 262938b4c310f7765123f7478bd29122008dcb304e11d96e825d6958abb4365bf91f7510ac946193fdf9145a3b0ced5cab3af3eb61a08572a4b2b18edb93e613
7
- data.tar.gz: d5ae83da93ca9a663b1a1abf329112a86c7058945a2ac37207369345b457db5920d2b78bdb2f55dbe5334d18e20e7c7d8979f9fb1773e0acbbae0dd3dcb619e5
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).
@@ -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
- table = node.first(:xpath, XPath.axis(:"ancestor-or-self", :table))
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
@@ -1,3 +1,3 @@
1
1
  module CapybaraTable
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capybara_table
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonas Nicklas