rwebspec 3.0.1 → 3.1.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/CHANGELOG +5 -2
- data/Rakefile +3 -2
- data/lib/extensions/rspec_extensions.rb +18 -41
- data/lib/extensions/window_script_extensions.rb +19 -19
- data/lib/rwebspec.rb +2 -2
- data/lib/rwebspec/web_browser.rb +8 -4
- metadata +23 -10
data/CHANGELOG
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
CHANGELOG
|
2
2
|
=========
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
3.1 (may break existing test)
|
5
|
+
- Support RSpec 2
|
6
|
+
|
7
|
+
3.0.1
|
8
|
+
- fixed not loading watir properly - not calling windows_extensions.rb
|
6
9
|
|
7
10
|
WATIR CHANGES
|
8
11
|
[web_browser.rb]
|
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 = "3.0
|
74
|
+
s.version = "3.1.0"
|
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
|
|
@@ -90,7 +90,8 @@ spec = Gem::Specification.new do |s|
|
|
90
90
|
s.files = s.files + Dir.glob( "test/**/*" )
|
91
91
|
s.files = s.files + Dir.glob( "sample/**/*")
|
92
92
|
s.files = s.files + Dir.glob( "docs/**/*" )
|
93
|
-
s.add_dependency(%q<rspec>, ["
|
93
|
+
s.add_dependency(%q<rspec>, [">= 2.10"])
|
94
|
+
s.add_dependency(%q<rspec-core>, [">= 2.10.1"])
|
94
95
|
s.add_dependency("commonwatir", ">= 3.0")
|
95
96
|
end
|
96
97
|
|
@@ -1,51 +1,28 @@
|
|
1
|
-
module Spec
|
2
|
-
module Extensions
|
3
|
-
module Main
|
4
1
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
2
|
+
module RSpec
|
3
|
+
module Core
|
4
|
+
module DSL
|
5
|
+
alias_method :specification, :describe
|
6
|
+
alias_method :test_suite, :describe
|
7
|
+
end
|
8
|
+
end
|
12
9
|
end
|
13
10
|
|
14
|
-
|
15
|
-
module
|
16
|
-
|
17
|
-
module Main
|
11
|
+
module RSpec
|
12
|
+
module Core
|
13
|
+
class ExampleGroup
|
18
14
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
15
|
+
define_example_method :scenario
|
16
|
+
define_example_method :story
|
17
|
+
define_example_method :test_case
|
18
|
+
define_example_method :use_case
|
19
|
+
define_example_method :test
|
23
20
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
# ZZ patches to RSpec 1.1.4
|
29
|
-
# - add to_s method to example_group
|
30
|
-
module Spec
|
31
|
-
module Example
|
32
|
-
class ExampleGroup
|
33
|
-
def to_s
|
34
|
-
@_defined_description
|
21
|
+
class << self
|
22
|
+
alias_method :specification, :describe
|
23
|
+
alias_method :test_suite, :describe
|
35
24
|
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
module Spec
|
41
|
-
module Example
|
42
|
-
module ExampleGroupMethods
|
43
25
|
|
44
|
-
alias_method :scenario, :it
|
45
|
-
alias_method :story, :it
|
46
|
-
alias_method :test_case, :it
|
47
|
-
alias_method :use_case, :it
|
48
|
-
alias_method :test, :it
|
49
26
|
end
|
50
27
|
end
|
51
28
|
end
|
@@ -1,19 +1,19 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'watir'
|
3
|
-
|
4
|
-
# Used for calling javacript of VBScript
|
5
|
-
# Applies to IE only
|
6
|
-
#
|
7
|
-
# Ref: http://msdn.microsoft.com/en-us/library/aa741364%28VS.85%29.aspx
|
8
|
-
#
|
9
|
-
module Watir
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
end
|
1
|
+
# require 'rubygems'
|
2
|
+
# require 'watir'
|
3
|
+
#
|
4
|
+
# # Used for calling javacript of VBScript
|
5
|
+
# # Applies to IE only
|
6
|
+
# #
|
7
|
+
# # Ref: http://msdn.microsoft.com/en-us/library/aa741364%28VS.85%29.aspx
|
8
|
+
# #
|
9
|
+
# module Watir
|
10
|
+
# class IE
|
11
|
+
# def execute_script(scriptCode)
|
12
|
+
# window.execScript(scriptCode)
|
13
|
+
# end
|
14
|
+
#
|
15
|
+
# def window
|
16
|
+
# ie.Document.parentWindow
|
17
|
+
# end
|
18
|
+
# end
|
19
|
+
# end
|
data/lib/rwebspec.rb
CHANGED
@@ -13,10 +13,10 @@ rescue LoadError => no_as1_err
|
|
13
13
|
# active_support 2.0 loaded error
|
14
14
|
end
|
15
15
|
|
16
|
-
require '
|
16
|
+
require 'rspec'
|
17
17
|
|
18
18
|
unless defined? RWEBSPEC_VERSION
|
19
|
-
RWEBSPEC_VERSION = RWEBUNIT_VERSION = "3.0
|
19
|
+
RWEBSPEC_VERSION = RWEBUNIT_VERSION = "3.1.0"
|
20
20
|
end
|
21
21
|
|
22
22
|
$testwise_polling_interval = 1 # seconds
|
data/lib/rwebspec/web_browser.rb
CHANGED
@@ -2,22 +2,23 @@
|
|
2
2
|
#* Copyright (c) 2006, Zhimin Zhan.
|
3
3
|
#* Distributed open-source, see full license in MIT-LICENSE
|
4
4
|
#***********************************************************
|
5
|
-
|
6
5
|
begin
|
7
6
|
require 'watir'
|
8
7
|
# require 'watir/contrib/enabled_popup'
|
9
8
|
# require 'watir/close_all'
|
10
9
|
# require 'watir/screen_capture'
|
11
10
|
# NO need any more
|
12
|
-
|
11
|
+
require 'watir-classic/ie'
|
13
12
|
# require 'watir/contrib/visible'
|
14
13
|
$watir_loaded = true
|
15
14
|
rescue LoadError => e
|
16
|
-
puts e
|
15
|
+
puts "!!!Error on loading watir: #{e}"
|
17
16
|
$watir_loaded = false
|
18
17
|
end
|
19
18
|
|
20
|
-
|
19
|
+
if RUBY_PLATFORM =~ /mingw/
|
20
|
+
raise "You have must at least Watir installed" unless $watir_loaded
|
21
|
+
end
|
21
22
|
|
22
23
|
module RWebSpec
|
23
24
|
|
@@ -68,6 +69,9 @@ module RWebSpec
|
|
68
69
|
|
69
70
|
def self.reuse(base_url, options)
|
70
71
|
if self.is_windows? && ($TESTWISE_BROWSER != "Firefox" && $ITEST2_BROWSER != "Firefox")
|
72
|
+
require 'watir-classic/ie'
|
73
|
+
# try to avoid
|
74
|
+
# lib/ruby/1.8/dl/win32.rb:11:in `sym': unknown type specifier 'v'
|
71
75
|
Watir::IE.each do |browser_window|
|
72
76
|
return WebBrowser.new(base_url, browser_window, options)
|
73
77
|
end
|
metadata
CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
|
|
4
4
|
prerelease: false
|
5
5
|
segments:
|
6
6
|
- 3
|
7
|
-
- 0
|
8
7
|
- 1
|
9
|
-
|
8
|
+
- 0
|
9
|
+
version: 3.1.0
|
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: 2012-05-
|
17
|
+
date: 2012-05-28 00:00:00 +10:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
@@ -22,19 +22,32 @@ dependencies:
|
|
22
22
|
prerelease: false
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- - "
|
25
|
+
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
segments:
|
28
|
-
-
|
29
|
-
-
|
30
|
-
|
31
|
-
version: 1.1.12
|
28
|
+
- 2
|
29
|
+
- 10
|
30
|
+
version: "2.10"
|
32
31
|
type: :runtime
|
33
32
|
version_requirements: *id001
|
34
33
|
- !ruby/object:Gem::Dependency
|
35
|
-
name:
|
34
|
+
name: rspec-core
|
36
35
|
prerelease: false
|
37
36
|
requirement: &id002 !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
segments:
|
41
|
+
- 2
|
42
|
+
- 10
|
43
|
+
- 1
|
44
|
+
version: 2.10.1
|
45
|
+
type: :runtime
|
46
|
+
version_requirements: *id002
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: commonwatir
|
49
|
+
prerelease: false
|
50
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
38
51
|
requirements:
|
39
52
|
- - ">="
|
40
53
|
- !ruby/object:Gem::Version
|
@@ -43,7 +56,7 @@ dependencies:
|
|
43
56
|
- 0
|
44
57
|
version: "3.0"
|
45
58
|
type: :runtime
|
46
|
-
version_requirements: *
|
59
|
+
version_requirements: *id003
|
47
60
|
description: Executable functional specification for web applications in RSpec syntax and Watir
|
48
61
|
email: zhimin@agileway.com.au
|
49
62
|
executables: []
|