capybara-extensions 0.3.1 → 0.3.2
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 +1 -1
- data/lib/capybara-extensions.rb +5 -3
- data/lib/capybara-extensions/finders.rb +0 -1
- data/lib/capybara-extensions/matchers.rb +0 -1
- data/lib/capybara-extensions/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: 2c9967dbf793edfaa80f0ff458df34676c135057
|
4
|
+
data.tar.gz: 826fad27ed93d9cfab4c5cf593d2043d03640bd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 98eb5242121ad891d8473e7abc76e88cd47e1dd5d3ab0c45f29f2a87574f6beefe7bb46a404ac0bc9a6f2fff4b5a43abc594f2b148303d8e3c59767c49ed068a
|
7
|
+
data.tar.gz: d57a543692c616475290f1fdafd1261442867bd55f69222b071bbfad05380345d0b9c0cc8cf76478242f3e3cb5844928b4250513b5fcf12c260bc2db84d656be
|
data/README.md
CHANGED
@@ -26,7 +26,7 @@ require 'capybara-extensions'
|
|
26
26
|
|
27
27
|
## The DSL
|
28
28
|
|
29
|
-
A complete reference of the finders and matchers added by CapybaraExtensions is available at [Rubydoc.info](http://rubydoc.info/github/dockyard/capybara-extensions). You can read more about the library in [this blog post](http://reefpoints.dockyard.com/2013/
|
29
|
+
A complete reference of the finders and matchers added by CapybaraExtensions is available at [Rubydoc.info](http://rubydoc.info/github/dockyard/capybara-extensions). You can read more about the library in [this blog post](http://reefpoints.dockyard.com/2013/11/11/capybara-extensions.html).
|
30
30
|
|
31
31
|
## Versioning
|
32
32
|
|
data/lib/capybara-extensions.rb
CHANGED
@@ -2,14 +2,16 @@ require 'capybara'
|
|
2
2
|
require 'capybara_minitest_spec'
|
3
3
|
|
4
4
|
module CapybaraExtensions
|
5
|
-
|
5
|
+
def self.extension_methods
|
6
|
+
(CapybaraExtensions::Finders.instance_methods + CapybaraExtensions::Matchers.instance_methods - Object.instance_methods).uniq
|
7
|
+
end
|
6
8
|
end
|
7
9
|
|
8
10
|
require 'capybara-extensions/finders'
|
9
11
|
require 'capybara-extensions/matchers'
|
10
12
|
|
11
13
|
module Capybara::DSL
|
12
|
-
CapybaraExtensions
|
14
|
+
CapybaraExtensions.extension_methods.each do |method|
|
13
15
|
define_method method do |*args, &block|
|
14
16
|
page.send method, *args, &block
|
15
17
|
end
|
@@ -17,7 +19,7 @@ module Capybara::DSL
|
|
17
19
|
end
|
18
20
|
|
19
21
|
class Capybara::Session
|
20
|
-
CapybaraExtensions::
|
22
|
+
CapybaraExtensions::extension_methods.each do |method|
|
21
23
|
define_method method do |*args, &block|
|
22
24
|
current_scope.send method, *args, &block
|
23
25
|
end
|
@@ -2,7 +2,6 @@ require_relative 'locators'
|
|
2
2
|
|
3
3
|
module CapybaraExtensions::Finders
|
4
4
|
include CapybaraExtensions::Locators
|
5
|
-
CapybaraExtensions::ExtensionMethods.concat [:find_article, :find_aside, :find_footer, :find_form, :find_header, :find_list_item, :find_navigation, :find_ordered_list, :find_paragraph, :find_row, :find_section, :find_table, :find_unordered_list, :first_article, :first_aside, :first_footer, :first_form, :first_header, :first_navigation, :first_ordered_list, :first_paragraph, :first_row, :first_section, :first_table, :first_unordered_list, :list_item_number, :row_number]
|
6
5
|
|
7
6
|
# Find an HTML article based on the given arguments.
|
8
7
|
#
|
@@ -2,7 +2,6 @@ require_relative 'locators'
|
|
2
2
|
|
3
3
|
module CapybaraExtensions::Matchers
|
4
4
|
include CapybaraExtensions::Locators
|
5
|
-
CapybaraExtensions::ExtensionMethods.concat [:has_field_value?, :has_no_field_value?, :has_image?, :has_no_image?, :has_meta_tag?, :has_no_meta_tag?]
|
6
5
|
|
7
6
|
# Checks that the current node has an image with the given src or alt.
|
8
7
|
#
|