Sha256: 9760f6a10c98f1f4c697905019f2e4468e6439d1c7b8ed7713401ddb19dc5279

Contents?: true

Size: 1.05 KB

Versions: 5

Compression:

Stored size: 1.05 KB

Contents

require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")

module SeleniumRC
  describe Server do

    def new_server(*args)
      server = Server.new(*args)
      stub(server).log
      stub(server).fork.yields
      server
    end

    describe "#start" do
      it "launches java with the jar file and port" do
        @server = new_server("0.0.0.0", 5555)

        expected_command = %Q{java -jar "/path/to/the.jar" -port 5555}
        mock(@server).system(expected_command)
        mock(@server).jar_path {"/path/to/the.jar"}
        @server.start
      end

      context "when passed additional arguments" do
        it "adds the additional arguments to the selenium start command" do
          @server = new_server("0.0.0.0", 4444, :args => ["-browserSideLog", "-suppressStupidness"])
          expected_command = %Q{java -jar "/path/to/the.jar" -port 4444 -browserSideLog -suppressStupidness}
          mock(@server).system(expected_command)
          mock(@server).jar_path {"/path/to/the.jar"}
          @server.start
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
selenium-rc-2.2.4 spec/selenium_rc/server_spec.rb
honkster-selenium-rc-2.2.2 spec/selenium_rc/server_spec.rb
selenium-rc-2.2.1 spec/selenium_rc/server_spec.rb
selenium-rc-2.2.0 spec/selenium_rc/server_spec.rb
selenium-rc-2.1.0 spec/selenium_rc/server_spec.rb