selenium-grid 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -47,7 +47,7 @@ module Java
47
47
  def include_log(command, options)
48
48
  if options[:log]
49
49
  command << "> '#{options[:log]}' 2>&1"
50
- mkdir_p File.dirname(options[:log])
50
+ mkdir_p File.dirname(options[:log]), :verbose => false
51
51
  end
52
52
  end
53
53
 
@@ -2,7 +2,7 @@ module SeleniumGrid #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 2
5
- TINY = 2
5
+ TINY = 3
6
6
  STRING = [MAJOR, MINOR, TINY].join('.')
7
7
  end
8
8
  end
@@ -5,8 +5,7 @@ module Utils
5
5
  include Singleton
6
6
 
7
7
  def running?(port)
8
- result = system("netstat -an | grep #{port}")
9
- result
8
+ ! self.send(:`, "netstat -an | grep LISTEN | grep #{port}").empty?
10
9
  end
11
10
  end
12
11
  end
@@ -40,8 +40,8 @@ module Java
40
40
  end
41
41
 
42
42
  it "is the last option" do
43
- mock(vm).sh("java test.ClassName > '/var/log/test.log' 2>&1 &")
44
- vm.run "test.ClassName", {:background => true, :log => '/var/log/test.log'}
43
+ mock(vm).sh("java test.ClassName -one uno &")
44
+ vm.run "test.ClassName", {:background => true, :arguments => { :one => 'uno' }}
45
45
  end
46
46
  end
47
47
 
@@ -54,7 +54,7 @@ module Java
54
54
 
55
55
  context "when the options include :log" do
56
56
  before do
57
- mock(vm).mkdir_p("/var/log")
57
+ mock(vm).mkdir_p("/var/log", :verbose => false)
58
58
  end
59
59
 
60
60
  it "shells out to java and redirects output to the specified log file" do
@@ -10,9 +10,16 @@ module Utils
10
10
  @port = 1234
11
11
  end
12
12
 
13
+ describe "the system call" do
14
+ it "limits the results based on port and listening state" do
15
+ mock(Netstat.instance).send(:`, 'netstat -an | grep LISTEN | grep 1234')
16
+ Utils::Netstat.instance.running?(port)
17
+ end
18
+ end
19
+
13
20
  context "when the port is in use" do
14
21
  before do
15
- mock(Netstat.instance).system(anything) { true }
22
+ mock(Netstat.instance).send(:`, anything) { true }
16
23
  end
17
24
 
18
25
  it "returns true" do
@@ -22,7 +29,7 @@ module Utils
22
29
 
23
30
  context "when the port is not in use" do
24
31
  before do
25
- mock(Netstat.instance).system(anything) { false }
32
+ mock(Netstat.instance).send(:`, anything) { false }
26
33
  end
27
34
 
28
35
  it "returns false" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selenium-grid
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Dy
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2008-10-13 00:00:00 -07:00
14
+ date: 2008-10-14 00:00:00 -07:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency