Permalink
Browse files

bump version to 3.1, support RSpec 2

  • Loading branch information...
1 parent cf17123 commit a41eeb89cbcbc36380f6694409c1d4e6e6fb8a66 Zhimin Zhan committed May 28, 2012
Showing with 60 additions and 75 deletions.
  1. +5 −2 CHANGELOG
  2. +3 −2 Rakefile
  3. +18 −41 lib/extensions/rspec_extensions.rb
  4. +19 −19 lib/extensions/window_script_extensions.rb
  5. +1 −1 lib/rwebspec.rb
  6. +8 −4 lib/rwebspec/web_browser.rb
  7. +6 −6 rwebspec.gemspec
View
@@ -1,8 +1,11 @@
CHANGELOG
=========
- 3.0.1
- - fixed not loading watir properly - not calling windows_extensions.rb
+3.1 (may break existing test)
+- Support RSpec 2
+
+3.0.1
+- fixed not loading watir properly - not calling windows_extensions.rb
WATIR CHANGES
[web_browser.rb]
View
@@ -71,7 +71,7 @@ end
spec = Gem::Specification.new do |s|
s.platform= Gem::Platform::RUBY
s.name = "rwebspec"
- s.version = "3.0.1"
+ s.version = "3.1.0"
s.summary = "Web application functional specification in Ruby"
s.description = "Executable functional specification for web applications in RSpec syntax and Watir"
@@ -90,7 +90,8 @@ spec = Gem::Specification.new do |s|
s.files = s.files + Dir.glob( "test/**/*" )
s.files = s.files + Dir.glob( "sample/**/*")
s.files = s.files + Dir.glob( "docs/**/*" )
- s.add_dependency(%q<rspec>, ["= 1.1.12"])
+ s.add_dependency(%q<rspec>, [">= 2.10"])
+ s.add_dependency(%q<rspec-core>, [">= 2.10.1"])
s.add_dependency("commonwatir", ">= 3.0")
end
@@ -1,51 +1,28 @@
-module Spec
- module Extensions
- module Main
- alias :spec :describe
- alias :specification :describe
- alias :test_suite :describe
- alias :suite :describe
-
- end
- end
+module RSpec
+ module Core
+ module DSL
+ alias_method :specification, :describe
+ alias_method :test_suite, :describe
+ end
+ end
end
-# For RSpec 1.1.12
-module Spec
- module DSL
- module Main
+module RSpec
+ module Core
+ class ExampleGroup
- alias :spec :describe
- alias :specification :describe
- alias :test_suite :describe
- alias :suite :describe
+ define_example_method :scenario
+ define_example_method :story
+ define_example_method :test_case
+ define_example_method :use_case
+ define_example_method :test
- end
- end
-end
-
-# ZZ patches to RSpec 1.1.4
-# - add to_s method to example_group
-module Spec
- module Example
- class ExampleGroup
- def to_s
- @_defined_description
+ class << self
+ alias_method :specification, :describe
+ alias_method :test_suite, :describe
end
- end
- end
-end
-
-module Spec
- module Example
- module ExampleGroupMethods
- alias_method :scenario, :it
- alias_method :story, :it
- alias_method :test_case, :it
- alias_method :use_case, :it
- alias_method :test, :it
end
end
end
@@ -1,19 +1,19 @@
-require 'rubygems'
-require 'watir'
-
-# Used for calling javacript of VBScript
-# Applies to IE only
-#
-# Ref: http://msdn.microsoft.com/en-us/library/aa741364%28VS.85%29.aspx
-#
-module Watir
- class IE
- def execute_script(scriptCode)
- window.execScript(scriptCode)
- end
-
- def window
- ie.Document.parentWindow
- end
- end
-end
+# require 'rubygems'
+# require 'watir'
+#
+# # Used for calling javacript of VBScript
+# # Applies to IE only
+# #
+# # Ref: http://msdn.microsoft.com/en-us/library/aa741364%28VS.85%29.aspx
+# #
+# module Watir
+# class IE
+# def execute_script(scriptCode)
+# window.execScript(scriptCode)
+# end
+#
+# def window
+# ie.Document.parentWindow
+# end
+# end
+# end
View
@@ -13,7 +13,7 @@
# active_support 2.0 loaded error
end
-require 'spec'
+require 'rspec'
unless defined? RWEBSPEC_VERSION
RWEBSPEC_VERSION = RWEBUNIT_VERSION = "3.0.1"
@@ -2,22 +2,23 @@
#* Copyright (c) 2006, Zhimin Zhan.
#* Distributed open-source, see full license in MIT-LICENSE
#***********************************************************
-
begin
require 'watir'
# require 'watir/contrib/enabled_popup'
# require 'watir/close_all'
# require 'watir/screen_capture'
# NO need any more
- # require 'watir/ie'
+ require 'watir-classic/ie'
# require 'watir/contrib/visible'
$watir_loaded = true
rescue LoadError => e
- puts e
+ puts "!!!Error on loading watir: #{e}"
$watir_loaded = false
end
-raise "You have must at least Watir installed" unless $watir_loaded
+if RUBY_PLATFORM =~ /mingw/
+ raise "You have must at least Watir installed" unless $watir_loaded
+end
module RWebSpec
@@ -68,6 +69,9 @@ def initialize_ie_browser(existing_browser, options)
def self.reuse(base_url, options)
if self.is_windows? && ($TESTWISE_BROWSER != "Firefox" && $ITEST2_BROWSER != "Firefox")
+ require 'watir-classic/ie'
+ # try to avoid
+ # lib/ruby/1.8/dl/win32.rb:11:in `sym': unknown type specifier 'v'
Watir::IE.each do |browser_window|
return WebBrowser.new(base_url, browser_window, options)
end
View
@@ -22,14 +22,14 @@ Gem::Specification.new do |s|
s.specification_version = 2
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
- s.add_runtime_dependency(%q<rspec>, ["= 1.1.12"])
- s.add_runtime_dependency(%q<commonwatir>, [">= 2.0"])
+ s.add_runtime_dependency(%q<rspec>, [">= 2.10"])
+ s.add_runtime_dependency(%q<commonwatir>, [">= 3.0"])
else
- s.add_dependency(%q<rspec>, ["= 1.1.12"])
- s.add_dependency(%q<commonwatir>, [">= 2.0"])
+ s.add_dependency(%q<rspec>, [">= 2.10"])
+ s.add_dependency(%q<commonwatir>, [">= 3.0"])
end
else
- s.add_dependency(%q<rspec>, ["= 1.1.12"])
- s.add_dependency(%q<commonwatir>, [">= 2.0"])
+ s.add_dependency(%q<rspec>, [">= 2.10"])
+ s.add_dependency(%q<commonwatir>, [">= 3.0"])
end
end

0 comments on commit a41eeb8

Please sign in to comment.