qoobaa-webrat 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. data/History.txt +360 -0
  2. data/MIT-LICENSE.txt +19 -0
  3. data/README.rdoc +85 -0
  4. data/Rakefile +200 -0
  5. data/install.rb +1 -0
  6. metadata +67 -0
@@ -0,0 +1,360 @@
1
+ == 0.4.5 / ?
2
+
3
+ * Major enhancements
4
+
5
+ * Ruby 1.9 compatibility (Michael Fellinger, Jakub Kuźma)
6
+ * Improve performance (~2x) on JRuby by supporting Nokogiri
7
+ * Added support for external app servers in selenium mode (basically don't start one) (Mike Gaffney)
8
+ * Added support for uploading files for Merb (Ryan Carver)
9
+
10
+ * Minor enhancements
11
+
12
+ * Upgrade to selenium-client to 1.2.16 (Brian Landau)
13
+ * Upgrade selenium-server.jar to 1.0.1 (Brian Landau)
14
+ * Make redirect detection work in the face of rational maths (like when ruby-units is active) (Piers Cawley)
15
+ * Use Launchy to handle opening pages in the browser with cross-platform compatibility (Bryan Helmkamp)
16
+ * Added support for field_labeled_locators ending in non word characters
17
+ lh 148 (Zach Dennis)
18
+ * Filled in tests on click link lh 195 (diabolo)
19
+ * Added current_url to selenium session lh 215 (Luke Amdor)
20
+ * Added silence spec to selenium lh 238 (Martin Gamsjaeger aka snusnu)
21
+ * Added ability to configure the browser startup timeout for selenium lh 242 (Mike Gaffney, Mark Dodwell)
22
+ * Added delegation for field_named lh194 (pivotal labs)
23
+ * Added fix to keep from escaping field values in mechanize mode lh256 (jish)
24
+ * Adding fixes for click button/link and made the integration specs pass for the same in selenium lh254 (Ldiehl, Matthias Marschall)
25
+ * Adding clicking link by id in selenium mode lh221 (larrytheliquid)
26
+ * Adding fix for have_selector and have_xpath in descendent blocks lh234 (Thomas Jack)
27
+ * Adding fix for fields with labels with special characters (Thomas Jack, Mike Gaffney, Bryan Hemlkamp)
28
+ * Deprecated current_page lh50 (Mike Gaffney)
29
+ * Fixed issue with redirects and multiple hosts lh168 (Mutwin Kraus)
30
+
31
+ * Bug fixes
32
+
33
+ * Wait for application servers socket on 0.0.0.0 instead of the application_address
34
+ * Translate CSS and image paths with single quotes in save_and_open_page (Erin Staniland)
35
+
36
+ == 0.4.4 / 2009-04-06
37
+
38
+ * Major enhancements
39
+
40
+ * Make selenium process management code more robust and informative
41
+
42
+ * Minor enhancements
43
+
44
+ * Add support for Rails javascript post links (Mark Menard)
45
+ * Upgrade selenium-client dependency to 1.2.14, and update for new waiting
46
+ API (Balint Erdi)
47
+ * Change default app environment from "selenium" to "test"
48
+
49
+ * Bug fixes
50
+
51
+ * Don't create a new instance of WWW::Mechanize for each request
52
+ (Mark Menard)
53
+ * Select fields with duplicate selected options sent an incorrect value (Noah Davis)
54
+
55
+ == 0.4.3 / 2009-03-17
56
+
57
+ * Minor enhancements
58
+
59
+ * Support Rails 2.3. Use Rack::Utils to parse params (Matthew Ford)
60
+ * Support for "modular" Sinatra app style (Simon Rozet)
61
+ * Initial Merb and Sinatra compatibility for Selenium mode (Corey Donohoe)
62
+ * When faced with a label with no for attribute, that contains a hidden field
63
+ and another field, as can be the case in Rails 2.3's checkbox view,
64
+ webrat now locates the non-hidden field. (Luke Melia)
65
+ * Add application_framework config for Selenium mode to determine how to
66
+ start and stop the app server (Corey Donohoe)
67
+
68
+ * Bug fixes
69
+
70
+ * Fix following of absolute redirect URL in Sinatra (Simon Rozet)
71
+
72
+ == 0.4.2 / 2009-02-24
73
+
74
+ * Major enhancements
75
+
76
+ * Significant improvements to have_selector. It now supports specifying
77
+ attributes in a hash and :count and :content options. See
78
+ have_selector_spec.rb for more.
79
+ * Add the same functionality mentioned above to have_xpath
80
+
81
+ * Minor enhancements
82
+
83
+ * Squeeze extra whitespace out of failures messages from contain
84
+ matcher
85
+ * Detect infinite redirects and raise a Webrat::InfiniteRedirectError
86
+ (Daniel Lucraft)
87
+
88
+ * Bug fixes
89
+
90
+ * Properly quote single and double quotes strings in XPath
91
+ * Fix warning caused by Nokogiri deprecating CSS::Parser.parse
92
+ (Aaron Patterson)
93
+ * Accept do/end blocks in matchers. [#157] (Peter Jaros)
94
+ * Quote --chdir option to mongrel_rails to support RAILS_ROOTs with spaces
95
+ (T.J. VanSlyke)
96
+
97
+ == 0.4.1 / 2009-01-31
98
+
99
+ * Minor enhancements
100
+
101
+ * Support Sinatra 0.9 (Harry Vangberg)
102
+ * Update query param parsing to work with latest Edge Rails
103
+ * Added #redirected_to method to easily check where an external redirect was
104
+ redirected to (Adam Greene)
105
+ * Recognize input tags with type button (Lena Herrmann)
106
+ * Add uncheck method to Selenium mode (Lee Bankewitz)
107
+
108
+ * Bug fixes
109
+
110
+ * Make requests to a Rails app using a full URL instead of a relative path. This change
111
+ is helpful for Rails apps that use subdomains. (John Hwang and Zach Dennis)
112
+ * Follow redirects that are on the same domain but a different subdomain
113
+ (Adam Greene)
114
+ * rescue from Webrat::TimeoutError in selenium matchers which allows NegativeMatchers
115
+ to behave correctly (Noah Davis)
116
+ * Switch to using selenium.click instead of .check when checking a checkbox
117
+ (Noah Davis)
118
+ * Create tmp/pids directory if directory does not exist. (Amos King and Mike Gaffney)
119
+ * Setup deprecated writers for the selenium_environment= and selenium_port= config
120
+ * Ensure the previous pages params aren't passed through redirect (Daniel Lucraft and
121
+ Bryan Helmkamp)
122
+ * Labels should only search for fields within the current scope (Kyle Hargraves)
123
+
124
+ == 0.4.0 / 2009-01-18
125
+
126
+ * _IMPORTANT_ Breaking change:
127
+
128
+ * Removed init.rb auto-require of webrat/rails
129
+ * Removed auto-require of webrat/rails when requiring webrat when RAILS_ENV is
130
+ defined
131
+
132
+ In your env.rb or test_helper.rb file, ensure you have something like:
133
+
134
+ require "webrat"
135
+
136
+ Webrat.configure do |config|
137
+ config.mode = :rails
138
+ end
139
+
140
+ * Major enhancements
141
+
142
+ * Major improvements to Webrat::Selenium (Many contributors listed here)
143
+ * Add assert_* methods for using Webrat's matchers w/o RSpec (Mike Gaffney, Amos King)
144
+ * Added Webrat.configure method for Webrat configuration [#33] (Mike Gaffney)
145
+ * Added select_time, select_date, and select_datetime to API. [#36] (Ben Mabey)
146
+ * Use Hpricot and REXML when not parsing with Nokogiri (on JRuby, for example)
147
+
148
+ * Minor enhancements
149
+
150
+ * Added Selenium grid configuration and support. (Amos King && Cornel Borcean)
151
+ * Support passing an ActiveRecord model to #within when in Rails mode [#68] (Luke Melia)
152
+ * Make assert_* matchers in rails mode increment the assertions count [#123] (Amos King)
153
+ * Added assert_* matchers to selenium matchers [#110] (Amos King)
154
+ * Added assert_contain, assert_not_contain [#86] (Mike Gaffney, Amos King)
155
+ * Add configuration options for the Selenium environment and port (Kieran Pilkington)
156
+ * Maximize the browser window after initializing Selenium (Luke Melia)
157
+ * Better inspect output for Webrat elements
158
+ * Sets the Webrat mode with Configuration#mode= in the config block [#85] (Mike Gaffney)
159
+ * Detect if the document is XML or HTML using the Content-Type when in Rails mode
160
+ * Expose #selenium method for direct access to Selenium client
161
+ * Check nokogiri gem version before requiring nokogiri
162
+ * Include the Selenium server jar file in the gem (Bryan Helmkamp, Ben Schwarz)
163
+ * Added key_down, key_up and fire_event to Selenium session (Fernando Garcia)
164
+ * Fix outputing README during Rails plugin install (Fernando Garcia)
165
+ * Strip newlines when matching label text (Miha Filej)
166
+ * Add simple support for accessing Webrat's matchers from RSpec by requiring
167
+ "webrat/rspec-rails" (David Chelimsky)
168
+ * Support save_and_open_page in Windows and Cygwin (Mike Gaffney)
169
+ * Added RadioField#checked? to indicated whether or not a radio button is checked
170
+ (Luke Melia)
171
+ * Add spec:jruby rake task for running Webrat's spec suite with JRuby
172
+ * Added field_by_xpath to locate a Webrat::Field using arbitrary XPath expressions
173
+ * Helpful error message for missing option values [#40] (Ben Mabey)
174
+ * Add set_hidden_field method (Noah Davis, Bryan Helmkamp)
175
+ * Add submit_form method for submitting a form by ID (Noah Davis, Bryan Helmkamp)
176
+ * Switch to using Nokogiri.parse for simple XML/XHTML autodetection [#66]
177
+ * Removed Webrat.root method, which seemed to be unused
178
+ * Added automatic starting and stopping of the Selenium server and a Mongrel Rails
179
+ app server when using webrat/selenium
180
+ * Switch to using selenium-client gem and vendor selenium-server.jar (Luke Melia)
181
+ * Added gemspec so the gem builds on GitHub now
182
+ * Deprecate old style methods (fills_in is deprecated in favor of fill_in, etc.)
183
+ * Improvements to the README and RDoc (Bryan Helmkamp, Mike Gaffney)
184
+ * Allow clicking links by id and id regexp (Mike Gaffney)
185
+ * Raise Webrat::DisabledFieldError when attempting to manipulate a disabled field
186
+ * Raise Webrat::NotFoundErrors when an element is not found
187
+ * Raise Webrat::PageLoadError when a failure occurs so that application exceptions
188
+ can be more accurately tested (Ryan Briones)
189
+ * Helpful error message for missing option in select box. [#40] (Ben Mabey)
190
+ * Extracted save_and_open page to make it usable in Selenium mode (Luke Melia)
191
+ * Added save_and_open_screengrab for Selenium mode (Luke Melia)
192
+
193
+ * Bug fixes
194
+
195
+ * field_labeled should disregard labels without matching fields (Kyle Hargraves)
196
+ * Fixed bug where Scope was creating a new DOM rather than re-using the existing DOM.
197
+ [#105] (Zach Dennis)
198
+ * Support Rails > v2.2 by using ActionController::RequestParser for param parsing [#107]
199
+ (Marcello Nuccio)
200
+ * Raise a Webrat::NotFoundError if the scope passed to #within doesn't exist [#90]
201
+ * Match against link _text_ which decodes character references.
202
+ Useful for multibyte languages like Japanese (moronatural@gmail.com)
203
+ * Fix params hash generation for Mechanize when Merb is not defined [#62]
204
+ * Expose some Webrat methods that were missing from the Webrat::Methods module
205
+ (Low Chin Chau)
206
+ * Allow mechanize session to pass through basic auth (Ryan Briones)
207
+ * Improvements to the Mechanize support (Jeremy Burks)
208
+ * Fix following fully qualified local links (Lawrence Pit)
209
+ * Fixed bug where Webrat would lose complex parameters (like foo[bar[baz]][])
210
+ in Merb due to not correctly merging Mashes. (Drew Colthorp)
211
+ * Extend Rails' ActionController::IntegrationTest instead of
212
+ ActionController::Integration::Session (Fixes using Webrat's #select method and
213
+ avoids usage of method_missing)
214
+ * Ensure that Webrat::MechanizeSession.request_page always uses an absolute
215
+ URL. (Graham Ashton)
216
+ * Strip anchor tags from URIs before passing to Rails integration session
217
+ (Noah Davis)
218
+ * Treat text and regexp when matching Selenium buttons (Ross Kaffenberger)
219
+ * Allow SeleniumSession's click_button to be called without an argument without
220
+ blowing up (Luke Melia)
221
+
222
+ == 0.3.4 / 2008-12-29
223
+
224
+ * 1 Minor enhancement
225
+
226
+ * Fix compatibility with Nokogiri 1.1.0 on JRuby
227
+
228
+ * 1 Bug fix
229
+
230
+ * Correct version for Nokogiri dependency in gem
231
+
232
+ == 0.3.3 / 2008-12-28
233
+
234
+ * 1 Minor enhancement
235
+
236
+ * Fix compatibility with Nokogiri 1.1.0 on MRI
237
+
238
+ == 0.3.2 / 2008-11-08
239
+
240
+ * 1 Minor enhancement
241
+
242
+ * Fixes behavior or have_tag when a block is passed. It passes the matched node(s)
243
+ to the block for further specs again. (Carl Lerche)
244
+
245
+ == 0.3.1 / 2008-11-07
246
+
247
+ * 1 Minor enhancement
248
+
249
+ * Use @_webrat_session instance variable instead of @session for Merb integration
250
+ to avoid collisions
251
+
252
+ == 0.3.0 / 2008-11-07
253
+
254
+ * 4 Major enhancements
255
+
256
+ * Added Merb support (Gwyn Morfey, Jeremy Burks, Rob Kaufman, Yehuda Katz)
257
+ * Added experimental Selenium support (Luke Melia)
258
+ * Add have_selector, have_xpath, have_tag and contain matchers from Merb
259
+ * Switch from Hpricot to Nokogiri for XML parsing (thanks, Aaron Patterson)
260
+
261
+ * 37 Minor enhancements
262
+
263
+ * Added #within for manipulating the current page within a selector scope
264
+ * Add support for file fields via #attaches_file method (Rails only at the moment)
265
+ (Kyle Hargraves)
266
+ * Add support for simulating SSL requests (Luke Melia)
267
+ * Added #basic_auth(user, pass) to support HTTP Basic Auth (Aslak Hellesøy)
268
+ * Added support for Sinatra and Rack (Aslak Hellesøy)
269
+ * Rename visits to visit, fills_in to fill_in, etc.
270
+ * Add #field_labeled for looking up form fields by label (David Chelimsky)
271
+ * Add #field_named and #field_with_id locators
272
+ * Don't depend on hoe anymore
273
+ * Return responses after sending requests
274
+ * Allow clicking links and buttons by a regular expression in Selenium (Luke Melia)
275
+ * Allow clicking links by a regular expression
276
+ * Add #http_accept for including MIME type HTTP "Accept" headers (Ryan Briones)
277
+ * Add #header to support inclusion of custom HTTP headers (Ryan Briones)
278
+ * Consider response codes 200-499 as successful enough to not raise a Webrat error
279
+ (David Leal)
280
+ * Add support for clicking areas of an image map (Alex Lang)
281
+ * Support relative links, including href="?foo=bar" (Kyle Hargraves)
282
+ * Separated Rails-specific code from the Webrat core to make it easier to use
283
+ Webrat with other environments
284
+ * Alias visits as visit, clicks_link as click_link, etc. for better readability
285
+ * Raise error when trying to interact with a disabled form element (Luke Melia)
286
+ * Don't send disabled form elements to the server (Nicholas A. Evans)
287
+ * Display response body when the page load is not successful (David Leal)
288
+ * CGI escape form field values (Miha Filej)
289
+ * Add support for redirect_to :back by sending HTTP_REFERER headers
290
+ (Hendrik Volkmer)
291
+ * Expose current DOM (as an Hpricot object) as #current_dom
292
+ * Add support for disabling JavaScript when clicking a link to enable testing of
293
+ both JS and non-JS implementations (Luke Melia and Bryan Helmkamp)
294
+ * Support &nbsp's as spaces in matching link text (Luke Melia)
295
+ * Support button elements (Nick Sieger)
296
+ * Support matching select options by regexp (Kyle Hargraves)
297
+ * save_and_open_page rewrites css and image references to provide a friendlier
298
+ debugging experience (Luke Melia)
299
+ * Added support for matching alt attributes in fields (primarly for clicks_button)
300
+ (Aaron Quint)
301
+ * Support '&' in submitted values (Kyle Hargraves)
302
+ * Support clicking links by title (Dan Barry)
303
+ * Added missing spec for clicking image buttons (Tim Harper)
304
+ * Switched tests to specs, and from Mocha to RSpec's mocking library
305
+ * Add support to click_button for IDs (Gwyn Morfey)
306
+ * Miscellaneous core refactorings (Jan Suchal)
307
+
308
+ * 8 Bug fixes
309
+
310
+ * Fix initialization of WWW::Mechanize (Derek Kastner)
311
+ * Don't open blank pages in the browser (Kyle Hargraves)
312
+ * Support radio buttons with multiple labels (Dan Barry)
313
+ * Fix load order bug on some platforms (Ismael Celis)
314
+ * Fix bug with empty select list option (Kyle Hargraves)
315
+ * Fix regression of not sending default values in password fields
316
+ * Don't explode if encountering inputs with no type attribute (assume text)
317
+ * Fix bug where choosing a radio button in a series with a default submitted the
318
+ incorrect field value (Luke Melia)
319
+
320
+ == 0.2.0 / 2008-04-04
321
+
322
+ * 4 Major enhancements
323
+
324
+ * Add save_and_open_page to aid in debugging
325
+ * Add radio button support via #chooses method
326
+ * Add basic support for Rails-generated JavaScript link tags
327
+ * Add support for checkboxes (Patches from Kyle Hargraves and Jarkko Laine)
328
+ * Add support for textarea fields (Sacha Schlegel)
329
+
330
+ * 8 Minor enhancements
331
+
332
+ * Added reloads method to reload the page (Kamal Fariz Mahyuddi)
333
+ * Prevent making a request if clicking on local anchor link (Kamal Fariz Mahyuddi)
334
+ * Added clicks_link_within(selector, link_text), allowing restricting link search
335
+ to within a given css selector (Luke Melia)
336
+ * Allow specifying the input name/label when doing a select (David Chelimsky)
337
+ * Raise a specific exception if the developer tries to manipulate form elements
338
+ before loading a page (James Deville)
339
+ * Add support for alternate POST, PUT and DELETE link clicking (Kyle Hargraves)
340
+ * Change clicks_link to find the shortest matching link (Luke Melia)
341
+ * Improve matching for labels in potentially ambiguous cases
342
+
343
+ * 7 Bug fixes
344
+
345
+ * Fix incorrect serializing of collection inputs, i.e. name contains []
346
+ (Kamal Fariz Mahyuddi)
347
+ * Serialize empty text field values just like browsers (Kamal Fariz Mahyuddi)
348
+ * Quick fix to avoid @dom not initialized warnings (Kamal Fariz Mahyuddi)
349
+ * Docfix: bad reference to #select method in README (Luke Melia)
350
+ * Ensure Rails-style checkboxes work properly (checkboxes followed by a hidden
351
+ input with the same name)
352
+ * Fix Edge Rails (a.k.a. 2.0 RC) compatibility (David Chelimsky)
353
+ * Support param hashes nested more than one level (David Chelimsky)
354
+
355
+ == 0.1.0 / 2007-11-28
356
+
357
+ * 1 major enhancement
358
+
359
+ * Birthday!
360
+
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2007 Bryan Helmkamp, Seth Fitzsimmons
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -0,0 +1,85 @@
1
+ = Webrat - Ruby Acceptance Testing for Web applications
2
+
3
+ - http://gitrdoc.com/brynary/webrat
4
+ - http://groups.google.com/group/webrat
5
+ - http://webrat.lighthouseapp.com/
6
+ - http://github.com/brynary/webrat
7
+ - #webrat on Freenode
8
+
9
+ == Description
10
+
11
+ Webrat lets you quickly write expressive and robust acceptance tests for a Ruby
12
+ web application.
13
+
14
+ == Features
15
+
16
+ * Browser Simulator for expressive, high level acceptance testing without the
17
+ performance hit and browser dependency of Selenium or Watir (See Webrat::Session)
18
+ * Use the same API for Browser Simulator and real Selenium tests using
19
+ Webrat::Selenium when necessary (eg. for testing AJAX interactions)
20
+ * Supports multiple Ruby web frameworks: Rails, Merb and Sinatra
21
+ * Supports popular test frameworks: RSpec, Cucumber, Test::Unit and Shoulda
22
+ * Webrat::Matchers API for verifying rendered HTML using CSS, XPath, etc.
23
+
24
+ == Example
25
+
26
+ class SignupTest < ActionController::IntegrationTest
27
+
28
+ def test_trial_account_sign_up
29
+ visit home_path
30
+ click_link "Sign up"
31
+ fill_in "Email", :with => "good@example.com"
32
+ select "Free account"
33
+ click_button "Register"
34
+ end
35
+
36
+ end
37
+
38
+ Behind the scenes, Webrat will ensure:
39
+
40
+ * If a link, form field or button is missing, the test will fail.
41
+ * If a URL is invalid, the test will fail.
42
+ * If a page load or form submission is unsuccessful, the test will fail.
43
+
44
+ == Installing Nokogiri
45
+
46
+ Users of Debian Linux (e.g. Ubuntu) need to run:
47
+
48
+ sudo apt-get install libxslt1-dev libxml2-dev.
49
+
50
+ Otherwise the Nokogiri gem, which Webrat depends on, won't install properly.
51
+
52
+ == Install for Rails
53
+
54
+ To install the latest release as a gem:
55
+
56
+ sudo gem install webrat
57
+
58
+ To install the latest code as a plugin: (_Note:_ This may be less stable than using a released version)
59
+
60
+ script/plugin install git://github.com/brynary/webrat.git
61
+
62
+ In your test_helper.rb or env.rb (for Cucumber) add:
63
+
64
+ require "webrat"
65
+
66
+ Webrat.configure do |config|
67
+ config.mode = :rails
68
+ end
69
+
70
+ == Install with Merb
71
+
72
+ Merb 1.0 has built-in, seamless Webrat support. Just start using
73
+ methods from Webrat::Session in your specs.
74
+
75
+ == Authors
76
+
77
+ - Maintained by {Bryan Helmkamp}[mailto:bryan@brynary.com]
78
+ - Original code written by {Seth Fitzsimmons}[mailto:seth@mojodna.net]
79
+ - Initial development was sponsored by EastMedia[http://www.eastmedia.com]
80
+ - Many other contributors. See attributions in History.txt
81
+
82
+ == License
83
+
84
+ Copyright (c) 2007-2008 Bryan Helmkamp, Seth Fitzsimmons.
85
+ See MIT-LICENSE.txt in this directory.
@@ -0,0 +1,200 @@
1
+ # require 'rubygems'
2
+ require "rake/gempackagetask"
3
+ require 'rake/rdoctask'
4
+ require "rake/clean"
5
+ gem "rspec"
6
+ require 'spec'
7
+ require 'spec/rake/spectask'
8
+ require 'spec/rake/verify_rcov'
9
+ require File.expand_path('./lib/webrat.rb')
10
+
11
+ ##############################################################################
12
+ # Package && release
13
+ ##############################################################################
14
+ spec = Gem::Specification.new do |s|
15
+ s.name = "webrat"
16
+ s.version = Webrat::VERSION
17
+ s.platform = Gem::Platform::RUBY
18
+ s.author = "Bryan Helmkamp"
19
+ s.email = "bryan" + "@" + "brynary.com"
20
+ s.homepage = "http://github.com/brynary/webrat"
21
+ s.summary = "Webrat. Ruby Acceptance Testing for Web applications"
22
+ s.bindir = "bin"
23
+ s.description = s.summary
24
+ s.require_path = "lib"
25
+ s.files = %w(History.txt install.rb MIT-LICENSE.txt README.rdoc Rakefile) + Dir["lib/**/*"] + Dir["vendor/**/*"]
26
+
27
+ # rdoc
28
+ s.has_rdoc = true
29
+ s.extra_rdoc_files = %w(README.rdoc MIT-LICENSE.txt)
30
+
31
+ # Dependencies
32
+ s.add_dependency "nokogiri", ">= 1.2.0"
33
+
34
+ s.rubyforge_project = "webrat"
35
+ end
36
+
37
+ Rake::GemPackageTask.new(spec) do |package|
38
+ package.gem_spec = spec
39
+ end
40
+
41
+ desc 'Show information about the gem.'
42
+ task :debug_gem do
43
+ puts spec.to_ruby
44
+ end
45
+
46
+ CLEAN.include ["pkg", "*.gem", "doc", "ri", "coverage"]
47
+
48
+ desc "Upload rdoc to brynary.com"
49
+ task :publish_rdoc => :docs do
50
+ sh "scp -r doc/ brynary.com:/apps/uploads/webrat"
51
+ end
52
+
53
+ desc "Run API and Core specs"
54
+ Spec::Rake::SpecTask.new do |t|
55
+ t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
56
+ t.spec_files = FileList['spec/public/**/*_spec.rb'] + FileList['spec/private/**/*_spec.rb']
57
+ end
58
+
59
+ desc "Run all specs in spec directory with RCov"
60
+ Spec::Rake::SpecTask.new(:rcov) do |t|
61
+ t.spec_opts = ['--options', "\"#{File.dirname(__FILE__)}/spec/spec.opts\""]
62
+ t.spec_files = FileList['spec/public/**/*_spec.rb'] + FileList['spec/private/**/*_spec.rb']
63
+ t.rcov = true
64
+ t.rcov_opts = lambda do
65
+ IO.readlines(File.dirname(__FILE__) + "/spec/rcov.opts").map {|l| l.chomp.split " "}.flatten
66
+ end
67
+ end
68
+
69
+ RCov::VerifyTask.new(:verify_rcov => :rcov) do |t|
70
+ t.threshold = 96.2 # Make sure you have rcov 0.7 or higher!
71
+ end
72
+
73
+ desc 'Install the package as a gem.'
74
+ task :install_gem => [:clean, :package] do
75
+ gem_filename = Dir['pkg/*.gem'].first
76
+ sh "sudo gem install --no-rdoc --no-ri --local #{gem_filename}"
77
+ end
78
+
79
+ desc "Delete generated RDoc"
80
+ task :clobber_docs do
81
+ FileUtils.rm_rf("doc")
82
+ end
83
+
84
+ desc "Generate RDoc"
85
+ task :docs => :clobber_docs do
86
+ system "hanna --title 'Webrat #{Webrat::VERSION} API Documentation'"
87
+ end
88
+
89
+ desc "Run everything against multiruby"
90
+ task :multiruby do
91
+ result = system "multiruby -S rake spec"
92
+ raise "Multiruby tests failed" unless result
93
+ result = system "jruby -S rake spec"
94
+ raise "JRuby tests failed" unless result
95
+
96
+ Dir.chdir "spec/integration/rails" do
97
+ result = system "multiruby -S rake test_unit:rails"
98
+ raise "Rails integration tests failed" unless result
99
+
100
+ result = system "jruby -S rake test_unit:rails"
101
+ raise "Rails integration tests failed" unless result
102
+ end
103
+
104
+ Dir.chdir "spec/integration/merb" do
105
+ result = system "multiruby -S rake spec"
106
+ raise "Merb integration tests failed" unless result
107
+
108
+ result = system "jruby -S rake spec"
109
+ raise "Rails integration tests failed" unless result
110
+ end
111
+
112
+ Dir.chdir "spec/integration/sinatra" do
113
+ result = system "multiruby -S rake test"
114
+ raise "Sinatra integration tests failed" unless result
115
+
116
+ result = system "jruby -S rake test"
117
+ raise "Sinatra integration tests failed" unless result
118
+ end
119
+
120
+ Dir.chdir "spec/integration/rack" do
121
+ result = system "multiruby -S rake test"
122
+ raise "Rack integration tests failed" unless result
123
+
124
+ result = system "jruby -S rake test"
125
+ raise "Rack integration tests failed" unless result
126
+ end
127
+
128
+ puts
129
+ puts "Multiruby OK!"
130
+ end
131
+
132
+ desc "Run each spec in isolation to test for dependency issues"
133
+ task :spec_deps do
134
+ Dir["spec/**/*_spec.rb"].each do |test|
135
+ if !system("spec #{test} &> /dev/null")
136
+ puts "Dependency Issues: #{test}"
137
+ end
138
+ end
139
+ end
140
+
141
+ task :prepare do
142
+ system "ln -s ../../../../.. ./spec/integration/rails/vendor/plugins/webrat"
143
+ end
144
+
145
+ namespace :spec do
146
+ desc "Run the integration specs"
147
+ task :integration => ["integration:rails", "integration:merb", "integration:sinatra", "integration:rack"]
148
+
149
+ namespace :integration do
150
+ desc "Run the Rails integration specs"
151
+ task :rails => ['rails:webrat'] #,'rails:selenium'] currently not running selenium as it doesn't pass.
152
+
153
+ namespace :rails do
154
+ task :selenium do
155
+ Dir.chdir "spec/integration/rails" do
156
+ result = system "rake test_unit:selenium"
157
+ raise "Rails integration tests failed" unless result
158
+ end
159
+ end
160
+
161
+ task :webrat do
162
+ Dir.chdir "spec/integration/rails" do
163
+ result = system "rake test_unit:rails"
164
+ raise "Rails integration tests failed" unless result
165
+ end
166
+ end
167
+ end
168
+
169
+ desc "Run the Merb integration specs"
170
+ task :merb do
171
+ Dir.chdir "spec/integration/merb" do
172
+ result = system "rake spec"
173
+ raise "Merb integration tests failed" unless result
174
+ end
175
+ end
176
+
177
+ desc "Run the Sinatra integration specs"
178
+ task :sinatra do
179
+ Dir.chdir "spec/integration/sinatra" do
180
+ result = system "rake test"
181
+ raise "Sinatra integration tests failed" unless result
182
+ end
183
+ end
184
+
185
+ desc "Run the Sinatra integration specs"
186
+ task :rack do
187
+ Dir.chdir "spec/integration/rack" do
188
+ result = system "rake test"
189
+ raise "Rack integration tests failed" unless result
190
+ end
191
+ end
192
+ end
193
+ end
194
+
195
+ task :default => :spec
196
+
197
+ desc 'Removes trailing whitespace'
198
+ task :whitespace do
199
+ sh %{find . -name '*.rb' -exec sed -i '' 's/ *$//g' {} \\;}
200
+ end
@@ -0,0 +1 @@
1
+ puts IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
metadata ADDED
@@ -0,0 +1,67 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: qoobaa-webrat
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.4.5
5
+ platform: ruby
6
+ authors:
7
+ - Bryan Helmkamp
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-05-16 00:00:00 -07:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: nokogiri
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.2.0
24
+ version:
25
+ description: Webrat. Ruby Acceptance Testing for Web applications
26
+ email: bryan@brynary.com
27
+ executables: []
28
+
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - README.rdoc
33
+ - MIT-LICENSE.txt
34
+ files:
35
+ - History.txt
36
+ - install.rb
37
+ - MIT-LICENSE.txt
38
+ - README.rdoc
39
+ - Rakefile
40
+ has_rdoc: true
41
+ homepage: http://github.com/brynary/webrat
42
+ post_install_message:
43
+ rdoc_options: []
44
+
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: "0"
52
+ version:
53
+ required_rubygems_version: !ruby/object:Gem::Requirement
54
+ requirements:
55
+ - - ">="
56
+ - !ruby/object:Gem::Version
57
+ version: "0"
58
+ version:
59
+ requirements: []
60
+
61
+ rubyforge_project: webrat
62
+ rubygems_version: 1.2.0
63
+ signing_key:
64
+ specification_version: 2
65
+ summary: Webrat. Ruby Acceptance Testing for Web applications
66
+ test_files: []
67
+