test-unit-capybara 1.0.2 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -18,14 +18,4 @@
18
18
 
19
19
  source :rubygems
20
20
 
21
- gem "test-unit", ">= 2.4.4"
22
- gem "capybara", ">= 1.1.2"
23
- gem "json"
24
-
25
- group :development, :test do
26
- gem "rake"
27
- gem "jeweler"
28
- gem "yard"
29
- gem "packnga"
30
- gem "test-unit-notify"
31
- end
21
+ gemspec
data/Rakefile CHANGED
@@ -21,41 +21,18 @@ require './lib/test/unit/capybara/version'
21
21
  require 'rubygems'
22
22
  require 'rubygems/package_task'
23
23
  require 'yard'
24
- require 'jeweler'
25
24
  require 'packnga'
25
+ require "bundler/gem_helper"
26
26
 
27
- def cleanup_white_space(entry)
28
- entry.gsub(/(\A\n+|\n+\z)/, '') + "\n"
29
- end
27
+ base_dir = File.dirname(__FILE__)
28
+ helper = Bundler::GemHelper.new(base_dir)
30
29
 
31
- ENV["VERSION"] ||= Test::Unit::Capybara::VERSION
32
- version = ENV["VERSION"].dup
33
- spec = nil
34
- Jeweler::Tasks.new do |_spec|
35
- spec = _spec
36
- spec.name = "test-unit-capybara"
37
- spec.version = version
38
- spec.rubyforge_project = "test-unit"
39
- spec.homepage = "http://test-unit.rubyforge.org/#test-unit-capybara"
40
- spec.authors = ["Kouhei Sutou"]
41
- spec.email = ["kou@clear-code.com"]
42
- entries = File.read("README.textile").split(/^h2\.\s(.*)$/)
43
- description = cleanup_white_space(entries[entries.index("Description") + 1])
44
- spec.summary, spec.description, = description.split(/\n\n+/, 3)
45
- spec.license = "LGPLv2 or later"
46
- spec.files = FileList["lib/**/*.rb",
47
- "bin/*",
48
- "doc/text/*",
49
- "README.textile",
50
- "COPYING",
51
- "Rakefile",
52
- "Gemfile"]
53
- spec.test_files = FileList["test/**/*.rb"]
30
+ def helper.version_tag
31
+ version
54
32
  end
55
33
 
56
- Rake::Task["release"].prerequisites.clear
57
- Jeweler::RubygemsDotOrgTasks.new do
58
- end
34
+ helper.install
35
+ spec = helper.gemspec
59
36
 
60
37
  Gem::PackageTask.new(spec) do |pkg|
61
38
  pkg.need_tar_gz = true
@@ -1,5 +1,15 @@
1
1
  h1. News
2
2
 
