test-unit-capybara 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +3 -1
- data/Rakefile +7 -0
- data/doc/text/news.textile +8 -0
- data/lib/test/unit/capybara/version.rb +1 -1
- data/lib/test/unit/capybara.rb +20 -11
- metadata +142 -99
data/Gemfile
CHANGED
@@ -16,8 +16,10 @@
|
|
16
16
|
# License along with this library; if not, write to the Free Software
|
17
17
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
18
18
|
|
19
|
+
source :rubygems
|
20
|
+
|
19
21
|
gem "test-unit", ">= 2.4.4"
|
20
|
-
gem "capybara", ">= 1.1.
|
22
|
+
gem "capybara", ">= 1.1.2"
|
21
23
|
gem "json"
|
22
24
|
|
23
25
|
group :development, :test do
|
data/Rakefile
CHANGED
data/doc/text/news.textile
CHANGED
data/lib/test/unit/capybara.rb
CHANGED
@@ -53,11 +53,12 @@ module Test::Unit
|
|
53
53
|
|
54
54
|
# @private
|
55
55
|
class ElementNotFound < ::Capybara::ElementNotFound
|
56
|
-
attr_reader :node, :
|
57
|
-
def initialize(node,
|
56
|
+
attr_reader :node, :kind, :locator
|
57
|
+
def initialize(node, kind, locator, message)
|
58
58
|
@node = node
|
59
|
-
@
|
60
|
-
|
59
|
+
@kind = kind
|
60
|
+
@locator = locator
|
61
|
+
super(message)
|
61
62
|
end
|
62
63
|
end
|
63
64
|
|
@@ -73,8 +74,17 @@ module Test::Unit
|
|
73
74
|
end
|
74
75
|
|
75
76
|
def raise_find_error_for_test_unit(*args)
|
76
|
-
|
77
|
-
|
77
|
+
options = extract_normalized_options(args)
|
78
|
+
normalized = ::Capybara::Selector.normalize(*args)
|
79
|
+
if normalized.failure_message
|
80
|
+
message = normalized.failure_message.call(self, normalized)
|
81
|
+
else
|
82
|
+
message = options[:message]
|
83
|
+
message ||= ("Unable to find #{normalized.name} " +
|
84
|
+
"#{normalized.locator.inspect}")
|
85
|
+
end
|
86
|
+
raise ElementNotFound.new(self, normalized.selector.name,
|
87
|
+
normalized.locator, message)
|
78
88
|
end
|
79
89
|
end
|
80
90
|
|
@@ -95,11 +105,10 @@ module Test::Unit
|
|
95
105
|
def handle_capybara_element_not_found(exception)
|
96
106
|
return false unless exception.is_a?(ElementNotFound)
|
97
107
|
return false unless respond_to?(:flunk_find)
|
98
|
-
query = exception.query
|
99
108
|
begin
|
100
109
|
flunk_find(exception.node,
|
101
|
-
:kind =>
|
102
|
-
:locator =>
|
110
|
+
:kind => exception.kind,
|
111
|
+
:locator => exception.locator)
|
103
112
|
rescue AssertionFailedError => assertion_failed_error
|
104
113
|
assertion_failed_error.backtrace.replace(exception.backtrace)
|
105
114
|
handle_exception(assertion_failed_error)
|
@@ -345,7 +354,7 @@ EOT
|
|
345
354
|
# # </div>
|
346
355
|
# # </body>
|
347
356
|
# # </html>
|
348
|
-
# section =
|
357
|
+
# section = find("section")
|
349
358
|
# p section
|
350
359
|
# # => #<Capybara::Element tag="h2" path="/html/body/div">
|
351
360
|
# assert_not_find(section, "h1")
|
@@ -361,7 +370,7 @@ EOT
|
|
361
370
|
# # </div>
|
362
371
|
# # </body>
|
363
372
|
# # </html>
|
364
|
-
# section =
|
373
|
+
# section = find("section")
|
365
374
|
# p section
|
366
375
|
# # => #<Capybara::Element tag="h2" path="/html/body/div">
|
367
376
|
# assert_not_find(section, "h2")
|
metadata
CHANGED
@@ -1,112 +1,148 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-unit-capybara
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 2
|
10
|
+
version: 1.0.2
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Kouhei Sutou
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
+
|
18
|
+
date: 2012-03-12 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
17
22
|
none: false
|
18
|
-
requirements:
|
19
|
-
- -
|
20
|
-
- !ruby/object:Gem::Version
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
hash: 23
|
27
|
+
segments:
|
28
|
+
- 2
|
29
|
+
- 4
|
30
|
+
- 4
|
21
31
|
version: 2.4.4
|
22
|
-
|
32
|
+
name: test-unit
|
23
33
|
prerelease: false
|
24
|
-
version_requirements: *10499920
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: capybara
|
27
|
-
requirement: &10498860 !ruby/object:Gem::Requirement
|
28
|
-
none: false
|
29
|
-
requirements:
|
30
|
-
- - ! '>='
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 1.1.3
|
33
34
|
type: :runtime
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
name: json
|
38
|
-
requirement: &10497900 !ruby/object:Gem::Requirement
|
35
|
+
requirement: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
39
38
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
44
|
-
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 23
|
43
|
+
segments:
|
44
|
+
- 1
|
45
|
+
- 1
|
46
|
+
- 2
|
47
|
+
version: 1.1.2
|
48
|
+
name: capybara
|
45
49
|
prerelease: false
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
+
type: :runtime
|
51
|
+
requirement: *id002
|
52
|
+
- !ruby/object:Gem::Dependency
|
53
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
50
54
|
none: false
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
|
55
|
-
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
hash: 3
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
version: "0"
|
62
|
+
name: json
|
56
63
|
prerelease: false
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
64
|
+
type: :runtime
|
65
|
+
requirement: *id003
|
66
|
+
- !ruby/object:Gem::Dependency
|
67
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
61
68
|
none: false
|
62
|
-
requirements:
|
63
|
-
- -
|
64
|
-
- !ruby/object:Gem::Version
|
65
|
-
|
66
|
-
|
69
|
+
requirements:
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
hash: 3
|
73
|
+
segments:
|
74
|
+
- 0
|
75
|
+
version: "0"
|
76
|
+
name: rake
|
67
77
|
prerelease: false
|
68
|
-
version_requirements: *10496560
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: yard
|
71
|
-
requirement: &10495920 !ruby/object:Gem::Requirement
|
72
|
-
none: false
|
73
|
-
requirements:
|
74
|
-
- - ! '>='
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
version: '0'
|
77
78
|
type: :development
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
name: packnga
|
82
|
-
requirement: &10495100 !ruby/object:Gem::Requirement
|
79
|
+
requirement: *id004
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
83
82
|
none: false
|
84
|
-
requirements:
|
85
|
-
- -
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
|
83
|
+
requirements:
|
84
|
+
- - ">="
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
hash: 3
|
87
|
+
segments:
|
88
|
+
- 0
|
89
|
+
version: "0"
|
90
|
+
name: jeweler
|
91
|
+
prerelease: false
|
88
92
|
type: :development
|
93
|
+
requirement: *id005
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
hash: 3
|
101
|
+
segments:
|
102
|
+
- 0
|
103
|
+
version: "0"
|
104
|
+
name: yard
|
89
105
|
prerelease: false
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
106
|
+
type: :development
|
107
|
+
requirement: *id006
|
108
|
+
- !ruby/object:Gem::Dependency
|
109
|
+
version_requirements: &id007 !ruby/object:Gem::Requirement
|
94
110
|
none: false
|
95
|
-
requirements:
|
96
|
-
- -
|
97
|
-
- !ruby/object:Gem::Version
|
98
|
-
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
hash: 3
|
115
|
+
segments:
|
116
|
+
- 0
|
117
|
+
version: "0"
|
118
|
+
name: packnga
|
119
|
+
prerelease: false
|
99
120
|
type: :development
|
121
|
+
requirement: *id007
|
122
|
+
- !ruby/object:Gem::Dependency
|
123
|
+
version_requirements: &id008 !ruby/object:Gem::Requirement
|
124
|
+
none: false
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
hash: 3
|
129
|
+
segments:
|
130
|
+
- 0
|
131
|
+
version: "0"
|
132
|
+
name: test-unit-notify
|
100
133
|
prerelease: false
|
101
|
-
|
102
|
-
|
103
|
-
|
134
|
+
type: :development
|
135
|
+
requirement: *id008
|
136
|
+
description: ""
|
137
|
+
email:
|
104
138
|
- kou@clear-code.com
|
105
139
|
executables: []
|
140
|
+
|
106
141
|
extensions: []
|
107
|
-
|
142
|
+
|
143
|
+
extra_rdoc_files:
|
108
144
|
- README.textile
|
109
|
-
files:
|
145
|
+
files:
|
110
146
|
- COPYING
|
111
147
|
- Gemfile
|
112
148
|
- README.textile
|
@@ -114,38 +150,45 @@ files:
|
|
114
150
|
- doc/text/news.textile
|
115
151
|
- lib/test/unit/capybara.rb
|
116
152
|
- lib/test/unit/capybara/version.rb
|
117
|
-
- test/test-unit-capybara-test-utils.rb
|
118
153
|
- test/run-test.rb
|
119
154
|
- test/test-assertions.rb
|
155
|
+
- test/test-unit-capybara-test-utils.rb
|
120
156
|
- test/test-wrapper.rb
|
121
157
|
homepage: http://test-unit.rubyforge.org/#test-unit-capybara
|
122
|
-
licenses:
|
158
|
+
licenses:
|
123
159
|
- LGPLv2 or later
|
124
160
|
post_install_message:
|
125
161
|
rdoc_options: []
|
126
|
-
|
162
|
+
|
163
|
+
require_paths:
|
127
164
|
- lib
|
128
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
165
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
129
166
|
none: false
|
130
|
-
requirements:
|
131
|
-
- -
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
|
134
|
-
|
167
|
+
requirements:
|
168
|
+
- - ">="
|
169
|
+
- !ruby/object:Gem::Version
|
170
|
+
hash: 3
|
171
|
+
segments:
|
172
|
+
- 0
|
173
|
+
version: "0"
|
174
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
175
|
none: false
|
136
|
-
requirements:
|
137
|
-
- -
|
138
|
-
- !ruby/object:Gem::Version
|
139
|
-
|
176
|
+
requirements:
|
177
|
+
- - ">="
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
hash: 3
|
180
|
+
segments:
|
181
|
+
- 0
|
182
|
+
version: "0"
|
140
183
|
requirements: []
|
184
|
+
|
141
185
|
rubyforge_project: test-unit
|
142
|
-
rubygems_version: 1.8.
|
186
|
+
rubygems_version: 1.8.15
|
143
187
|
signing_key:
|
144
188
|
specification_version: 3
|
145
|
-
summary: test-unit-capybara is a Capybara adapter for test-unit 2. You can get "Capybara":https://rubygems.org/gems/capybara
|
146
|
-
|
147
|
-
test_files:
|
148
|
-
- test/test-unit-capybara-test-utils.rb
|
189
|
+
summary: test-unit-capybara is a Capybara adapter for test-unit 2. You can get "Capybara":https://rubygems.org/gems/capybara integrated Test::Unit::TestCase. It also provides useful assertions for Capybara.
|
190
|
+
test_files:
|
149
191
|
- test/run-test.rb
|
150
192
|
- test/test-assertions.rb
|
193
|
+
- test/test-unit-capybara-test-utils.rb
|
151
194
|
- test/test-wrapper.rb
|