watir_pump 0.3.6 → 0.3.7
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/lib/watir_pump/component.rb +20 -2
- 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: 6ec31a031d8aedd7d62a03f29e2e3b7926efdc68
|
4
|
+
data.tar.gz: 7089d63c641acb31767e957abb5854247d92aba6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9c9372a6656ff88907f40f71346d232f378cce8f7324f072d17ba1085fd4efc603d2d1132815d629cc7fd327102d7bd4b58892f842c3397cae8df5ff817641b
|
7
|
+
data.tar.gz: 1ef6400e082d0c038cbfa5ad4606a5078ff2cc376840764d86ec03f32a8048f3824a84eb047cbec9226ee320645164d5b71495117055a70dfe278494e2672277
|
data/lib/watir_pump/component.rb
CHANGED
@@ -126,8 +126,26 @@ module WatirPump
|
|
126
126
|
instance_exec(*args, &p)
|
127
127
|
end
|
128
128
|
end
|
129
|
-
|
130
|
-
|
129
|
+
|
130
|
+
def element(name, p)
|
131
|
+
define_method(name) do |*args|
|
132
|
+
ret = instance_exec(*args, &p)
|
133
|
+
unless ret.is_a?(Watir::Element)
|
134
|
+
raise 'element method did not return a Watir::Element'
|
135
|
+
end
|
136
|
+
ret
|
137
|
+
end
|
138
|
+
end
|
139
|
+
|
140
|
+
def elements(name, p)
|
141
|
+
define_method(name) do |*args|
|
142
|
+
ret = instance_exec(*args, &p)
|
143
|
+
unless ret.is_a?(Watir::ElementCollection)
|
144
|
+
raise 'elements method did not return a Watir::ElementCollection'
|
145
|
+
end
|
146
|
+
ret
|
147
|
+
end
|
148
|
+
end
|
131
149
|
|
132
150
|
def region(name, loc_method = nil, *loc_args, &blk)
|
133
151
|
klass = Class.new(Component) { instance_exec(&blk) }
|