Sha256: c2b3fe26cb5515c016eebd4e45458569736d14acca93d7db9d2131bcb112bb99

Contents?: true

Size: 1009 Bytes

Versions: 2

Compression:

Stored size: 1009 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + "../../spec_helper")

module Capybara
  def self.current_session
    @session ||= Object.new
  end
end

describe PageModels::Configuration do
  before(:each) do
    @config = PageModels::Configuration.instance
  end
  
  describe "providing a driver" do
    it "should raise an error if no driver is configured" do
      @config.driver = nil
      lambda { @config.driver }.should raise_error(PageModels::ConfigurationError)
    end
    
    it "should provide a Capybara session" do
      @config.driver = :capybara
      @config.driver.should == Capybara.current_session
    end
  end
  
  describe "integrating with frameworks" do
    it "should require the appropriate integration files" do
      @config.integrate :foo
      @config.integrate :bar
      
      @config.should_receive(:require).with("page_models/integration/foo")
      @config.should_receive(:require).with("page_models/integration/bar")
      
      @config.integrate!
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pagemodels-0.1.1 spec/page_models/configuration_spec.rb
pagemodels-0.1.0 spec/page_models/configuration_spec.rb