test-unit-capybara 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Rakefile +8 -0
- data/doc/text/news.textile +22 -1
- data/lib/test/unit/capybara.rb +13 -5
- data/lib/test/unit/capybara/version.rb +2 -4
- data/test/test-assertions.rb +3 -2
- data/test/test-unit-capybara-test-utils.rb +5 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 65b02947d47d0fce73d1173662f6cc6f6246ee8950ab432138ff0b2b7b0f2f01
|
4
|
+
data.tar.gz: 640d006dcdd772fbf0e6071a835574fc44cc0b10871a301ee7489c36965a1c41
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67c03bd1b6786774d60fc1ec0508fd3904970c619ab42152e313c9edf854a0685d6c8cfbcf3a251b3bfc54a87f8b096db96312fd8a18922c3a103ad60077e016
|
7
|
+
data.tar.gz: 283399f8e7f3b9e6b8179479d5c6f901b03fc5d7a1fa15821f40b1a54e08178712672d3af24f6dcb625c46203f63722c11f55211c56796f8a86b5b3af37982f2
|
data/Rakefile
CHANGED
@@ -25,6 +25,7 @@ require 'packnga'
|
|
25
25
|
require "bundler/gem_helper"
|
26
26
|
|
27
27
|
base_dir = File.dirname(__FILE__)
|
28
|
+
html_base_dir = File.join(base_dir, "doc", "html")
|
28
29
|
helper = Bundler::GemHelper.new(base_dir)
|
29
30
|
|
30
31
|
def helper.version_tag
|
@@ -44,6 +45,13 @@ document_task = Packnga::DocumentTask.new(spec) do |task|
|
|
44
45
|
end
|
45
46
|
|
46
47
|
Packnga::ReleaseTask.new(spec) do |task|
|
48
|
+
test_unit_github_io_dir_candidates = [
|
49
|
+
"../../www/test-unit.github.io",
|
50
|
+
]
|
51
|
+
test_unit_github_io_dir = test_unit_github_io_dir_candidates.find do |dir|
|
52
|
+
File.directory?(dir)
|
53
|
+
end
|
54
|
+
task.index_html_dir = test_unit_github_io_dir
|
47
55
|
end
|
48
56
|
|
49
57
|
desc "Tag the current revision."
|
data/doc/text/news.textile
CHANGED
@@ -1,5 +1,26 @@
|
|
1
1
|
h1. News
|
2
2
|
|
3
|
+
h2(#1-0-6). 1.0.6 - 2018-06-06
|
4
|
+
|
5
|
+
h3. Improvements
|
6
|
+
|
7
|
+
* Improved release script.
|
8
|
+
[GitHub#5] [Patch by Hiroyuki Sato]
|
9
|
+
|
10
|
+
* Updated documents.
|
11
|
+
[GitHub#6] [Patch by Hiroyuki Sato]
|
12
|
+
|
13
|
+
* Added support for Capybara 3.
|
14
|
+
[GitHub#7] [Patch by neko maho]
|
15
|
+
|
16
|
+
h3. Thanks
|
17
|
+
|
18
|
+
* Hiroyuki Sato
|
19
|
+
|
20
|
+
* Hiroyuki Sato
|
21
|
+
|
22
|
+
* neko maho
|
23
|
+
|
3
24
|
h2(#1-0-5). 1.0.5 - 2016-01-18
|
4
25
|
|
5
26
|
h3. Improvements
|
@@ -10,7 +31,7 @@ h2(#1-0-4). 1.0.4 - 2013-05-15
|
|
10
31
|
|
11
32
|
A Capybara 2.1.0 support release.
|
12
33
|
|
13
|
-
h3.
|
34
|
+
h3. Improvements
|
14
35
|
|
15
36
|
* Supported Capybara 2.1.0.
|
16
37
|
It requires Capybara >= 2.1.0.
|
data/lib/test/unit/capybara.rb
CHANGED
@@ -70,7 +70,11 @@ module Test::Unit
|
|
70
70
|
begin
|
71
71
|
super
|
72
72
|
rescue ::Capybara::ElementNotFound => error
|
73
|
-
|
73
|
+
if ::Capybara::VERSION >= "3.0.0.rc1"
|
74
|
+
query = ::Capybara::Queries::SelectorQuery.new(*args, session_options: session_options)
|
75
|
+
else
|
76
|
+
query = ::Capybara::Query.new(*args)
|
77
|
+
end
|
74
78
|
new_error = ElementNotFound.new(self,
|
75
79
|
query.selector.name,
|
76
80
|
query.locator,
|
@@ -370,10 +374,14 @@ EOT
|
|
370
374
|
node = nil
|
371
375
|
node = args.shift if args[0].is_a?(::Capybara::Node::Base)
|
372
376
|
args = normalize_page_finder_arguments(args)
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
+
begin
|
378
|
+
if node
|
379
|
+
element = node.first(*args[:finder_arguments])
|
380
|
+
else
|
381
|
+
element = first(*args[:finder_arguments])
|
382
|
+
end
|
383
|
+
rescue ::Capybara::ExpectationNotMet
|
384
|
+
element = nil
|
377
385
|
end
|
378
386
|
format = <<-EOT
|
379
387
|
<?>(?) expected to not find a element but was
|
@@ -1,6 +1,4 @@
|
|
1
|
-
#
|
2
|
-
#
|
3
|
-
# Copyright (C) 2011-2013 Kouhei Sutou <kou@clear-code.com>
|
1
|
+
# Copyright (C) 2011-2016 Kouhei Sutou <kou@clear-code.com>
|
4
2
|
#
|
5
3
|
# This library is free software; you can redistribute it and/or
|
6
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -19,7 +17,7 @@
|
|
19
17
|
module Test
|
20
18
|
module Unit
|
21
19
|
module Capybara
|
22
|
-
VERSION = "1.0.
|
20
|
+
VERSION = "1.0.6"
|
23
21
|
end
|
24
22
|
end
|
25
23
|
end
|
data/test/test-assertions.rb
CHANGED
@@ -257,14 +257,15 @@ HTML
|
|
257
257
|
def test_pretty_print
|
258
258
|
visit("/")
|
259
259
|
section_html = @html.scan(/<div class="section">.*?<\/div>/m)[0]
|
260
|
+
element_class = find("html").class
|
260
261
|
message = <<-EOM.strip
|
261
262
|
<"XXX"> expected but was
|
262
|
-
|
263
|
+
<\#<#{element_class} tag="div" path="/html/body/div"
|
263
264
|
#{section_html}>>.
|
264
265
|
|
265
266
|
diff:
|
266
267
|
- "XXX"
|
267
|
-
+
|
268
|
+
+ \#<#{element_class} tag="div" path="/html/body/div"
|
268
269
|
+ <div class="section">
|
269
270
|
+ <h2>World</h2>
|
270
271
|
+ </div>>
|
@@ -25,4 +25,8 @@ require "test/unit/capybara"
|
|
25
25
|
require "pp"
|
26
26
|
|
27
27
|
tmp_path = File.expand_path(File.join("tmp", "capybara"), __FILE__)
|
28
|
-
Capybara
|
28
|
+
if Capybara::VERSION >= "3.0.0.rc1"
|
29
|
+
Capybara.save_path = tmp_path
|
30
|
+
else
|
31
|
+
Capybara.save_and_open_page_path= tmp_path
|
32
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-unit-capybara
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-unit
|
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
176
|
rubyforge_project:
|
177
|
-
rubygems_version: 2.
|
177
|
+
rubygems_version: 2.7.6
|
178
178
|
signing_key:
|
179
179
|
specification_version: 4
|
180
180
|
summary: test-unit-capybara is a Capybara adapter for test-unit 2. You can get "Capybara":https://rubygems.org/gems/capybara
|
@@ -184,4 +184,3 @@ test_files:
|
|
184
184
|
- test/run-test.rb
|
185
185
|
- test/test-unit-capybara-test-utils.rb
|
186
186
|
- test/test-wrapper.rb
|
187
|
-
has_rdoc:
|