Sha256: 8f8121fe45f71572b79ea00817b352e81baa485f5d207ae12b2cf5f546bcb816

Contents?: true

Size: 1.25 KB

Versions: 5

Compression:

Stored size: 1.25 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(anything).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

5 entries across 5 versions & 1 rubygems

Version Path
sauce-3.0.4 spec/sauce/jasmine_spec.rb
sauce-3.0.2 spec/sauce/jasmine_spec.rb
sauce-3.0.1 spec/sauce/jasmine_spec.rb
sauce-3.0.0 spec/sauce/jasmine_spec.rb
sauce-3.0.0.beta.2 spec/sauce/jasmine_spec.rb