rwebspec 2.0.2 → 2.0.3

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/CHANGELOG CHANGED
@@ -1,5 +1,8 @@
1
1
  CHANGELOG
2
2
  =========
3
+ 2.0.3
4
+ [Deprecate] try() {} changed to try_until as cucumber use try constant, will remove from RWebSpec 3
5
+
3
6
  2.0.2
4
7
  [Fixes] select_file_upload
5
8
 
data/Rakefile CHANGED
@@ -71,7 +71,7 @@ end
71
71
  spec = Gem::Specification.new do |s|
72
72
  s.platform= Gem::Platform::RUBY
73
73
  s.name = "rwebspec"
74
- s.version = "2.0.2"
74
+ s.version = "2.0.3"
75
75
  s.summary = "Web application functional specification in Ruby"
76
76
  s.description = "Executable functional specification for web applications in RSpec syntax and Watir"
77
77
 
@@ -794,10 +794,10 @@ module RWebSpec
794
794
  # Try the operation up to specified timeout (in seconds), and sleep given interval (in seconds).
795
795
  # Error will be ignored until timeout
796
796
  # Example
797
- # try { click_link('waiting')}
798
- # try(10, 2) { click_button('Search' } # try to click the 'Search' button upto 10 seconds, try every 2 seconds
799
- # try { click_button('Search' }
800
- def try(timeout = @@default_timeout, polling_interval = @@default_polling_interval || 1, & block)
797
+ # try_until { click_link('waiting')}
798
+ # try_until(10, 2) { click_button('Search' } # try to click the 'Search' button upto 10 seconds, try every 2 seconds
799
+ # try_until { click_button('Search' }
800
+ def try_until(timeout = @@default_timeout, polling_interval = @@default_polling_interval || 1, &block)
801
801
  start_time = Time.now
802
802
 
803
803
  last_error = nil
@@ -816,8 +816,15 @@ module RWebSpec
816
816
  raise "Timeout after #{duration.to_i} seconds."
817
817
  end
818
818
 
819
- alias try_upto try
820
-
819
+ alias try_upto try_until
820
+
821
+ def try(timeout = @@default_timeout, polling_interval = @@default_polling_interval || 1, &block)
822
+ puts "Warning: method 'try' is deprecated (won't support in RWebSpec 3), use try_until instead."
823
+ try_until(timeout, polling_interval) {
824
+ yield
825
+ }
826
+ end
827
+
821
828
  ##
822
829
  # Convert :first to 1, :second to 2, and so on...
823
830
  def symbol_to_sequence(symb)
data/lib/rwebspec.rb CHANGED
@@ -30,7 +30,7 @@ end
30
30
  require 'spec'
31
31
 
32
32
  unless defined? RWEBSPEC_VERSION
33
- RWEBSPEC_VERSION = RWEBUNIT_VERSION = "2.0.2"
33
+ RWEBSPEC_VERSION = RWEBUNIT_VERSION = "2.0.3"
34
34
  end
35
35
 
36
36
  if RUBY_PLATFORM =~ /mswin/ or RUBY_PLATFORM =~ /mingw/
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 2
7
7
  - 0
8
- - 2
9
- version: 2.0.2
8
+ - 3
9
+ version: 2.0.3
10
10
  platform: ruby
11
11
  authors:
12
12
  - Zhimin Zhan
@@ -14,7 +14,7 @@ autorequire: rwebspec
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-11-10 00:00:00 +10:00
17
+ date: 2011-12-18 00:00:00 +10:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency