polonium 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -26,7 +26,7 @@ def run_suite
26
26
  end
27
27
 
28
28
  PKG_NAME = "polonium"
29
- PKG_VERSION = "0.2.2"
29
+ PKG_VERSION = "0.3.0"
30
30
  PKG_FILES = FileList[
31
31
  '[A-Z]*',
32
32
  '*.rb',
@@ -52,8 +52,9 @@ spec = Gem::Specification.new do |s|
52
52
  s.require_path = 'lib'
53
53
  s.author = "Pivotal Labs"
54
54
  s.email = "opensource@pivotallabs.com"
55
- s.homepage = "http://pivotallabs.com"
55
+ s.homepage = "http://pivotalrb.rubyforge.org"
56
56
  s.rubyforge_project = "pivotalrb"
57
+ s.add_dependency "Selenium", ">=1.1.14"
57
58
  end
58
59
 
59
60
  Rake::GemPackageTask.new(spec) do |pkg|
@@ -62,7 +63,5 @@ Rake::GemPackageTask.new(spec) do |pkg|
62
63
  end
63
64
 
64
65
  def tag_release
65
- dashed_version = PKG_VERSION.gsub('.', '-')
66
- svn_user_prefix = "#{ENV['SVN_USER']}@" if ENV['SVN_USER']
67
- `svn cp svn+ssh://#{svn_user_prefix}rubyforge.org/var/svn/pivotalrb/polonium/trunk svn+ssh://#{svn_user_prefix}rubyforge.org/var/svn/pivotalrb/polonium/tags/REL-#{dashed_version} -m 'Version #{PKG_VERSION}'`
66
+ raise 'make this work for Git'
68
67
  end
@@ -13,6 +13,7 @@ require 'test/unit/ui/testrunnermediator'
13
13
 
14
14
  require "selenium"
15
15
  require "polonium/extensions/module"
16
+ require "polonium/polonium_error"
16
17
  require "polonium/wait_for"
17
18
  require "polonium/driver"
18
19
  require "polonium/server_runners/server_runner"
@@ -1,25 +1,36 @@
1
- class Spec::Runner::Options
2
- def stop_selenium(success)
3
- Polonium::Configuration.instance.app_server_runner.stop
4
- Polonium::Configuration.instance.stop_driver_if_necessary(success)
5
- success
1
+ module Polonium::Adapters
2
+ class Rspec
3
+ class << self
4
+ def stop_selenium(success)
5
+ configuration.app_server_runner.stop if configuration.app_server_runner
6
+ configuration.stop_driver_if_necessary(success)
7
+ success
8
+ end
9
+
10
+ protected
11
+ def configuration
12
+ Polonium::Configuration.instance
13
+ end
14
+ end
6
15
  end
16
+ end
7
17
 
18
+ class Spec::Runner::Options
8
19
  if instance_methods.include?('after_suite_parts')
9
20
  Spec::Example::ExampleGroup.after(:suite) do |success|
10
- rspec_options.stop_selenium success
21
+ Polonium::Adapters::Rspec.stop_selenium success
11
22
  end
12
23
  else
13
24
  def run_examples_with_selenium_runner(*args)
14
25
  success = run_examples_without_selenium_runner(*args)
15
- stop_selenium success
26
+ Polonium::Adapters::Rspec.stop_selenium success
16
27
  success
17
28
  end
18
29
  alias_method_chain :run_examples, :selenium_runner
19
30
  end
20
31
  end
21
32
 
22
- Spec::Example::ExampleMethods.before(:all) do
33
+ Spec::Runner.configuration.before do
23
34
  unless Polonium::Configuration.instance.app_server_runner
24
35
  app_server_runner = Polonium::Configuration.instance.create_app_server_runner
25
36
  app_server_runner.start
@@ -35,12 +35,12 @@ module Polonium
35
35
  @instance.env = ENV
36
36
 
37
37
  @instance.browser = FIREFOX
38
- @instance.selenium_server_host = "localhost" # address of selenium RC server (java)
38
+ @instance.selenium_server_host = '127.0.0.1' # address of selenium RC server (java)
39
39
  @instance.selenium_server_port = 4444
40
40
  @instance.app_server_engine = :webrick
41
41
  @instance.internal_app_server_host = "0.0.0.0" # internal address of app server (webrick or mongrel)
42
42
  @instance.internal_app_server_port = 4000
43
- @instance.external_app_server_host = "localhost" # external address of app server (webrick or mongrel)
43
+ @instance.external_app_server_host = '127.0.0.1' # external address of app server (webrick or mongrel)
44
44
  @instance.external_app_server_port = 4000
45
45
  @instance.server_engine = :webrick
46
46
  @instance.keep_browser_open_on_failure = false
@@ -6,7 +6,7 @@ module Polonium
6
6
  # The Configuration object.
7
7
  def configuration
8
8
  Configuration.instance
9
- end
9
+ end
10
10
 
11
11
  def browser_start_command
12
12
  @browserStartCommand
@@ -120,6 +120,23 @@ module Polonium
120
120
  end
121
121
  end
122
122
 
123
+ def assert_location_ends_with(ends_with, options={})
124
+ options = {
125
+ :message => "Expected '#{get_location}' to end with '#{ends_with}'"
126
+ }.merge(options)
127
+ wait_for(options) do
128
+ location_ends_with? ends_with
129
+ end
130
+ end
131
+
132
+ def location_ends_with?(ends_with)
133
+ if get_location =~ Regexp.new("#{Regexp.escape(ends_with)}$")
134
+ true
135
+ else
136
+ false
137
+ end
138
+ end
139
+
123
140
  def wait_for_page_to_load(timeout=default_timeout)
124
141
  super
125
142
  if get_title.include?("Exception caught")
@@ -26,7 +26,7 @@ module Polonium
26
26
  page_assertion :text_present
27
27
  page_assertion :text_not_present
28
28
  page_assertion :location_ends_with
29
- deprecate :assert_location_ends_in, :assert_location_ends_with
29
+ polonium_deprecate :assert_location_ends_in, :assert_location_ends_with
30
30
 
31
31
  element_assertion :value
32
32
  element_assertion :selected
@@ -54,7 +54,7 @@ module Polonium
54
54
  def assert_element_does_not_contain(locator, text, options={})
55
55
  element(locator).assert_does_not_contain(text, options)
56
56
  end
57
- deprecate :assert_element_does_not_contain_text, :assert_element_does_not_contain
57
+ polonium_deprecate :assert_element_does_not_contain_text, :assert_element_does_not_contain
58
58
 
59
59
  # Does the element at locator contain the text?
60
60
  def element_contains_text(locator, text)
@@ -1,5 +1,5 @@
1
1
  class Module
2
- def deprecate(old_method_name, new_method_name)
2
+ def polonium_deprecate(old_method_name, new_method_name)
3
3
  define_method old_method_name do |*args|
4
4
  warn "#{old_method_name} is deprecated. Use #{new_method_name} instead."
5
5
  __send__(new_method_name, *args)
@@ -73,20 +73,12 @@ module Polonium
73
73
  driver.get_eval(PAGE_LOADED_COMMAND) == true.to_s
74
74
  end
75
75
 
76
- def assert_location_ends_with(ends_with, options ={})
77
- options = {
78
- :message => "Expected '#{driver.get_location}' to end with '#{ends_with}'"
79
- }.merge(options)
80
- wait_for(options) do
81
- location_ends_with? ends_with
82
- end
76
+ def assert_location_ends_with(ends_with, options={})
77
+ driver.assert_location_ends_with(ends_with, options)
83
78
  end
79
+
84
80
  def location_ends_with?(ends_with)
85
- if driver.get_location =~ Regexp.new("#{Regexp.escape(ends_with)}$")
86
- true
87
- else
88
- false
89
- end
81
+ driver.location_ends_with?(ends_with)
90
82
  end
91
83
 
92
84
  def ==(other)
@@ -0,0 +1,4 @@
1
+ module Polonium
2
+ class PoloniumError < RuntimeError
3
+ end
4
+ end
@@ -37,7 +37,7 @@ module Polonium
37
37
  attr_writer :default_timeout
38
38
 
39
39
  def flunk(message)
40
- raise Test::Unit::AssertionFailedError, message
40
+ raise Polonium::PoloniumError, message
41
41
  end
42
42
  end
43
43
  end
@@ -183,7 +183,7 @@ module Polonium
183
183
  end
184
184
 
185
185
  it "external_app_server_host" do
186
- should_lazily_load configuration, :external_app_server_host, "localhost"
186
+ should_lazily_load configuration, :external_app_server_host, '127.0.0.1'
187
187
  end
188
188
 
189
189
  it "external_app_server_port" do
@@ -76,7 +76,7 @@ module Polonium
76
76
 
77
77
  proc {
78
78
  driver.type "id=foobar", "The Text"
79
- }.should raise_error(Test::Unit::AssertionFailedError)
79
+ }.should raise_error(PoloniumError)
80
80
  end
81
81
  end
82
82
 
@@ -100,7 +100,7 @@ module Polonium
100
100
 
101
101
  proc {
102
102
  driver.click "id=foobar"
103
- }.should raise_error(Test::Unit::AssertionFailedError)
103
+ }.should raise_error(PoloniumError)
104
104
  end
105
105
  end
106
106
 
@@ -123,7 +123,7 @@ module Polonium
123
123
 
124
124
  proc {
125
125
  driver.select "id=foobar", "value=3"
126
- }.should raise_error(Test::Unit::AssertionFailedError)
126
+ }.should raise_error(PoloniumError)
127
127
  end
128
128
  end
129
129
 
@@ -147,7 +147,7 @@ module Polonium
147
147
 
148
148
  proc {
149
149
  driver.click "id=foobar"
150
- }.should raise_error(Test::Unit::AssertionFailedError)
150
+ }.should raise_error(PoloniumError)
151
151
  end
152
152
  end
153
153
  end
@@ -125,14 +125,14 @@ module Polonium
125
125
  stub(driver).get_value(element_locator) {"jane"}
126
126
  proc do
127
127
  element.assert_value("joe")
128
- end.should raise_error(Test::Unit::AssertionFailedError)
128
+ end.should raise_error(PoloniumError)
129
129
  end
130
130
 
131
131
  it "fails when element is not present" do
132
132
  stub(driver).is_element_present(element_locator) {false}
133
133
  proc do
134
134
  element.assert_value("joe")
135
- end.should raise_error(Test::Unit::AssertionFailedError)
135
+ end.should raise_error(PoloniumError)
136
136
  end
137
137
  end
138
138
 
@@ -169,14 +169,14 @@ module Polonium
169
169
  mock.proxy(element).values_match?.with_any_args.times(4)
170
170
  proc do
171
171
  element.assert_attribute('theattribute', "joe")
172
- end.should raise_error(Test::Unit::AssertionFailedError)
172
+ end.should raise_error(PoloniumError)
173
173
  end
174
174
 
175
175
  it "fails when element is not present" do
176
176
  stub(driver).is_element_present(element_locator) {false}
177
177
  proc do
178
178
  element.assert_attribute('theattribute', "joe")
179
- end.should raise_error(Test::Unit::AssertionFailedError)
179
+ end.should raise_error(PoloniumError)
180
180
  end
181
181
  end
182
182
 
@@ -192,14 +192,14 @@ module Polonium
192
192
  stub(driver).get_attribute("#{element_locator}@theattribute") { "jane" }
193
193
  proc do
194
194
  element.assert_attribute_does_not_contain('theattribute', "jane")
195
- end.should raise_error(Test::Unit::AssertionFailedError)
195
+ end.should raise_error(PoloniumError)
196
196
  end
197
197
 
198
198
  it "fails when element is not present" do
199
199
  stub(driver).is_element_present(element_locator) {false}
200
200
  proc do
201
201
  element.assert_attribute_does_not_contain('theattribute', "jane")
202
- end.should raise_error(Test::Unit::AssertionFailedError)
202
+ end.should raise_error(PoloniumError)
203
203
  end
204
204
  end
205
205
 
@@ -229,14 +229,14 @@ module Polonium
229
229
 
230
230
  proc do
231
231
  element.assert_selected("joe")
232
- end.should raise_error(Test::Unit::AssertionFailedError)
232
+ end.should raise_error(PoloniumError)
233
233
  end
234
234
 
235
235
  it "fails when element is not present" do
236
236
  stub(driver).is_element_present(element_locator) {false}
237
237
  proc do
238
238
  element.assert_selected("joe")
239
- end.should raise_error(Test::Unit::AssertionFailedError)
239
+ end.should raise_error(PoloniumError)
240
240
  end
241
241
  end
242
242
 
@@ -262,14 +262,14 @@ module Polonium
262
262
  stub(driver).is_visible(element_locator) {false}
263
263
  proc do
264
264
  element.assert_visible
265
- end.should raise_error(Test::Unit::AssertionFailedError)
265
+ end.should raise_error(PoloniumError)
266
266
  end
267
267
 
268
268
  it "fails when element is not present" do
269
269
  stub(driver).is_element_present(element_locator) {false}
270
270
  proc do
271
271
  element.assert_visible
272
- end.should raise_error(Test::Unit::AssertionFailedError)
272
+ end.should raise_error(PoloniumError)
273
273
  end
274
274
  end
275
275
 
@@ -295,14 +295,14 @@ module Polonium
295
295
  stub(driver).is_visible(element_locator) {true}
296
296
  proc do
297
297
  element.assert_not_visible
298
- end.should raise_error(Test::Unit::AssertionFailedError)
298
+ end.should raise_error(PoloniumError)
299
299
  end
300
300
 
301
301
  it "fails when element is not present" do
302
302
  stub(driver).is_element_present(element_locator) {false}
303
303
  proc do
304
304
  element.assert_visible
305
- end.should raise_error(Test::Unit::AssertionFailedError)
305
+ end.should raise_error(PoloniumError)
306
306
  end
307
307
  end
308
308
 
@@ -328,14 +328,14 @@ module Polonium
328
328
  stub(driver).is_checked(element_locator) {false}
329
329
  proc do
330
330
  element.assert_checked
331
- end.should raise_error(Test::Unit::AssertionFailedError)
331
+ end.should raise_error(PoloniumError)
332
332
  end
333
333
 
334
334
  it "fails when element is not present" do
335
335
  stub(driver).is_element_present(element_locator) {false}
336
336
  proc do
337
337
  element.assert_checked
338
- end.should raise_error(Test::Unit::AssertionFailedError)
338
+ end.should raise_error(PoloniumError)
339
339
  end
340
340
  end
341
341
 
@@ -361,14 +361,14 @@ module Polonium
361
361
  stub(driver).is_checked(element_locator) {true}
362
362
  proc do
363
363
  element.assert_not_checked
364
- end.should raise_error(Test::Unit::AssertionFailedError)
364
+ end.should raise_error(PoloniumError)
365
365
  end
366
366
 
367
367
  it "fails when element is not present" do
368
368
  stub(driver).is_element_present(element_locator) {false}
369
369
  proc do
370
370
  element.assert_not_checked
371
- end.should raise_error(Test::Unit::AssertionFailedError)
371
+ end.should raise_error(PoloniumError)
372
372
  end
373
373
  end
374
374
 
@@ -398,14 +398,14 @@ module Polonium
398
398
 
399
399
  proc do
400
400
  element.assert_text "match"
401
- end.should raise_error(Test::Unit::AssertionFailedError)
401
+ end.should raise_error(PoloniumError)
402
402
  end
403
403
 
404
404
  it "fails when element is not present" do
405
405
  stub(driver).is_element_present(element_locator) {false}
406
406
  proc do
407
407
  element.assert_text "match"
408
- end.should raise_error(Test::Unit::AssertionFailedError)
408
+ end.should raise_error(PoloniumError)
409
409
  end
410
410
  end
411
411
 
@@ -433,7 +433,7 @@ module Polonium
433
433
  stub(driver).get_eval(@evaled_js) {"html"}
434
434
  proc do
435
435
  element.assert_contains "this is not contained in the html"
436
- end.should raise_error(Test::Unit::AssertionFailedError)
436
+ end.should raise_error(PoloniumError)
437
437
  end
438
438
  end
439
439
 
@@ -455,7 +455,7 @@ module Polonium
455
455
  stub(driver).get_eval(@evaled_js) {"html"}
456
456
  proc do
457
457
  element.assert_contains /blahblah/
458
- end.should raise_error(Test::Unit::AssertionFailedError)
458
+ end.should raise_error(PoloniumError)
459
459
  end
460
460
  end
461
461
 
@@ -463,7 +463,7 @@ module Polonium
463
463
  stub(driver).is_element_present(element_locator) {false}
464
464
  proc do
465
465
  element.assert_contains "the element does not exist"
466
- end.should raise_error(Test::Unit::AssertionFailedError)
466
+ end.should raise_error(PoloniumError)
467
467
  end
468
468
 
469
469
  it "calls assert_contains_in_order when passed an array" do
@@ -500,7 +500,7 @@ module Polonium
500
500
  stub(driver).get_eval(@evaled_js) {"html match html"}
501
501
  proc do
502
502
  element.assert_does_not_contain "match"
503
- end.should raise_error(Test::Unit::AssertionFailedError)
503
+ end.should raise_error(PoloniumError)
504
504
  end
505
505
  end
506
506
 
@@ -522,7 +522,7 @@ module Polonium
522
522
  stub(driver).get_eval(@evaled_js) {"html match html"}
523
523
  proc do
524
524
  element.assert_does_not_contain /match/
525
- end.should raise_error(Test::Unit::AssertionFailedError)
525
+ end.should raise_error(PoloniumError)
526
526
  end
527
527
  end
528
528
 
@@ -530,7 +530,7 @@ module Polonium
530
530
  stub(driver).is_element_present(element_locator) {false}
531
531
  proc do
532
532
  element.assert_does_not_contain "match"
533
- end.should raise_error(Test::Unit::AssertionFailedError)
533
+ end.should raise_error(PoloniumError)
534
534
  end
535
535
  end
536
536
 
@@ -557,14 +557,14 @@ module Polonium
557
557
  stub(driver).get_eval(@evaled_js) {""}
558
558
  proc do
559
559
  element.assert_next_sibling "next_element"
560
- end.should raise_error(Test::Unit::AssertionFailedError)
560
+ end.should raise_error(PoloniumError)
561
561
  end
562
562
 
563
563
  it "fails when element is not present" do
564
564
  stub(driver).is_element_present(@element_locator) {false}
565
565
  proc do
566
566
  element.assert_next_sibling "match"
567
- end.should raise_error(Test::Unit::AssertionFailedError)
567
+ end.should raise_error(PoloniumError)
568
568
  end
569
569
  end
570
570
 
@@ -596,14 +596,14 @@ module Polonium
596
596
  stub(driver).get_text(@element_locator) {"no match"}
597
597
  proc do
598
598
  element.assert_contains_in_order 'one', 'two', 'three'
599
- end.should raise_error(Test::Unit::AssertionFailedError)
599
+ end.should raise_error(PoloniumError)
600
600
  end
601
601
 
602
602
  it "fails when element is not present" do
603
603
  stub(driver).is_element_present(@element_locator) {false}
604
604
  proc do
605
605
  element.assert_contains_in_order 'one', 'two', 'three'
606
- end.should raise_error(Test::Unit::AssertionFailedError)
606
+ end.should raise_error(PoloniumError)
607
607
  end
608
608
  end
609
609
 
@@ -624,14 +624,14 @@ module Polonium
624
624
  stub(driver).get_eval(@evaled_js) { 999 }
625
625
  proc do
626
626
  element.assert_number_of_children(3)
627
- end.should raise_error(Test::Unit::AssertionFailedError)
627
+ end.should raise_error(PoloniumError)
628
628
  end
629
629
 
630
630
  it "fails when element is not present" do
631
631
  stub(driver).is_element_present(@element_locator) {false}
632
632
  proc do
633
633
  element.assert_number_of_children 3
634
- end.should raise_error(Test::Unit::AssertionFailedError)
634
+ end.should raise_error(PoloniumError)
635
635
  end
636
636
  end
637
637
 
@@ -1,13 +1,13 @@
1
1
  require File.expand_path(File.dirname(__FILE__) + "/../../spec_helper")
2
2
 
3
3
  describe Module do
4
- describe "#deprecate" do
4
+ describe "#polonium_deprecate" do
5
5
  it "creates a method that calls another method with a deprecation warning" do
6
6
  klass = Class.new do
7
7
  def car
8
8
  :beep
9
9
  end
10
- deprecate :horse, :car
10
+ polonium_deprecate :horse, :car
11
11
  end
12
12
  obj = klass.new
13
13
  mock(obj).warn("horse is deprecated. Use car instead.")
@@ -19,7 +19,7 @@ describe Module do
19
19
  def car(name, location='here')
20
20
  "You have a #{name} located at #{location}"
21
21
  end
22
- deprecate :horse, :car
22
+ polonium_deprecate :horse, :car
23
23
  end
24
24
  obj = klass.new
25
25
  mock(obj).warn("horse is deprecated. Use car instead.")
@@ -61,7 +61,7 @@ module Polonium
61
61
  end
62
62
  proc do
63
63
  page.open_and_wait("/users/list")
64
- end.should raise_error(Test::Unit::AssertionFailedError)
64
+ end.should raise_error(PoloniumError)
65
65
  end
66
66
  end
67
67
 
@@ -118,7 +118,7 @@ module Polonium
118
118
 
119
119
  lambda do
120
120
  page.assert_text_present("nowhere")
121
- end.should raise_error(Test::Unit::AssertionFailedError)
121
+ end.should raise_error(PoloniumError)
122
122
  end
123
123
  end
124
124
 
@@ -135,7 +135,7 @@ module Polonium
135
135
 
136
136
  lambda do
137
137
  page.assert_text_present(/nowhere/)
138
- end.should raise_error(Test::Unit::AssertionFailedError)
138
+ end.should raise_error(PoloniumError)
139
139
  end
140
140
  end
141
141
 
@@ -170,7 +170,7 @@ module Polonium
170
170
 
171
171
  lambda do
172
172
  page.assert_text_not_present("match")
173
- end.should raise_error(Test::Unit::AssertionFailedError)
173
+ end.should raise_error(PoloniumError)
174
174
  end
175
175
  end
176
176
 
@@ -186,7 +186,7 @@ module Polonium
186
186
 
187
187
  lambda do
188
188
  page.assert_text_not_present(/match/)
189
- end.should raise_error(Test::Unit::AssertionFailedError)
189
+ end.should raise_error(PoloniumError)
190
190
  end
191
191
  end
192
192
 
@@ -67,7 +67,7 @@ module Polonium
67
67
  it "raises a AssertionFailedError" do
68
68
  proc do
69
69
  test_case.wait_for(:timeout => 2) {false}
70
- end.should raise_error(Test::Unit::AssertionFailedError, "Timeout exceeded (after 2 sec)")
70
+ end.should raise_error(PoloniumError, "Timeout exceeded (after 2 sec)")
71
71
  end
72
72
  end
73
73
  end
@@ -80,7 +80,7 @@ module Polonium
80
80
 
81
81
  describe "#open_home_page" do
82
82
  it "opens home page" do
83
- mock(driver).open("http://localhost:4000")
83
+ mock(driver).open("http://127.0.0.1:4000")
84
84
  test_case.open_home_page
85
85
  end
86
86
  end
@@ -95,7 +95,7 @@ module Polonium
95
95
  stub(driver).do_command("getTitle", []) {result("no page")}
96
96
  proc do
97
97
  test_case.assert_title("my page")
98
- end.should raise_error(Test::Unit::AssertionFailedError)
98
+ end.should raise_error(PoloniumError)
99
99
  end
100
100
  end
101
101
 
@@ -119,7 +119,7 @@ module Polonium
119
119
  stub(driver).is_text_present("my page") {false}
120
120
  proc do
121
121
  test_case.assert_text_present("my page")
122
- end.should raise_error(Test::Unit::AssertionFailedError)
122
+ end.should raise_error(PoloniumError)
123
123
  end
124
124
  end
125
125
 
@@ -143,7 +143,7 @@ module Polonium
143
143
  stub(driver).is_text_present("my page") {true}
144
144
  proc do
145
145
  test_case.assert_text_not_present("my page")
146
- end.should raise_error(Test::Unit::AssertionFailedError)
146
+ end.should raise_error(PoloniumError)
147
147
  end
148
148
  end
149
149
 
@@ -173,7 +173,7 @@ module Polonium
173
173
  stub(driver).get_location {"http://no.com"}
174
174
  proc do
175
175
  test_case.assert_location_ends_with(@ends_with)
176
- end.should raise_error(Test::Unit::AssertionFailedError)
176
+ end.should raise_error(PoloniumError)
177
177
  end
178
178
  end
179
179
 
@@ -199,7 +199,7 @@ module Polonium
199
199
  end
200
200
  proc do
201
201
  test_case.assert_element_present(sample_locator)
202
- end.should raise_error(Test::Unit::AssertionFailedError)
202
+ end.should raise_error(PoloniumError)
203
203
  end
204
204
  end
205
205
 
@@ -227,7 +227,7 @@ module Polonium
227
227
  end
228
228
  proc do
229
229
  test_case.assert_element_not_present(sample_locator)
230
- end.should raise_error(Test::Unit::AssertionFailedError)
230
+ end.should raise_error(PoloniumError)
231
231
  end
232
232
  end
233
233
 
@@ -254,7 +254,7 @@ module Polonium
254
254
  end
255
255
  proc do
256
256
  test_case.assert_value(sample_locator, "passed in value")
257
- end.should raise_error(Test::Unit::AssertionFailedError)
257
+ end.should raise_error(PoloniumError)
258
258
  end
259
259
  end
260
260
 
@@ -284,7 +284,7 @@ module Polonium
284
284
  end
285
285
  proc do
286
286
  test_case.assert_element_contains(sample_locator, "passed in value")
287
- end.should raise_error(Test::Unit::AssertionFailedError)
287
+ end.should raise_error(PoloniumError)
288
288
  end
289
289
  end
290
290
 
@@ -352,7 +352,7 @@ module Polonium
352
352
  end
353
353
  proc do
354
354
  test_case.assert_element_does_not_contain(sample_locator, "passed in value")
355
- end.should raise_error(Test::Unit::AssertionFailedError)
355
+ end.should raise_error(PoloniumError)
356
356
  end
357
357
  end
358
358
 
@@ -392,7 +392,7 @@ module Polonium
392
392
  end
393
393
  proc do
394
394
  test_case.assert_attribute(sample_locator, 'id', "passed in value")
395
- end.should raise_error(Test::Unit::AssertionFailedError)
395
+ end.should raise_error(PoloniumError)
396
396
  end
397
397
  end
398
398
 
@@ -419,7 +419,7 @@ module Polonium
419
419
  end
420
420
  proc do
421
421
  test_case.assert_selected(sample_locator, "passed_in_element")
422
- end.should raise_error(Test::Unit::AssertionFailedError)
422
+ end.should raise_error(PoloniumError)
423
423
  end
424
424
  end
425
425
 
@@ -446,7 +446,7 @@ module Polonium
446
446
  end
447
447
  proc do
448
448
  test_case.assert_checked(sample_locator)
449
- end.should raise_error(Test::Unit::AssertionFailedError)
449
+ end.should raise_error(PoloniumError)
450
450
  end
451
451
  end
452
452
 
@@ -473,7 +473,7 @@ module Polonium
473
473
  end
474
474
  proc do
475
475
  test_case.assert_not_checked(sample_locator)
476
- end.should raise_error(Test::Unit::AssertionFailedError)
476
+ end.should raise_error(PoloniumError)
477
477
  end
478
478
  end
479
479
 
@@ -500,7 +500,7 @@ module Polonium
500
500
  end
501
501
  proc do
502
502
  test_case.assert_text(sample_locator, "expected text")
503
- end.should raise_error(Test::Unit::AssertionFailedError)
503
+ end.should raise_error(PoloniumError)
504
504
  end
505
505
  end
506
506
 
@@ -525,7 +525,7 @@ module Polonium
525
525
 
526
526
  proc {
527
527
  test_case.assert_visible(sample_locator)
528
- }.should raise_error(Test::Unit::AssertionFailedError)
528
+ }.should raise_error(PoloniumError)
529
529
  end
530
530
  end
531
531
 
@@ -550,7 +550,7 @@ module Polonium
550
550
 
551
551
  proc {
552
552
  test_case.assert_not_visible(sample_locator)
553
- }.should raise_error(Test::Unit::AssertionFailedError)
553
+ }.should raise_error(PoloniumError)
554
554
  end
555
555
  end
556
556
 
@@ -578,7 +578,7 @@ module Polonium
578
578
  end
579
579
  proc do
580
580
  test_case.assert_next_sibling(sample_locator, "next_sibling")
581
- end.should raise_error(Test::Unit::AssertionFailedError)
581
+ end.should raise_error(PoloniumError)
582
582
  end
583
583
  end
584
584
 
@@ -603,7 +603,7 @@ module Polonium
603
603
  end
604
604
  proc do
605
605
  test_case.assert_contains_in_order sample_locator, "one", "two", "three"
606
- end.should raise_error(Test::Unit::AssertionFailedError)
606
+ end.should raise_error(PoloniumError)
607
607
  end
608
608
  end
609
609
 
@@ -640,7 +640,7 @@ module Polonium
640
640
 
641
641
  proc do
642
642
  test_case.assert_element_contains(sample_locator, "")
643
- end.should raise_error(Test::Unit::AssertionFailedError, "Expected element 'sample_locator' to be present, but it was not (after 5 sec)")
643
+ end.should raise_error(PoloniumError, "Expected element 'sample_locator' to be present, but it was not (after 5 sec)")
644
644
  end
645
645
 
646
646
  it "when text does not match in time, fails" do
@@ -654,7 +654,7 @@ module Polonium
654
654
 
655
655
  proc do
656
656
  test_case.assert_element_contains(sample_locator, "wrong text")
657
- end.should raise_error(Test::Unit::AssertionFailedError, "sample_locator should contain wrong text (after 5 sec)")
657
+ end.should raise_error(PoloniumError, "sample_locator should contain wrong text (after 5 sec)")
658
658
  end
659
659
  end
660
660
 
@@ -8,7 +8,7 @@ describe Spec::Runner::Options do
8
8
  @configuration = Polonium::Configuration.new
9
9
  Polonium::Configuration.instance = configuration
10
10
  @the_rspec_options = Spec::Runner::Options.new(StringIO.new, StringIO.new)
11
- the_rspec_options.after_suite_parts.push(*rspec_options.after_suite_parts)
11
+ the_rspec_options.after_suite_parts.push(*Spec::Runner.options.after_suite_parts)
12
12
 
13
13
  configuration.app_server_engine = :mongrel
14
14
  @app_server_runner = configuration.create_app_server_runner
@@ -1,5 +1,4 @@
1
1
  require 'rubygems'
2
- gem 'rspec', ">=1.1.0"
3
2
  require 'spec'
4
3
  require 'rr'
5
4
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: polonium
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pivotal Labs
@@ -9,10 +9,19 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-08-01 00:00:00 -07:00
12
+ date: 2008-11-10 00:00:00 -08:00
13
13
  default_executable:
14
- dependencies: []
15
-
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: Selenium
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.1.14
24
+ version:
16
25
  description: Selenium RC with Rails integration and enhanced assertions.
17
26
  email: opensource@pivotallabs.com
18
27
  executables: []
@@ -35,6 +44,7 @@ files:
35
44
  - lib/polonium/element.rb
36
45
  - lib/polonium/extensions/module.rb
37
46
  - lib/polonium/page.rb
47
+ - lib/polonium/polonium_error.rb
38
48
  - lib/polonium/selenium_helper.rb
39
49
  - lib/polonium/server_runners/external_server_runner.rb
40
50
  - lib/polonium/server_runners/mongrel_server_runner.rb
@@ -68,7 +78,7 @@ files:
68
78
  - spec/test_unit/testrunnermediator_spec.rb
69
79
  - spec/test_unit_spec_suite.rb
70
80
  has_rdoc: true
71
- homepage: http://pivotallabs.com
81
+ homepage: http://pivotalrb.rubyforge.org
72
82
  post_install_message:
73
83
  rdoc_options:
74
84
  - --main
@@ -92,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
92
102
  requirements: []
93
103
 
94
104
  rubyforge_project: pivotalrb
95
- rubygems_version: 1.2.0
105
+ rubygems_version: 1.3.1
96
106
  signing_key:
97
107
  specification_version: 2
98
108
  summary: Selenium RC with Rails integration and enhanced assertions.