pivotal-selenium-rc 1.3.20090112 → 1.4.20090112
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/VERSION.yml +1 -1
- data/lib/selenium_rc/server.rb +11 -6
- data/spec/selenium_rc/server_spec.rb +31 -0
- data/spec/spec_helper.rb +2 -0
- metadata +7 -5
data/VERSION.yml
CHANGED
data/lib/selenium_rc/server.rb
CHANGED
@@ -2,8 +2,8 @@ module SeleniumRC
|
|
2
2
|
|
3
3
|
class Server
|
4
4
|
class << self
|
5
|
-
def boot
|
6
|
-
new.boot
|
5
|
+
def boot(*argv)
|
6
|
+
new.boot(argv)
|
7
7
|
end
|
8
8
|
|
9
9
|
def host
|
@@ -26,16 +26,21 @@ module SeleniumRC
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
-
def boot
|
30
|
-
start
|
29
|
+
def boot(*argv)
|
30
|
+
start(argv)
|
31
31
|
wait
|
32
32
|
stop_at_exit
|
33
33
|
end
|
34
34
|
|
35
|
-
def
|
35
|
+
def log(string)
|
36
|
+
puts string
|
37
|
+
end
|
38
|
+
|
39
|
+
def start(*argv)
|
36
40
|
command = "java -jar \"#{jar_path}\""
|
37
41
|
command << " -port #{self.class.port}"
|
38
|
-
|
42
|
+
command << " #{argv.join(' ')}" if argv.length > 0
|
43
|
+
log "Running: #{command}"
|
39
44
|
system(command)
|
40
45
|
end
|
41
46
|
|
@@ -0,0 +1,31 @@
|
|
1
|
+
require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")
|
2
|
+
|
3
|
+
module SeleniumRC
|
4
|
+
describe Server do
|
5
|
+
|
6
|
+
before do
|
7
|
+
@server = Server.new
|
8
|
+
stub(@server).log
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "#start" do
|
12
|
+
|
13
|
+
it "launches java with the jar file and port" do
|
14
|
+
stub(Server).port { "5555" }
|
15
|
+
expected_command = %Q{java -jar "/path/to/the.jar" -port 5555}
|
16
|
+
mock(@server).system(expected_command)
|
17
|
+
mock(@server).jar_path {"/path/to/the.jar"}
|
18
|
+
@server.start
|
19
|
+
end
|
20
|
+
|
21
|
+
context "when passed additional arguments" do
|
22
|
+
it "adds the additional arguments to the selenium start command" do
|
23
|
+
expected_command = %Q{java -jar "/path/to/the.jar" -port 4444 -browserSideLog -suppressStupidness}
|
24
|
+
mock(@server).system(expected_command)
|
25
|
+
mock(@server).jar_path {"/path/to/the.jar"}
|
26
|
+
@server.start("-browserSideLog", "-suppressStupidness")
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -4,10 +4,12 @@ require "spec/autorun"
|
|
4
4
|
require "fileutils"
|
5
5
|
require "timeout"
|
6
6
|
require "tcp_socket_extension"
|
7
|
+
require "rr"
|
7
8
|
|
8
9
|
dir = File.dirname(__FILE__)
|
9
10
|
$:.unshift(File.expand_path("#{dir}/../lib"))
|
10
11
|
require "selenium_rc"
|
11
12
|
|
12
13
|
Spec::Runner.configure do |config|
|
14
|
+
config.mock_with :rr
|
13
15
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pivotal-selenium-rc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.20090112
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pivotal Labs
|
@@ -12,7 +12,7 @@ autorequire:
|
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
14
|
|
15
|
-
date: 2009-05-
|
15
|
+
date: 2009-05-12 00:00:00 -07:00
|
16
16
|
default_executable: selenium-rc
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
@@ -41,10 +41,11 @@ files:
|
|
41
41
|
- lib/selenium_rc.rb
|
42
42
|
- lib/selenium_rc/server.rb
|
43
43
|
- spec/install_and_run_spec.rb
|
44
|
+
- spec/selenium_rc/server_spec.rb
|
44
45
|
- spec/spec_helper.rb
|
45
46
|
- spec/spec_suite.rb
|
46
47
|
- vendor/empty.txt
|
47
|
-
has_rdoc:
|
48
|
+
has_rdoc: false
|
48
49
|
homepage: http://github.com/pivotal/selenium-rc
|
49
50
|
post_install_message:
|
50
51
|
rdoc_options:
|
@@ -68,9 +69,10 @@ requirements: []
|
|
68
69
|
rubyforge_project:
|
69
70
|
rubygems_version: 1.2.0
|
70
71
|
signing_key:
|
71
|
-
specification_version:
|
72
|
+
specification_version: 3
|
72
73
|
summary: The Selenium RC Server packaged as a gem.
|
73
74
|
test_files:
|
74
75
|
- spec/install_and_run_spec.rb
|
75
|
-
- spec/
|
76
|
+
- spec/selenium_rc/server_spec.rb
|
76
77
|
- spec/spec_helper.rb
|
78
|
+
- spec/spec_suite.rb
|