test-unit-capybara 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,20 @@
1
1
  h1. News
2
2
 
3
+ h2(#1-0-4). 1.0.4 - 2013-05-15
4
+
5
+ A Capybara 2.1.0 support release.
6
+
7
+ h3. Improvments
8
+
9
+ * Supported Capybara 2.1.0.
10
+ It requires Capybara >= 2.1.0.
11
+ Notice: Capybara < 2.1.0 aren't supported from this release.
12
+ [GitHub#2] [Reported by thelastinuit]
13
+
14
+ h3. Thanks
15
+
16
+ * thelastinuit
17
+
3
18
  h2(#1-0-3). 1.0.3 - 2012-11-29
4
19
 
5
20
  A support Capybara 2.0.1 release.
@@ -1,6 +1,6 @@
1
1
  # -*- ruby -*-
2
2
  #
3
- # Copyright (C) 2011-2012 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2011-2013 Kouhei Sutou <kou@clear-code.com>
4
4
  #
5
5
  # This library is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU Lesser General Public
@@ -65,49 +65,25 @@ module Test::Unit
65
65
 
66
66
  # @private
67
67
  module FindErrorWrapper
68
- class << self
69
- def included(base)
70
- base.module_eval do
71
- alias_method :find_error_original, :find_error
72
- alias_method :find_error, :find_error_for_test_unit
73
- end
74
- end
75
- end
76
-
77
- def find_error_for_test_unit(*args)
78
- error = find_error_original(*args)
79
- if error.is_a?(::Capybara::ElementNotFound)
80
- error = ElementNotFound.new(nil,
81
- @query.selector.name,
82
- @query.locator,
83
- error.message)
84
- end
85
- error
86
- end
87
- end
88
-
89
- # @private
90
- module FindErrorNodeSetter
91
68
  def find(*args)
92
69
  begin
93
70
  super
94
- rescue ElementNotFound => error
95
- error.node = self
96
- raise error
71
+ rescue ::Capybara::ElementNotFound => error
72
+ query = ::Capybara::Query.new(*args)
73
+ new_error = ElementNotFound.new(self,
74
+ query.selector.name,
75
+ query.locator,
76
+ error.message)
77
+ raise new_error
97
78
  end
98
79
  end
99
80
  end
100
81
 
101
82
  # @private
102
- class ::Capybara::Result
83
+ class ::Capybara::Node::Base
103
84
  include FindErrorWrapper
104
85
  end
105
86
 
106
- # @private
107
- class ::Capybara::Node::Element
108
- include FindErrorNodeSetter
109
- end
110
-
111
87
  # @private
112
88
  module ElementNotFoundHandler
113
89
  class << self
@@ -227,7 +203,7 @@ module Test::Unit
227
203
  if block_given?
228
204
  expected_response, actual_response = yield(expected_response,
229
205
  actual_response)
230
- end
206
+ end
231
207
  assert_equal(expected_response, actual_response)
232
208
  end
233
209
 
@@ -300,7 +276,7 @@ module Test::Unit
300
276
  <?>(?) expected to find one or more elements in
301
277
  <?>
302
278
  EOT
303
- current_context = node || page.send(:current_node)
279
+ current_context = node || page.send(:current_scope)
304
280
  current_context_source = node_source(current_context)
305
281
  source_in_message = AssertionMessage.literal(current_context_source)
306
282
  full_message = build_message(args[:message],
@@ -405,7 +381,7 @@ EOT
405
381
  EOT
406
382
  element_source = nil
407
383
  element_source = node_source(element) if element
408
- current_context = node || page.send(:current_node)
384
+ current_context = node || page.send(:current_scope)
409
385
  current_context_source = node_source(current_context)
410
386
  source_in_message = AssertionMessage.literal(current_context_source)
411
387
  full_message = build_message(args[:message],
@@ -1,6 +1,6 @@
1
1
  # -*- ruby -*-
2
2
  #
3
- # Copyright (C) 2011-2012 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2011-2013 Kouhei Sutou <kou@clear-code.com>
4
4
  #
5
5
  # This library is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU Lesser General Public
@@ -19,7 +19,7 @@
19
19
  module Test
20
20
  module Unit
21
21
  module Capybara
22
- VERSION = "1.0.3"
22
+ VERSION = "1.0.4"
23
23
  end
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test-unit-capybara
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-30 00:00:00.000000000 Z
12
+ date: 2013-05-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: test-unit
@@ -34,7 +34,7 @@ dependencies:
34
34
  requirements:
35
35
  - - ! '>='
36
36
  - !ruby/object:Gem::Version
37
- version: 2.0.1
37
+ version: 2.1.0
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -42,7 +42,7 @@ dependencies:
42
42
  requirements:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
- version: 2.0.1
45
+ version: 2.1.0
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: json
48
48
  requirement: !ruby/object:Gem::Requirement
@@ -162,17 +162,17 @@ executables: []
162
162
  extensions: []
163
163
  extra_rdoc_files: []
164
164
  files:
165
- - lib/test/unit/capybara/version.rb
166
165
  - lib/test/unit/capybara.rb
166
+ - lib/test/unit/capybara/version.rb
167
167
  - doc/text/news.textile
168
168
  - README.textile
169
169
  - COPYING
170
170
  - Rakefile
171
171
  - Gemfile
172
+ - test/test-unit-capybara-test-utils.rb
172
173
  - test/run-test.rb
173
174
  - test/test-assertions.rb
174
175
  - test/test-wrapper.rb
175
- - test/test-unit-capybara-test-utils.rb
176
176
  homepage: http://test-unit.rubyforge.org/#test-unit-capybara
177
177
  licenses:
178
178
  - LGPLv2 or later
@@ -186,18 +186,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
186
186
  - - ! '>='
187
187
  - !ruby/object:Gem::Version
188
188
  version: '0'
189
- segments:
190
- - 0
191
- hash: 920619814670605304
192
189
  required_rubygems_version: !ruby/object:Gem::Requirement
193
190
  none: false
194
191
  requirements:
195
192
  - - ! '>='
196
193
  - !ruby/object:Gem::Version
197
194
  version: '0'
198
- segments:
199
- - 0
200
- hash: 920619814670605304
201
195
  requirements: []
202
196
  rubyforge_project: test-unit
203
197
  rubygems_version: 1.8.23
@@ -206,8 +200,8 @@ specification_version: 3
206
200
  summary: test-unit-capybara is a Capybara adapter for test-unit 2. You can get "Capybara":https://rubygems.org/gems/capybara
207
201
  integrated Test::Unit::TestCase. It also provides useful assertions for Capybara.
208
202
  test_files:
203
+ - test/test-unit-capybara-test-utils.rb
209
204
  - test/run-test.rb
210
205
  - test/test-assertions.rb
211
206
  - test/test-wrapper.rb
212
- - test/test-unit-capybara-test-utils.rb
213
207
  has_rdoc: