test-unit-capybara 1.0.6 → 1.0.7

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
  SHA256:
3
- metadata.gz: 65b02947d47d0fce73d1173662f6cc6f6246ee8950ab432138ff0b2b7b0f2f01
4
- data.tar.gz: 640d006dcdd772fbf0e6071a835574fc44cc0b10871a301ee7489c36965a1c41
3
+ metadata.gz: c0046374cecdddc82cb15627d3d8a6170423e07a39ecb9b572db2dcd59d6adb7
4
+ data.tar.gz: da3c3fe048ef0a1cfe4d677f13aa32a94c5649c5fce71e7079aebee630a0dddb
5
5
  SHA512:
6
- metadata.gz: 67c03bd1b6786774d60fc1ec0508fd3904970c619ab42152e313c9edf854a0685d6c8cfbcf3a251b3bfc54a87f8b096db96312fd8a18922c3a103ad60077e016
7
- data.tar.gz: 283399f8e7f3b9e6b8179479d5c6f901b03fc5d7a1fa15821f40b1a54e08178712672d3af24f6dcb625c46203f63722c11f55211c56796f8a86b5b3af37982f2
6
+ metadata.gz: 2cc7c36b14188bab0088a011deeb7a1fe63a58ff3d70127b7ce9ca98143a324aa3c981e85f7908c4fb3ec518e1a5976af552e5949ae3b98a6765bc35210d7382
7
+ data.tar.gz: 97f11c15cc6e515c9ea011a3bc21b2084f68dbc9aa83be8884e8c9aa21b68aafd16d6e67a752e087e2fe91e6036e75222676392f02635f010024a66515de1347
@@ -1,20 +1,20 @@
1
- h1. test-unit-capybara
1
+ # test-unit-capybara
2
2
 
3
- "Web site":https://github.com/test-unit/test-unit-capybara
3
+ [Web site](https://github.com/test-unit/test-unit-capybara)
4
4
 
5
- h2. Description
5
+ ## Description
6
6
 
7
- 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.
7
+ 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.
8
8
 
9
- h2. Install
9
+ ## Install
10
10
 
11
- <pre>
11
+ ```
12
12
  % sudo gem install test-unit-capybara
13
- </pre>
13
+ ```
14
14
 
15
- h2. Usage
15
+ ## Usage
16
16
 
17
- <pre>
17
+ ```ruby
18
18
  require 'test/unit/capybara'
19
19
 
20
20
  class MyRackApplication
@@ -73,15 +73,28 @@ class TestMyRackApplication < Test::Unit::TestCase
73
73
  # It helps you debug a problem without save_and_open_page.
74
74
  end
75
75
  end
76
+
77
+ attribute :js, true
78
+ def test_destroy_a_post
79
+ # JavaScript driver is used
80
+ visit("/")
81
+ page.accept_confirm do
82
+ click_on("Destroy", match: :first)
83
+ end
84
+
85
+ within(".alert") do
86
+ assert_equal("Post was successfully destroyed", text)
87
+ end
88
+ end
76
89
  end
77
- </pre>
90
+ ```
78
91
 
79
- h2. License
92
+ ## License
80
93
 
81
94
  LGPLv2.1 or later.
82
95
 
83
96
  (Kouhei Sutou has a right to change the license including contributed patches.)
84
97
 
85
- h2. Authors
98
+ ## Authors
86
99
 
87
100
  * Kouhei Sutou
@@ -1,8 +1,27 @@
1
- h1. News
1
+ # News
2
2
 
3
- h2(#1-0-6). 1.0.6 - 2018-06-06
3
+ ## 1.0.7 - 2018-08-27
4
4
 
5
- h3. Improvements
5
+ ### Improvements
6
+
7
+ * Converted document format to Markdown.
8
+ [GitHub#8][Patch by okkez]
9
+
10
+ * Added an example for JavaScript driver.
11
+ [GitHub#4][GitHub#9][GitHub#10][Patch by okkez]
12
+
13
+ * Improved support for Capybara 3.
14
+ [GitHub#11][Patch by neko maho]
15
+
16
+ ### Thanks
17
+
18
+ * okkez
19
+
20
+ * neko maho
21
+
22
+ ## 1.0.6 - 2018-06-06
23
+
24
+ ### Improvements
6
25
 
7
26
  * Improved release script.
8
27
  [GitHub#5] [Patch by Hiroyuki Sato]
@@ -13,7 +32,7 @@ h3. Improvements
13
32
  * Added support for Capybara 3.
14
33
  [GitHub#7] [Patch by neko maho]
15
34
 
16
- h3. Thanks
35
+ ### Thanks
17
36
 
18
37
  * Hiroyuki Sato
19
38
 
@@ -21,55 +40,55 @@ h3. Thanks
21
40
 
22
41
  * neko maho
23
42
 
24
- h2(#1-0-5). 1.0.5 - 2016-01-18
43
+ ## 1.0.5 - 2016-01-18
25
44
 
26
- h3. Improvements
45
+ ### Improvements
27
46
 
28
47
  * Stopped to register auto test runner.
29
48
 
30
- h2(#1-0-4). 1.0.4 - 2013-05-15
49
+ ## 1.0.4 - 2013-05-15
31
50
 
32
51
  A Capybara 2.1.0 support release.
33
52
 
34
- h3. Improvements
53
+ ### Improvements
35
54
 
36
55
  * Supported Capybara 2.1.0.
37
56
  It requires Capybara >= 2.1.0.
38
57
  Notice: Capybara < 2.1.0 aren't supported from this release.
39
58
  [GitHub#2] [Reported by thelastinuit]
40
59
 
41
- h3. Thanks
60
+ ### Thanks
42
61
 
43
62
  * thelastinuit
44
63
 
45
- h2(#1-0-3). 1.0.3 - 2012-11-29
64
+ ## 1.0.3 - 2012-11-29
46
65
 
47
66
  A support Capybara 2.0.1 release.
48
67
 
49
- h3. Improvments
68
+ ### Improvments
50
69
 
51
70
  * Supported Capybara 2.0.1.
52
71
  It requires Capybara >= 2.0.1 and test-unit >= 2.5.3.
53
72
  Notice: Capybara 1.X aren't supported yet from this release.
54
73
 
55
- h2(#1-0-2). 1.0.2 - 2012-03-12
74
+ ## 1.0.2 - 2012-03-12
56
75
 
57
76
  A Capybara integration improvement release.
58
77
 
59
- h3. Improvments
78
+ ### Improvments
60
79
 
61
80
  * Supported Capybara 1.1.2 again.
62
81
 
63
- h2(#1-0-1). 1.0.1 - 2012-01-16
82
+ ## 1.0.1 - 2012-01-16
64
83
 
65
84
  A Capybara integration improvement release.
66
85
 
67
- h3. Improvments
86
+ ### Improvments
68
87
 
69
88
  * Added {Test::Unit::Capybara::Assertions#assert_all}.
70
89
  * Added {Test::Unit::Capybara::Assertions#assert_not_find}.
71
90
  * Supported Capybara::ElementNotFound as a failure.
72
91
 
73
- h2(#1-0-0). 1.0.0 - 2011-05-01
92
+ ## 1.0.0 - 2011-05-01
74
93
 
75
94
  The first release!!!
@@ -66,22 +66,31 @@ module Test::Unit
66
66
 
67
67
  # @private
68
68
  module FindErrorWrapper
69
- def find(*args)
70
- begin
69
+ find_method = ::Capybara::Node::Finders.instance_method(:find)
70
+ find_parameters = find_method.parameters
71
+ if find_parameters.any? {|_name, type| type == :options}
72
+ def find(*args, **options, &optional_filter_block)
71
73
  super
72
74
  rescue ::Capybara::ElementNotFound => error
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
78
- new_error = ElementNotFound.new(self,
79
- query.selector.name,
80
- query.locator,
81
- error.message)
82
- raise new_error
75
+ options[:session_options] = session_options
76
+ query = ::Capybara::Queries::SelectorQuery.new(*args, options, &optional_filter_block)
77
+ raise generate_element_not_found(query, error.message)
78
+ end
79
+ else
80
+ def find(*args)
81
+ super
82
+ rescue ::Capybara::ElementNotFound => error
83
+ query = ::Capybara::Query.new(*args)
84
+ raise generate_element_not_found(query, error.message)
83
85
  end
84
86
  end
87
+
88
+ def generate_element_not_found(query, message)
89
+ ElementNotFound.new(self,
90
+ query.selector.name,
91
+ query.locator,
92
+ message)
93
+ end
85
94
  end
86
95
 
87
96
  # @private
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2011-2016 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2011-2018 Kouhei Sutou <kou@clear-code.com>
2
2
  #
3
3
  # This library is free software; you can redistribute it and/or
4
4
  # modify it under the terms of the GNU Lesser General Public
@@ -17,7 +17,7 @@
17
17
  module Test
18
18
  module Unit
19
19
  module Capybara
20
- VERSION = "1.0.6"
20
+ VERSION = "1.0.7"
21
21
  end
22
22
  end
23
23
  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.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-06-06 00:00:00.000000000 Z
11
+ date: 2018-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-unit
@@ -123,7 +123,7 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: RedCloth
126
+ name: redcarpet
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
@@ -145,9 +145,9 @@ extra_rdoc_files: []
145
145
  files:
146
146
  - COPYING
147
147
  - Gemfile
148
- - README.textile
148
+ - README.md
149
149
  - Rakefile
150
- - doc/text/news.textile
150
+ - doc/text/news.md
151
151
  - lib/test/unit/capybara.rb
152
152
  - lib/test/unit/capybara/version.rb
153
153
  - test/run-test.rb
@@ -174,10 +174,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
174
174
  version: '0'
175
175
  requirements: []
176
176
  rubyforge_project:
177
- rubygems_version: 2.7.6
177
+ rubygems_version: 3.0.0.beta1
178
178
  signing_key:
179
179
  specification_version: 4
180
- summary: test-unit-capybara is a Capybara adapter for test-unit 2. You can get "Capybara":https://rubygems.org/gems/capybara
180
+ summary: test-unit-capybara is a Capybara adapter for test-unit 2. You can get [Capybara](https://rubygems.org/gems/capybara)
181
181
  integrated Test::Unit::TestCase. It also provides useful assertions for Capybara.
182
182
  test_files:
183
183
  - test/test-assertions.rb