Sha256: e0733c1dbd19e786809626252e8521b3f8fb1451efe6ec9084c71a4ba6fe782a

Contents?: true

Size: 1.28 KB

Versions: 19

Compression:

Stored size: 1.28 KB

Contents

require 'spec_helper'
require 'sauce/jasmine'

describe Sauce::Jasmine::Driver do
  describe '#initialize' do
    let(:address) { 'http://saucelabs.com' }
    let(:browser) { 'firefox' }

    it 'should take set the @http_address' do
      Sauce::Selenium2.stub(:new)
      d = Sauce::Jasmine::Driver.new(browser, address)
      d.http_address.should equal(address)
    end

    it 'should initialize a Sauce driver' do
      Sauce::Selenium2.should_receive(:new).with(hash_including(:browser => browser)).and_return(true)
      d = Sauce::Jasmine::Driver.new(browser, address)
      d.should_not be_nil
    end
  end
end


describe Jasmine::Config do
  describe '#start' do
    before :each do
      # Stub out the creation of the Selenium2 driver itself
      Sauce::Selenium2.stub(:new)
      Sauce::Jasmine::Driver.stub(:new).and_return(driver)
    end

    let(:driver) do
      driver = mock('Sauce::Jasmine::Driver')
      driver.stub(:connect)
      driver
    end

    it 'should create a Sauce::Jasmine::Driver' do
      Sauce::Jasmine::Driver.should_receive(:new).and_return(driver)
      subject.start
      subject.instance_variable_get(:@client).should be driver
    end

    it 'should call connect on the driver' do
      driver.should_receive(:connect)
      subject.start
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
sauce-2.5.2 spec/sauce/jasmine_spec.rb
sauce-2.5.1 spec/sauce/jasmine_spec.rb
sauce-2.4.6 spec/sauce/jasmine_spec.rb
sauce-2.4.5 spec/sauce/jasmine_spec.rb
sauce-2.4.4 spec/sauce/jasmine_spec.rb
sauce-2.4.3 spec/sauce/jasmine_spec.rb
sauce-2.4.2 spec/sauce/jasmine_spec.rb
sauce-2.4.1 spec/sauce/jasmine_spec.rb
sauce-2.4.0 spec/sauce/jasmine_spec.rb
sauce-2.3.6 spec/sauce/jasmine_spec.rb
sauce-2.3.5 spec/sauce/jasmine_spec.rb
sauce-2.3.4 spec/sauce/jasmine_spec.rb
sauce-2.3.3 spec/sauce/jasmine_spec.rb
sauce-2.3.2 spec/sauce/jasmine_spec.rb
sauce-2.2.2 spec/sauce/jasmine_spec.rb
sauce-2.2.1 spec/sauce/jasmine_spec.rb
sauce-2.2.0 spec/sauce/jasmine_spec.rb
sauce-2.1.0 spec/sauce/jasmine_spec.rb
sauce-2.0.0 spec/sauce/jasmine_spec.rb