Sha256: 2510ef193da0cfaf0fb0ad61fdb786a816dcbf9ef66a3220b26363be3f37b038

Contents?: true

Size: 840 Bytes

Versions: 8

Compression:

Stored size: 840 Bytes

Contents

require 'spec_helper'
require 'symbiont/factory'

class TestFactory
  include Symbiont::Factory
  
  attr_accessor :browser
end

describe Symbiont::Factory do
  before(:each) do
    @factory = TestFactory.new
    @factory.browser = mock_browser_for_watir
  end
  
  it "should create a new definition object" do
    @factory.on DefinitionTest do |page|
      page.should be_instance_of DefinitionTest
    end
  end
  
  it "should create a new definition object and view it" do
    @factory.browser.should_receive(:goto).twice
    @factory.on_view DefinitionTest do |page|
      page.should be_instance_of DefinitionTest
    end
  end
  
  it "should set a reference to be used outside the factory" do
    active = @factory.on DefinitionTest
    current = @factory.instance_variable_get "@active"
    current.should === active
  end
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
symbiont-0.1.5 spec/symbiont/factory_spec.rb
symbiont-0.1.4 spec/symbiont/factory_spec.rb
symbiont-0.1.3 spec/symbiont/factory_spec.rb
symbiont-0.1.2 spec/symbiont/factory_spec.rb
symbiont-0.1.1 spec/symbiont/factory_spec.rb
symbiont-0.1.0 spec/symbiont/factory_spec.rb
symbiont-0.0.4 spec/symbiont/factory_spec.rb
symbiont-0.0.3 spec/symbiont/factory_spec.rb