3
+ h2(#1-0-3). 1.0.3 - 2012-11-29
4
+
5
+ A support Capybara 2.0.1 release.
6
+
7
+ h3. Improvments
8
+
9
+ * Supported Capybara 2.0.1.
10
+ It requires Capybara >= 2.0.1 and test-unit >= 2.5.3.
11
+ Notice: Capybara 1.X aren't supported yet from this release.
12
+
3
13
  h2(#1-0-2). 1.0.2 - 2012-03-12
4
14
 
5
15
  A Capybara integration improvement release.
@@ -53,7 +53,8 @@ module Test::Unit
53
53
 
54
54
  # @private
55
55
  class ElementNotFound < ::Capybara::ElementNotFound
56
- attr_reader :node, :kind, :locator
56
+ attr_accessor :node
57
+ attr_reader :kind, :locator
57
58
  def initialize(node, kind, locator, message)
58
59
  @node = node
59
60
  @kind = kind
@@ -63,34 +64,48 @@ module Test::Unit
63
64
  end
64
65
 
65
66
  # @private
66
- module FindError
67
+ module FindErrorWrapper
67
68
  class << self
68
69
  def included(base)
69
70
  base.module_eval do
70
- alias_method :raise_find_error_original, :raise_find_error
71
- alias_method :raise_find_error, :raise_find_error_for_test_unit
71
+ alias_method :find_error_original, :find_error
72
+ alias_method :find_error, :find_error_for_test_unit
72
73
  end
73
74
  end
74
75
  end
75
76
 
76
- def raise_find_error_for_test_unit(*args)
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}")
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
+ def find(*args)
92
+ begin
93
+ super
94
+ rescue ElementNotFound => error
95
+ error.node = self
96
+ raise error
85
97
  end
86
- raise ElementNotFound.new(self, normalized.selector.name,
87
- normalized.locator, message)
88
98
  end
89
99
  end
90
100
 
91
101
  # @private
92
- class ::Capybara::Node::Base
93
- include FindError
102
+ class ::Capybara::Result
103
+ include FindErrorWrapper
104
+ end
105
+
106
+ # @private
107
+ class ::Capybara::Node::Element
108
+ include FindErrorNodeSetter
94
109
  end
95
110
 
96
111
  # @private
@@ -477,6 +492,8 @@ EOT
477
492
  if node
478
493
  if node.base.respond_to?(:source)
479
494
  node.base.source
495
+ elsif node.base.respond_to?(:html)
496
+ node.base.html
480
497
  else
481
498
  node.base.native.to_s
482
499
  end
@@ -19,7 +19,7 @@
19
19
  module Test
20
20
  module Unit
21
21
  module Capybara
22
- VERSION = "1.0.2"
22
+ VERSION = "1.0.3"
23
23
  end
24
24
  end
25
25
  end
@@ -73,6 +73,9 @@ HTML
73
73
 
74
74
  def test_find
75
75
  result = _run_test
76
+ assert_equal("1 tests, 1 assertions, 1 failures, 0 errors, 0 pendings, " \
77
+ "0 omissions, 0 notifications", result.to_s)
78
+
76
79
  message = <<-EOM.chomp
77
80
  <"h3">(:css) expected to find a element in
78
81
  <<div class="section">
@@ -81,8 +84,6 @@ HTML
81
84
  EOM
82
85
  assert_equal([message],
83
86
  result.failures.collect {|failure| failure.message})
84
- assert_equal("1 tests, 1 assertions, 1 failures, 0 errors, 0 pendings, " \
85
- "0 omissions, 0 notifications", result.to_s)
86
87
  end
87
88
 
88
89
  private
metadata CHANGED
@@ -1,194 +1,213 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: test-unit-capybara
3
- version: !ruby/object:Gem::Version
4
- hash: 19
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.3
5
5
  prerelease:
6
- segments:
7
- - 1
8
- - 0
9
- - 2
10
- version: 1.0.2
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Kouhei Sutou
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
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
22
- none: false
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- hash: 23
27
- segments:
28
- - 2
29
- - 4
30
- - 4
31
- version: 2.4.4
12
+ date: 2012-11-30 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
32
15
  name: test-unit
33
- prerelease: false
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: 2.5.3
34
22
  type: :runtime
35
- requirement: *id001
36
- - !ruby/object:Gem::Dependency
37
- version_requirements: &id002 !ruby/object:Gem::Requirement
38
- none: false
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
49
23
  prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 2.5.3
30
+ - !ruby/object:Gem::Dependency
31
+ name: capybara
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: 2.0.1
50
38
  type: :runtime
51
- requirement: *id002
52
- - !ruby/object:Gem::Dependency
53
- version_requirements: &id003 !ruby/object:Gem::Requirement
54
- none: false
55
- requirements:
56
- - - ">="
57
- - !ruby/object:Gem::Version
58
- hash: 3
59
- segments:
60
- - 0
61
- version: "0"
62
- name: json
63
39
  prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: 2.0.1
46
+ - !ruby/object:Gem::Dependency
47
+ name: json
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
64
54
  type: :runtime
65
- requirement: *id003
66
- - !ruby/object:Gem::Dependency
67
- version_requirements: &id004 !ruby/object:Gem::Requirement
68
- none: false
69
- requirements:
70
- - - ">="
71
- - !ruby/object:Gem::Version
72
- hash: 3
73
- segments:
74
- - 0
75
- version: "0"
76
- name: rake
77
55
  prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
63
+ name: bundler
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
78
70
  type: :development
79
- requirement: *id004
80
- - !ruby/object:Gem::Dependency
81
- version_requirements: &id005 !ruby/object:Gem::Requirement
82
- none: false
83
- requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- hash: 3
87
- segments:
88
- - 0
89
- version: "0"
90
- name: jeweler
91
71
  prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: rake
80
+ requirement: !ruby/object:Gem::Requirement
81
+ none: false
82
+ requirements:
83
+ - - ! '>='
84
+ - !ruby/object:Gem::Version
85
+ version: '0'
92
86
  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
105
87
  prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ! '>='
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ - !ruby/object:Gem::Dependency
95
+ name: yard
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
106
102
  type: :development
107
- requirement: *id006
108
- - !ruby/object:Gem::Dependency
109
- version_requirements: &id007 !ruby/object:Gem::Requirement
110
- none: false
111
- requirements:
112
- - - ">="
113
- - !ruby/object:Gem::Version
114
- hash: 3
115
- segments:
116
- - 0
117
- version: "0"
118
- name: packnga
119
103
  prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
110
+ - !ruby/object:Gem::Dependency
111
+ name: packnga
112
+ requirement: !ruby/object:Gem::Requirement
113
+ none: false
114
+ requirements:
115
+ - - ! '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
120
118
  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"
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ none: false
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ - !ruby/object:Gem::Dependency
132
127
  name: test-unit-notify
128
+ requirement: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ! '>='
132
+ - !ruby/object:Gem::Version
133
+ version: '0'
134
+ type: :development
133
135
  prerelease: false
136
+ version_requirements: !ruby/object:Gem::Requirement
137
+ none: false
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ - !ruby/object:Gem::Dependency
143
+ name: RedCloth
144
+ requirement: !ruby/object:Gem::Requirement
145
+ none: false
146
+ requirements:
147
+ - - ! '>='
148
+ - !ruby/object:Gem::Version
149
+ version: '0'
134
150
  type: :development
135
- requirement: *id008
136
- description: ""
137
- email:
151
+ prerelease: false
152
+ version_requirements: !ruby/object:Gem::Requirement
153
+ none: false
154
+ requirements:
155
+ - - ! '>='
156
+ - !ruby/object:Gem::Version
157
+ version: '0'
158
+ description: ''
159
+ email:
138
160
  - kou@clear-code.com
139
161
  executables: []
140
-
141
162
  extensions: []
142
-
143
- extra_rdoc_files:
163
+ extra_rdoc_files: []
164
+ files:
165
+ - lib/test/unit/capybara/version.rb
166
+ - lib/test/unit/capybara.rb
167
+ - doc/text/news.textile
144
168
  - README.textile
145
- files:
146
169
  - COPYING
147
- - Gemfile
148
- - README.textile
149
170
  - Rakefile
150
- - doc/text/news.textile
151
- - lib/test/unit/capybara.rb
152
- - lib/test/unit/capybara/version.rb
171
+ - Gemfile
153
172
  - test/run-test.rb
154
173
  - test/test-assertions.rb
155
- - test/test-unit-capybara-test-utils.rb
156
174
  - test/test-wrapper.rb
175
+ - test/test-unit-capybara-test-utils.rb
157
176
  homepage: http://test-unit.rubyforge.org/#test-unit-capybara
158
- licenses:
177
+ licenses:
159
178
  - LGPLv2 or later
160
179
  post_install_message:
161
180
  rdoc_options: []
162
-
163
- require_paths:
181
+ require_paths:
164
182
  - lib
165
- required_ruby_version: !ruby/object:Gem::Requirement
183
+ required_ruby_version: !ruby/object:Gem::Requirement
166
184
  none: false
167
- requirements:
168
- - - ">="
169
- - !ruby/object:Gem::Version
170
- hash: 3
171
- segments:
185
+ requirements:
186
+ - - ! '>='
187
+ - !ruby/object:Gem::Version
188
+ version: '0'
189
+ segments:
172
190
  - 0
173
- version: "0"
174
- required_rubygems_version: !ruby/object:Gem::Requirement
191
+ hash: 920619814670605304
192
+ required_rubygems_version: !ruby/object:Gem::Requirement
175
193
  none: false
176
- requirements:
177
- - - ">="
178
- - !ruby/object:Gem::Version
179
- hash: 3
180
- segments:
194
+ requirements:
195
+ - - ! '>='
196
+ - !ruby/object:Gem::Version
197
+ version: '0'
198
+ segments:
181
199
  - 0
182
- version: "0"
200
+ hash: 920619814670605304
183
201
  requirements: []
184
-
185
202
  rubyforge_project: test-unit
186
- rubygems_version: 1.8.15
203
+ rubygems_version: 1.8.23
187
204
  signing_key:
188
205
  specification_version: 3
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:
206
+ summary: test-unit-capybara is a Capybara adapter for test-unit 2. You can get "Capybara":https://rubygems.org/gems/capybara
207
+ integrated Test::Unit::TestCase. It also provides useful assertions for Capybara.
208
+ test_files:
191
209
  - test/run-test.rb
192
210
  - test/test-assertions.rb
193
- - test/test-unit-capybara-test-utils.rb
194
211
  - test/test-wrapper.rb
212
+ - test/test-unit-capybara-test-utils.rb
213
+ has_rdoc: